Clone SD Card (Mac)


Here’s how to clone an SD card on a Mac. Useful when you want to backup and restore your Raspberry Pi.

Find path to SD card

$ diskutil list

Should be something like /dev/disk1, depending on what other devices you have connected to your system

Make image of SD card

$ sudo dd if=[sd card path] of=[image].dmg

Example

$ sudo dd if=/dev/disk1 of=~/Desktop/backup.dmg

Tip: During dd operations, hit [ctrl] + t to check transfer status

Transfer image to SD card

This will take much longer than making an image, since you are writing to an SD card, so grab a drink!

Caution: Double check input and output disk paths before running copy commands

~ $ diskutil unmountDisk [sd card path]
~ $ sudo dd if=[image file] of=[sd card path]

Example

$ sudo dd if=~/Desktop/backup.dmg of=/dev/disk2

Storing images

Image clones can be huge files, so compressing them will help save HD space!

Compress image

$ gzip [image file]

Uncompress image

$ gzip -d [compressed image file]

Comments


Mac Apps I'm Thankful For


Happy Turkey Day! These are the Mac apps that I’m thankful for:

  • Alfred

    Alfred

    for its ability to make launching apps quicker and easier
  • aText

    aText

    for helping me type less
  • XtraFinder

    XtraFinder

    for its tabbed Finder windows
  • BetterTouchTool

    BetterTouchTool

    for allowing me to customize gestures for my mice
  • iTerm 2

    iTerm 2

    for its tabbed Terminal interface

Comments


FTP - ASCII vs Binary


Which FTP transfer mode should you use to download/upload a file? ASCII or binary?

Here’s my general rule of thumb:

  • ASCII: Anything that can be edited via text editor (e.g. html, css, scripts, text files)

  • Binary: Everything else (e.g. PDFs, images, music, videos)

FTP clients typically have an auto-detect mode, so why might you want to know this?

Let’s say you’re SSH-ed into one machine and want to get a file from another machine. You won’t have the luxury of using an FTP client to get that file. You’re going to have to use ftp via command line, so not knowing which mode to get the file in will result in corrupt files! (Don’t worry if you discover your file is corrupt, just get the file again in the other mode!)

Not familiar with ftp via command line and want to learn or refresh your skills? Check out The Geek Stuff’s FTP and SFTP Beginners Guide with 10 Examples


Comments