Just a 'Heads Up' for those like me who muddle along happily enjoying screwing things up on a rasberry pi secure in the knowledge that any damage can be rectified with a new sd card and a saved image. I always back up my sd card at monthly intervals doing something like this on my linux desktop:-
sudo dd if=/dev/sdc of=/home/jsnell/Videos/backup.img bs=1M
I then store the resulting backup.img files keeping the last three made. The theory is that if I screw things up badly on the pi, I can simply use Disk Image Writer from my file browser to burn the image onto a new card, insert it into the pi and I'm back in business.
As I was about to do something probably unwise, I decided to actually burn an up-to-date replacement card before I screwed up the working one. I was somewhat puzzled (concerned, apprehensive, horrified) when Disk Image Writer refused to burn the .img on to a spare sd card, giving some message to the effect that the backup.img file was some 350 MB bigger than the size of the card I wanted it burnt to. Since they were both 32GB cards, I found this difficult to understand. Well a bit of googling re-educated me about that, it seems that manufacturing defects can result in 'bad' blocks resulting in a volume size of less than the nominal card size. More googling provided me with a work around, not particularly elegant but at least it worked.
1.Resize the biggest partition on the current working card with Gparted reducing the size by say 500MB
2. back up the card to backup.img using something like:-
sudo dd if=/dev/sdc of=/home/jsnell/Videos/backup.img bs=1M
3. Then cd to the directory the backup.img file is in, insert the new card in the usb reader and run:-
sudo dd if=backup.img of=/dev/sdc
NB This will take several hours (around 5 in my case) to run and will terminate with an errors message (dd: writing to '/dev/sdc': No space left on device) which can be ignored.
I am sure the linux experts in here can provide more elegant solutions but, as I said, it worked for me. Please note I am NOT such an expert and decline to take any responsibility for unforeseen consequences! Hope this helps someone anyway
Jerry
sudo dd if=/dev/sdc of=/home/jsnell/Videos/backup.img bs=1M
I then store the resulting backup.img files keeping the last three made. The theory is that if I screw things up badly on the pi, I can simply use Disk Image Writer from my file browser to burn the image onto a new card, insert it into the pi and I'm back in business.
As I was about to do something probably unwise, I decided to actually burn an up-to-date replacement card before I screwed up the working one. I was somewhat puzzled (concerned, apprehensive, horrified) when Disk Image Writer refused to burn the .img on to a spare sd card, giving some message to the effect that the backup.img file was some 350 MB bigger than the size of the card I wanted it burnt to. Since they were both 32GB cards, I found this difficult to understand. Well a bit of googling re-educated me about that, it seems that manufacturing defects can result in 'bad' blocks resulting in a volume size of less than the nominal card size. More googling provided me with a work around, not particularly elegant but at least it worked.
1.Resize the biggest partition on the current working card with Gparted reducing the size by say 500MB
2. back up the card to backup.img using something like:-
sudo dd if=/dev/sdc of=/home/jsnell/Videos/backup.img bs=1M
3. Then cd to the directory the backup.img file is in, insert the new card in the usb reader and run:-
sudo dd if=backup.img of=/dev/sdc
NB This will take several hours (around 5 in my case) to run and will terminate with an errors message (dd: writing to '/dev/sdc': No space left on device) which can be ignored.
I am sure the linux experts in here can provide more elegant solutions but, as I said, it worked for me. Please note I am NOT such an expert and decline to take any responsibility for unforeseen consequences! Hope this helps someone anyway
Jerry