Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (3) </ 1 [2] 3 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: to dd or not to dd, best practice for imaging< Next Oldest | Next Newest >
SaidinUnleashed Offline





Group: Members
Posts: 1428
Joined: Mar. 2004
Posted: Oct. 31 2005,19:39 QUOTE

the bzip command I gave you will create a bit-for-bit copy of your hdd, minus the empty space, and compress it, so that it is a lot smaller than it is expanded on the hd.

Since the copy will contain the master boot record, in addition to all your data, you will not need to repartition to restore it.

It also works independently of the filesystem of the partition you are imaging. You could image a Mac hd with these commands on an x86 box, and restore it later, and it would work perfectly. So don't worry about killing some ntfs partitions, or other exotic filesystems. It's all good.

~J.P.


--------------
They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, cause if you play it forwards, it installs Windows.

Unleash the power of the TILDE~~~
Back to top
Profile PM AOL MSN YIM 
brianw Offline





Group: Members
Posts: 245
Joined: Sep. 2005
Posted: Nov. 02 2005,02:26 QUOTE

Quote (SaidinUnleashed @ Oct. 30 2005,22:56)
Easiest, most efficient way to image a drive in Linux.

This creates the image...
Code Sample
bzip2 -1c < /dev/hda > myhdimage.img.bz2


And this restores the image to the HD...
Code Sample
bzip2 -dc < myhdimage.img.bz2 > /dev/hda


Happy imaging.

~J.P.

Just a couple quick questions that I am not clear on when creating an image of your hard drive.

1) Does the image file need to be on another partition when you create it or will bzip know not to copy it?

2) Do you need to boot from another media (livecd, etc...) to perform this?

3) When you restore obviously you are booting from another media (livecd, etc...),  but you can restore from a file on another media (i.e. another cd, usb drive, etc...), correct?
Back to top
Profile PM 
robh Offline





Group: Members
Posts: 28
Joined: Oct. 2005
Posted: Nov. 02 2005,21:31 QUOTE

thanks for your advice ~J.P.

unfortunately, as i said, i'm a big noob and i think i may have stuffed up, i just tried to make an image using the line

bzip2 -1c < /dev/hda > myhdimage.img.bz2

but i did it after booting up from my hd install not the live cd...

this is bad, no??


--------------
Presario 1240
Pentium 266Mhz
96MB RAM
~3.2GB HD
full HD install of dsl 3.2
Back to top
Profile PM 
robh Offline





Group: Members
Posts: 28
Joined: Oct. 2005
Posted: Nov. 02 2005,22:38 QUOTE

so i stopped the above operation and deleted the 0 byte file that had been created, then rebooted with the live cd and tried to create the image file once more.

this time i got an error after a few moments...
bzip2: I/O or other error, bailing out. Possible reason follows.
bzip2: no space left on device
          Input file = (stdin), output file = (stdout)


what is this newbie doing wrong....
should i be doing this operation from the live cd, and if so can i specify to save the file i am creating to either the hd partition i am imaging or to my ext hdd directly?

sorry to be such a dill ~J.P.


--------------
Presario 1240
Pentium 266Mhz
96MB RAM
~3.2GB HD
full HD install of dsl 3.2
Back to top
Profile PM 
robh Offline





Group: Members
Posts: 28
Joined: Oct. 2005
Posted: Nov. 03 2005,01:39 QUOTE

well i figure 2.5 hrs should have been enough time to bzip2 a 971MB partition, but it is still sitting there with 100% cpu usage and 50% swap used.

i don't think it is working...


--------------
Presario 1240
Pentium 266Mhz
96MB RAM
~3.2GB HD
full HD install of dsl 3.2
Back to top
Profile PM 
11 replies since Oct. 31 2005,01:59 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (3) </ 1 [2] 3 >/
reply to topic new topic new poll
Quick Reply: to dd or not to dd

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code