2

I am pretty new to linux. I mostly started learning after I purchased a couple of Raspberry Pis. I like to make backups of my images as I have often made the mistake of corrupting my data :).

Normally I use dd:

dd of=mybackup.img in=/dev/diskX bs=2m

Since my image is on an SD Card, the back up image takes the whole size of the SD card. For example, the size of the actually images is around 30mb, but the SD card is 32gb. The backup images is 32gb. I normally will zip/compress the file down to about 2gb. Still, I would like to back up the partition only e.g 30mb.

if I type

df

I see the partition:

 Filesystem    512-blocks       Used  Available Capacity   iused     ifree %iused  Mounted on
/dev/disk3s1      114576      38192      76384    34%       512         0  100%   /Volumes/boot 

Can I use dd to backup the partition /dev/disk3s1?

  • It's not related to your question but have you noticed that you've run out of inodes on that partition? – Hauke Laging May 18 '14 at 1:09
  • @HaukeLaging - iused is 512, could that be reserved space also? – PhillyNJ May 18 '14 at 1:12
2

The solution seems to be to use

dd of=mybackup.img if=/dev/disk3s1

instead of

dd of=mybackup.img in=/dev/disk3
0

Not sure about what can be found on the RPis, but if you want smaller backups, you could use the venerable tar, which works quite well on "normal" linux boxen:

cd /
tar cf backup.tar ...

where ... would be the list of "backup-worthy" directories.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.