LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   copy image to cf and back (https://www.linuxquestions.org/questions/debian-26/copy-image-to-cf-and-back-4175499062/)

binary_dreamer 03-22-2014 04:00 AM

copy image to cf and back
 
i do have a system that runs in cf cards. the cf has ext2 partition and debian 6.
i want to backup my cf card (/dev/sdb1) to my hard disk /media/D321442314/backup_cf/

after unmounting the cf card i did a
dd if=/dev/sdb1 of=/media/D321442314/backup_cf/media.img

it seems to works (no errors)

then on the reverse side i am doing
dd if=/media/D321442314/backup_cf/media.img of=/dev/sdb1
without any errors.

when i plug the cf to the system and get a serial console to see the output i get to see the grub (before the splash screen) and it stops there.

has anyone got any ideas?

michaelk 03-22-2014 05:16 AM

Try imaging the entire CF card. i.e. /dev/sdb vs /dev/sdb1. This will copy the partition table in addition to the partition itself.

jefro 03-22-2014 02:58 PM

If you just want the /dev/sdb1 then other simple file by file apps could be used like gparted, partimage and maybe tar, cpio and such.


But yes, as noted you are somehow messing up the install because of how dd works and /sda1 is used I'd assume.

Could be some unique setting in grub that is now not correct and can't find the install. dd is usually exact. Could be some copy error.

binary_dreamer 05-11-2014 01:31 PM

i got it working.
my cf is 4GB and it is using the 350MB. The rest is free space.
when i am doing the dd if=/dev/sdb of=/path/to/save/file.img the size image is 4GB.
is it possible to make it see only the system's size, but not the free space?

michaelk 05-11-2014 05:06 PM

Have a look at Clonezilla.

binary_dreamer 05-12-2014 01:21 AM

really nice, but is it possible to make it using dd tool?

michaelk 05-12-2014 04:27 AM

No. dd is a low level tool and will only copy byte for byte. It can not tell what byte is free vs used and you can not assume your data is contiguous.


All times are GMT -5. The time now is 12:23 PM.