LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   making exact copy of hard disk (https://www.linuxquestions.org/questions/linux-newbie-8/making-exact-copy-of-hard-disk-589082/)

Micik 10-03-2007 06:50 AM

making exact copy of hard disk
 
Hello to all,
please can someone can answer if it is possible to copy whole file system (files, directories) from one linux hard disk to another from live CD?
My plan is to connect two hard drives to new computer (I'll disconnect existing hard disk), start live Ubuntu CD, and copy everything from one hard disk to another.
File system on source hard drive is older (RH 6) and i assume it is ext2, so please, can someone explain step by step what I need to do.
Thanks very much

ramram29 10-03-2007 07:33 AM

Assuming your hard disks are /dev/hda and /dev/hdb you can run the following commands:

fdisk -l

(look and verify that the two drives are there).

dd if=/dev/hda of=/dev/hdb

This will copy the first disk to the second. Make sure the second disk is as big or bigger then the first one with the first command.

pixellany 10-03-2007 07:42 AM

If you just want the files and directories, you can use the file manager. (Drag and drop) You may need to mount the drives first.

With dd, you get the partition structure and the filesystem info, too.--eg if the source is ext2, the copy will be ext2 also. Also, when using dd, you may have to do some tweaking of the partition table to use the whole drive (if the target drive is larger than the source)

Bojce 10-03-2007 08:42 AM

Or you can use GParted Live CD to make image of your HDD.
http://gparted.sourceforge.net/livecd.php

Drax946 10-03-2007 09:47 AM

A few other toolbox-type CDs which can do the job are SystemRescueCD and UBCD (Ultimate Boot CD). I've not used GParted Live CD, but I know it looks like a great shot to get it done as well.

I've used SysResCD & UBCD both for handling FAT32 & NTFS partitions. I've ran into trouble in the past trying to boot Live CDs on some of the PCs I have (an HP Pavilion a705w is particularly nasty as this).

rnturn 10-03-2007 09:50 AM

Quote:

Originally Posted by pixellany (Post 2911672)
Also, when using dd, you may have to do some tweaking of the partition table to use the whole drive (if the target drive is larger than the source)

IMHO, it's safer to just run fdisk and create the partitions
(why is everyone afraid of fdisk?). Then copy the contents of the filesystems using cpio using pass-through mode. (I guess "cp -R" would work just as well; cpio's more portable across 'ix flavors.) If it's a boot disk, it gets slightly more complex making sure that the copy will boot.


--

And, "yes", I did have a vacuum tube collection in high school. (For some reason, I my guitar practice amp used to go through a lot of 50C5s. I was pretty much on a first-name basis w/ the local TV repair guy.) The final exam in our electronics class was to draw the complete circuit diagram for a superhet radio receiver.

Micik 10-03-2007 11:54 AM

Quote:

Originally Posted by rnturn (Post 2911814)
IMHO, it's safer to just run fdisk and create the partitions
(why is everyone afraid of fdisk?). Then copy the contents of the filesystems using cpio using pass-through mode. (I guess "cp -R" would work just as well; cpio's more portable across 'ix flavors.) If it's a boot disk, it gets slightly more complex making sure that the copy will boot.


--

And, "yes", I did have a vacuum tube collection in high school. (For some reason, I my guitar practice amp used to go through a lot of 50C5s. I was pretty much on a first-name basis w/ the local TV repair guy.) The final exam in our electronics class was to draw the complete circuit diagram for a superhet radio receiver.

Thank you everyone for your replies.
For me, the dd command looks simple and I'll try to implement that.
I'm not experienced linux user and it would be best for me if I could use some windows tool to copy everything from one disk to the other. Because I'm not familiar with linux I'm afraid to use things I'm not sure and which can ause a data loos...

Since file structure and MBR is damaged on one disk, and I have other computer that has same files and software, I'm planning to pull out disk from a computer that is in good working condition, place in third computer which is live Ubuntu linux and also place new, blank hard drive, copy everything from good to new hard drive (including MBR, boot data etc...) and in that way solve problem which I have.
Problem is basically that I'm not able to boot second computer anymore. Since there is one more computer which has identical software, is it possible to copy all on new hard disk, place that new hard drive in old computer and solve problem in that way....

saikee 10-03-2007 12:05 PM

Micik,

I believe you have hit this jackpot

Micik 10-04-2007 02:57 AM

Quote:

Originally Posted by saikee (Post 2911991)
Micik,

I believe you have hit this jackpot

Thank you very much


All times are GMT -5. The time now is 04:31 PM.