LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-22-2014, 04:00 AM   #1
binary_dreamer
Member
 
Registered: Feb 2006
Distribution: debian squeeze
Posts: 199

Rep: Reputation: 31
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?
 
Old 03-22-2014, 05:16 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,568

Rep: Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865
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.
 
Old 03-22-2014, 02:58 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,921

Rep: Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618
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.

Last edited by jefro; 03-22-2014 at 03:01 PM.
 
Old 05-11-2014, 01:31 PM   #4
binary_dreamer
Member
 
Registered: Feb 2006
Distribution: debian squeeze
Posts: 199

Original Poster
Rep: Reputation: 31
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?
 
Old 05-11-2014, 05:06 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,568

Rep: Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865
Have a look at Clonezilla.
 
Old 05-12-2014, 01:21 AM   #6
binary_dreamer
Member
 
Registered: Feb 2006
Distribution: debian squeeze
Posts: 199

Original Poster
Rep: Reputation: 31
really nice, but is it possible to make it using dd tool?
 
Old 05-12-2014, 04:27 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,568

Rep: Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cp of dd image failed, better to mount image and then copy? bmcws Linux - Newbie 5 06-23-2009 06:41 PM
getting a HD back from an image eantoranz Linux - Hardware 4 05-05-2005 08:18 PM
How do I copy home directories back? G-wizz Linux - Newbie 5 06-11-2004 06:20 AM
How to Copy Kernel Image to a CD? Lucinda Slackware 9 05-26-2004 03:07 AM
Image Copy vickna Linux - Newbie 4 04-22-2003 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration