[Malvern] New HDD - copying everything across

Keith Edmunds keith at midnighthax.com
Tue Jan 10 05:11:47 GMT 2006


Robin Wilson wrote:
> This is a secondary hard drive which has /home mounted on it - 
> everything else will be staying on the first hard drive.
> 
> How should I do this? 

Assuming that the original home partition is /dev/hda5 and the new drive 
is /dev/hdc (for choice do all this in single user mode):

1. Create a partition on the new drive for the home directory (use 
cfdisk or fdisk)

2. Create the new home partition filesystem - eg, if you're using ext3 then:
	mke2fs -j /dev/hdc1

3. Mount the new partition on a temporary mountpoint:

	mount /dev/hdc1 /mnt

4. Copy the home directory tree:

	tar -C /home -cf - . | tar -C /mnt -xvf -

5. Get coffee / beer / whatever and wait

6. Edit /etc/fstab to mount the new home partition rather than the old

7. Reboot and test (you don't _need_ to reboot, but you might as well 
check it comes up correctly.

HTH,
Keith

-- 
Keith Edmunds

+---------------------------------------------------------------------+
|  Tiger Computing Ltd  |  Helping businesses make the most of Linux  |
|  "The Linux Company"  |       http://www.tiger-computing.co.uk      |
+---------------------------------------------------------------------+



More information about the Malvern mailing list