SD Card Backup


8 posts
by droidus » Sat Apr 20, 2013 5:34 pm
I would like to backup my SD Card to an image. I was following this tutorial, but had no luck. I do not have such a file called fstab.
http://cagewebdev.com/index.php/raspber ... s-running/
Posts: 133
Joined: Sat Feb 02, 2013 4:09 am
by Uberbuhrman » Sat Apr 20, 2013 10:24 pm
you have a file named "fstab" in the /etc dir.
only it's "fstab" and not "fstabs" ( as in your link )

so...
sudo cat /etc/fstab will show your partitions and their mountpoints.
I guess you want to backup the system so you'll need the partition
that is mounted on the root dir. "/"

then the bu-command is :
sudo dd if=/dev/<your partition> of=<path to where the bu is written>/my.img bs=1M
Posts: 17
Joined: Thu Mar 28, 2013 7:43 pm
by droidus » Sat Apr 20, 2013 11:35 pm
does the fstab file update when a external usb is plugged in? I do not see anything being changed.
Posts: 133
Joined: Sat Feb 02, 2013 4:09 am
by rpdom » Sun Apr 21, 2013 3:54 am
droidus wrote:does the fstab file update when a external usb is plugged in? I do not see anything being changed.


No. The fstab is only updated by you.
Posts: 3125
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by droidus » Sun Apr 21, 2013 1:13 pm
I found out it was listed as /dev/sda1. so I typed in the file:
/dev/sda1 /cusb vfat defaults 0 0
I then ran: sudo dd if=/dev/mmcblk0p2 of=/dev/sda1/my.img bs=1M
I get this error: dd: opening '/dev/sda1/my.img': Not a directory
Posts: 133
Joined: Sat Feb 02, 2013 4:09 am
by rpdom » Sun Apr 21, 2013 1:33 pm
You need to mount the partition and write the image file there.

Code: Select all
mount /cusb
dd if=/dev/mmcblk0p2 of=/cusb/my.img bs=1M


If that works, you should see a file in /cusb.

Then unmount the partition with: umount /cusb
Posts: 3125
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by droidus » Sun Apr 21, 2013 1:40 pm
when I run the first command, it says "mount: according to mtab, /dev/sda1 is mounted on /media/BRAND mount failed"
Posts: 133
Joined: Sat Feb 02, 2013 4:09 am
by rpdom » Sun Apr 21, 2013 2:09 pm
In that case, as it says, it is already mounted elsewhere. the df command should confirm that. Possibly your GUI did that for you.

Just change the destination of the dd command to match what it has told you.
Posts: 3125
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK