Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a RaspberryPi with its OS on an SD card. Sometimes, the SD card gets corrupted and I have to rebuild from scratch.
I am sure that I can use dd (on a different machine) to make a backup copy (and have seen other posts which confirm this).
My question is, on my 'other' box, when I plug in the SD card, how do I know which entry in /dev is the one I need to back up? (Presumably, when the card is inserted and File Manager asks if I want to mount it and open with File Manager, I say 'No')?
I prefer blkid to fdisk, but both will give you the information. They give different information in different formats, but both will give you the /dev/ info you need.
For making a backup of a boot disk in its entirety, make sure you use, for example, /dev/sdd, and not /dev/sdd1. You want to copy all the partitions, not just one. Back up to a drive at least as large as the one you are using, of course, and realize that after running dd, the drive you backed up to will now only be the size of the SD card, with any excess unallocated.
Either run fdisk -l before and after plugging in the card, or run "tail -f /var/log/messages" while plugging in the card. It doesn't have to be any more complicated than that.
Quote:
Originally Posted by sgosnell
of course, and realize that after running dd, the drive you backed up to will now only be the size of the SD card, with any excess unallocated.
Only if he copies it to a raw device, which would be rather pointless (unless he's trying to duplicate the SD card rather than back it up). Copy it to a file and it's a non-issue.
It may still get mounted even though you choose to not open a folder in your file manager. A good idea is to check and umount any drives associated with the SD card before you perform the dd command.
I have a RaspberryPi with its OS on an SD card. Sometimes, the SD card gets corrupted and I have to rebuild from scratch.
I am sure that I can use dd (on a different machine) to make a backup copy (and have seen other posts which confirm this).
My question is, on my 'other' box, when I plug in the SD card, how do I know which entry in /dev is the one I need to back up? (Presumably, when the card is inserted and File Manager asks if I want to mount it and open with File Manager, I say 'No')?
Ian
df -h worx for me.
this is what i do to duplicate usb's/sd's of the same size (or if the output drive is bigger):
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.