LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-01-2006, 02:56 PM   #1
sickdude
LQ Newbie
 
Registered: Mar 2005
Distribution: red hat *, fedora core *, gentoo, slackware, ubuntu
Posts: 27

Rep: Reputation: 15
Replacing hard disks


Hi all,

i have a little question about my Ubuntu box.

this baby is doing a great job and never letting me down, well until a few weeks ago. first a little story

this server is running as a webserver and a itunes server (mtdaapd) i use torrentflux on it to download stuff.

the disk in this machine is a little 60 gig thats about 5 years old, and with torrentflux leeching stuff the disk is getting a beating. so i was checking my logging and i saw that the disk was getting io errors so i thought ow well its time to buy stuff, so i bought a 250 gig disk

my question is how can i get all the data thats on the old disk on my new and bigger disk, i read on a forum that some random dude installed the os and the copyd / to / and all the other partitions straight to the new disk, overwriting everything and keeping all the configuration

thats all i want, i dont want to install everything that i installed already i just want to use the new disk as i am using the old disk

so any tips?
 
Old 03-01-2006, 03:38 PM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
If you will look here:
http://forums.gentoo.org/viewtopic.p...144363#3144363
- just the other day there was a similar question asked...
That was my answer - and I myself just now used this scenarnio - and many times before...
(just also copy /boot if you dont have a separate /boot partition as was assumed in the example - since it was written for gentoo...)
 
Old 03-01-2006, 03:59 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
First, backup important data (But you knew that already)

What you are talking about is cloning (or ghosting). In the Windows world, they sell programs (eg Norton Ghost) to do this. Linux has free tools.

The most basic command is dd. This will do amazing things (including totally wiping out your system---did I mention backup??.... )

Suppose you have a set of partitions that occupies a 40GB hard drive. The entire thing can be copied to your new drive, and it will behave exactly as the old one--except it will have a whole bunch of space left over.

If the 60GB is full, then you can do a dumb clone--ie copy *everything* on the old to the new. If it is not full, then you may wind up wasting some space (But--nothing lost compared to your status quo)

Use fdisk to see where the partitions end, and then go bit beyond, to be safe. For example, my 40GB Linux drive shows 4866 cylinders of 8225280 each= 40024+ Mbyte. The disk is supposed to be 40027+, so I might actually copy--eg--2444 blocks of 16384 bytes each--just to give a litle margin (In dd, you can use any block size that is a multiple of 2)

So, for my example, copying the entire contents of my 40GB drive to **anything larger**, the command would be:

dd if=/dev/hda of=/dev/hdb bs=16384 count=2444
(I've assumed hda and hdb--yours may be different)
This approach might give an error message when it tries to read beyond the end of the source drive.

If you first backup, and then save the old drive until the new one is up an running, then there is minimal risk in trying this.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How many Hard disks ? BizHat.com Linux - Software 5 01-18-2005 07:38 PM
replacing scsi hard drive xushi Linux - Hardware 2 11-13-2004 09:58 AM
2 Hard Disks and 2 OS? How to? nbn792 Linux - General 5 12-26-2003 07:20 PM
2 Hard disks hadi Linux - Newbie 4 10-29-2003 02:34 PM
Replacing Hard Drive Dallam Linux - Software 1 01-01-2002 09:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:54 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