![]() ![]() gz file, small enough to keep safe on a USB stick I had kicking around. Now you’re ready to run the restoration using the command sequence in the previous paragraph. So enter diskutil unmountDisk /dev/disk1 to do so. Update Note that you’ll need to unmount – but not eject – your SD card before you can write to it. Re-flashing the SD card then becomes: gzip -dc ~/Desktop/pi.gz | sudo dd of=/dev/rdisk1 bs=1m To do this, you use the Unix ‘pipe’ symbol, |, to route the output of dd not to a file but to the gzip utility: sudo dd if=/dev/rdisk1 bs=1m | gzip > ~/Desktop/pi.gz You can compress it afterwards by right-clicking and selecting Compress “pi.img”, but it’s more efficient to compress the file as you go. Now, pi.img in the example above is large. Re-flashing the SD card from the image is just a matter of swapping around the input file and output file values to read from your. Don’t copy my examples exactly – the input and output file locations may be different on your system. It won’t check to see if you’re happy for it to proceed. If you accidentally tell dd to copy the wrong disk or copy the SD to your hard drive, it will merrily go ahead and do so. Don’t, for instance, key in the wrong /dev/disk entry from the diskutil list. WARNING Always make sure you check these values carefully – get them wrong and you can wreck the data on your hard drive. While the back-up is being made, all you’ll see in the Terminal is a flashing cursor, but you can get some feedback by looking at the size of the pi.img file on your Desktop. Depending on the capacity of your SD card, it could take some time. When you’ve entered your password, the duplication process will begin. ![]() If you’re a Pi user, you’ll likely be used to sudo. You’ll need to prefix the dd command with the sudo command, and this will first ask your for your Mac admin password. Remember, ~ is the Unix symbol that represents your home directory.įinally, bs for ‘block size’ – I’ve chosen 1MB, or 1m as dd prefers it. In the next section, of stands for ‘output file’, here a new file, pi.img which is to be place by dd on my desktop. diskutil will list it as /dev/disk1 – prefix ‘disk’ with ‘r’ to point to the card’s raw storage space to speed up the process: /dev/rdisk1. The if stands for ‘input file’, in this case the SD card. Now you’re ready to duplicate the SD card, saving it as a disk image file on your hard drive: sudo dd if=/dev/rdisk1 of=~/Desktop/pi.img bs=1m The Pi SD card will contain a Linux partition under TYPE NAME:ĭiskutil shows the Pi SD card as /dev/disk1 This will give you a list of the disks and volumes inside or connected to your computer. Open the Mac’s Terminal app and first enter the command: diskutil list So clone the Pi’s SD card, slip it out the Pi and into a Mac. But a little Googling set me on track to use the next best thing: the dd command, available in OS X – and Linux for that matter. I suppose Mac OS X’s inability to cope with the Pi’s EXT4 file-system was the main reason: I can’t simply drag and drop the card’s contents, first to the Mac and then, later, back to a freshly formatted card. What I should have done was clone my card, allowing me to re-flash the SD card with a complete, working and configured to my personal satisfaction Pi operating system. That’s bad enough – what’s worse is having to re-download the applications I’d added since the previous install, applying updates and choosing again all of my system preferences. New cards, programming glitches, messing with Linux’s settings files – all of these reasons have forced me to go through the process of re-flashing the Pi’s storage card. I’ve re-installed my Pi’s SD card storage more times than I care to recall. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |