LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-03-2007, 07:50 AM   #1
Micik
Member
 
Registered: Dec 2004
Distribution: open suse
Posts: 137

Rep: Reputation: 15
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
 
Old 10-03-2007, 08:33 AM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
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.
 
Old 10-03-2007, 08:42 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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)
 
Old 10-03-2007, 09:42 AM   #4
Bojce
Member
 
Registered: Feb 2007
Location: Belgrade, Serbia
Distribution: Ubuntu 10.04 LTS 64bit
Posts: 32

Rep: Reputation: 16
Or you can use GParted Live CD to make image of your HDD.
http://gparted.sourceforge.net/livecd.php
 
Old 10-03-2007, 10:47 AM   #5
Drax946
Member
 
Registered: Jun 2005
Location: WV USA
Distribution: Debian/Ubuntu
Posts: 43

Rep: Reputation: 15
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).
 
Old 10-03-2007, 10:50 AM   #6
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0, RHEL5,6), CentOS, SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64, MacOS, Raspian
Posts: 1,106

Rep: Reputation: 64
Quote:
Originally Posted by pixellany View Post
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.
 
Old 10-03-2007, 12:54 PM   #7
Micik
Member
 
Registered: Dec 2004
Distribution: open suse
Posts: 137

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rnturn View Post
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....
 
Old 10-03-2007, 01:05 PM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Micik,

I believe you have hit this jackpot
 
Old 10-04-2007, 03:57 AM   #9
Micik
Member
 
Registered: Dec 2004
Distribution: open suse
Posts: 137

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by saikee View Post
Micik,

I believe you have hit this jackpot
Thank you very much
 
  


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
Making an exact copy of a Linux installation g4j31a5 Linux - General 10 03-09-2007 10:41 AM
make exact copy of a hard disk in fedora AQG Linux - Hardware 6 08-07-2005 05:11 PM
Making an exact copy? k3d failed adamrobie Linux - Software 1 01-31-2005 11:47 PM
making an exact cd copy coolamit78 Linux - Software 2 04-04-2004 03:03 PM
How to make an exact copy of a Hard Disk danishmr Linux - General 15 11-10-2003 02:48 AM


All times are GMT -5. The time now is 01:42 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration