LinuxQuestions.org
Review your favorite Linux distribution.
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-13-2006, 09:59 AM   #1
Pisapiag
LQ Newbie
 
Registered: Oct 2006
Location: Quebec
Distribution: Ubuntu Dapper Drake
Posts: 3

Rep: Reputation: 0
Replacing hard disk


I am a near total Linux newbie. I got an old XP box (Pentium III) with a failed drive. I borrowed a 40GB HDD and tried installing Ubuntu Dapper Drake on it. I've been working at it for the last two weeks. Now that I've got a system that works, I have to return the borrowed drive. I'll buy a new 60 or 80GB IDE drive and I want to transfer everything from the old drive to the new one so that I can replace the old drive with the new one and everything will work. I believe the process is called cloning. I've read some of the posts about it but there was always something not clear to me in all of them.
What's the easiest and/or the most effective way to go about it? Remember, I'm a "noob" so please give as much details as possible, particularly if I have to go to the Terminal.
Thanks
 
Old 10-13-2006, 10:06 AM   #2
crashmeister
Senior Member
 
Registered: Feb 2002
Distribution: t2 - trying to anyway
Posts: 2,541

Rep: Reputation: 47
Buy a 40 gig HDD and give that one back except you are in it for the learning effect..
 
Old 10-13-2006, 10:19 AM   #3
EdR
LQ Newbie
 
Registered: Sep 2004
Distribution: RHEL AS3, AS4 / Vector
Posts: 22

Rep: Reputation: 15
Easiest solution is as previous post stated and that is just buying a new 40G drive as a replacement and give back the new one. If you want to step up to a larger drive, check out AwsomeMachine's post on learning the DD command.
http://www.linuxquestions.org/questi...d.php?t=362506
 
Old 10-13-2006, 12:03 PM   #4
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
Here is how it is done.

(1) Always buy a disk bigger than the source you want to clone.

(2) Connect the new disk to the PC.

(3) Boot up a Live CD (any one will do, my favourite is Kanotix), use it to check the disk status by command "fdisk -l", which will list all the partitions of every disk in the PC. If the new disk is connected correctly it will show up there but without any partition. That is normal.

(4) Assuming the old source disk is hda and the new target disk is hdb the cloning is one line of command in terminal mode (date statement to show time only and can be omitted, the bs parameter instructs dd the size of each transfer and 32768 is one complete track of 64 times 512 bytes)
Code:
dtate
dd if=/dev/hda of=/dev/hdb bs=32768
date
(5) Make tea or go out to play and come back half an hour or one hour depending on how fast is your computer. Mine clones 25Gb in 7 minutes transferring at 58Mb/s yesterday. You can calculate the time taken between the two "date" statement.

Warning in the dd command if=input file and of=output file, make absolutely clear "if" is your source.

There is no need to partition nor to format. The target disk will boot same as the source. The new disk's extra space, for being bigger than the source disk, is unallocated. You cannot clone a bigger disk into a smaller disk.

More information in the first link of my signature.

dd is a hardware copying sector by sector (512 bytes per sector). It does not deal with the filing systems so will be successfull in any system (Dos, Windows, Linux, Solaris, BSD and in any combination) In dd you get a mirror image of the original. No more and no less but exactly a 100% clone.

Last edited by saikee; 10-13-2006 at 12:05 PM.
 
Old 10-13-2006, 02:58 PM   #5
Pisapiag
LQ Newbie
 
Registered: Oct 2006
Location: Quebec
Distribution: Ubuntu Dapper Drake
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks.
Does that mean that if I use a bigger hard drive I'll have to use the rest of the drive as a second partition? Isn't there a way to end up with only one bigger partition?
Also, do I have to boot from a live CD, couldn't I just do it from the original drive?
Thanks

Last edited by Pisapiag; 10-13-2006 at 02:59 PM.
 
Old 10-13-2006, 03:50 PM   #6
RedNovember
Member
 
Registered: Oct 2005
Distribution: Debian etch
Posts: 103

Rep: Reputation: 15
dtate
dd if=/dev/hda of=/dev/hdb bs=32768
date

Might wanna edit that.
 
Old 10-13-2006, 03:55 PM   #7
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
You can use QTParted, available in many Live CD, to incorporate free hard disk space into a Linux partition.

You can run dd with a boot-up Linux to do the cloning.
 
  


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
Cloning 1 hard disk to smaller hard disk, dd or ghost? fireman949 Linux - Hardware 8 12-23-2012 01:51 AM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 11:55 AM
Replacing hard disks sickdude Linux - General 2 03-01-2006 04:59 PM
Hard Disk question - Making a big hard disk MrAnonym Linux - General 2 09-15-2003 07:08 PM
Replacing Hard Drive Dallam Linux - Software 1 01-01-2002 10:53 PM


All times are GMT -5. The time now is 02:58 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration