[Gllug] Which path is easier, Transfer swapout or swapout transfer?

Peter Corlett abuse at cabal.org.uk
Mon Aug 18 10:35:03 UTC 2008

On Mon, Aug 18, 2008 at 01:04:09AM +0100, Justin Perreault wrote:
> Okay, Mythdora using LVM I have one 1TB drive and one 80GB drive. Initial
> install was done on the 80GB drive, therefore / and /boot with everything
> else are on the smaller drive. I want to replace the 80GB drive with
> another 1TB drive.

I'll assume here that all the disks are SATA, you have the 80GB disk as
/dev/sda and the 1TB disk as /dev/sdb, and you want the new 1TB disk to be
/dev/sda. The 80GB disk is then disposed of. The same basic principle
applies whether it's IDE or SCSI, but I need to name the ports somehow...

Remove the 1TB drive from /dev/sdb put it in a safe place. Install the new
1TB disk as /dev/sdb. Boot single-user off the 80GB disk (which is still
/dev/sda). LILO or GRUB will probably offer this option, but if not, edit
the kernel command line and add "single" to it.

After you've booted, partition, LVM and mkfs the new 1TB drive how you want,
then mount your partitions somewhere like /mnt and "rsync -avx /. /boot
/mnt" to copy the filesystem. (You can also use cp, but rsync will start off
where you left off if you cancel it part-way, and is a little bit faster.)
Have a cup of tea as it'll take a while. As a quick sanity check, redo the
rsync command. It should do nothing, indicating that everything has already
been copied.

You now have a copy, but it's not yet bootable. There is no bootloader on it
and /etc/fstab is probably wrong.

Remove the 80GB disk from /dev/sda, and move the 1TB disk from /dev/sdb to
/dev/sda. Boot off any handy rescue CD. It doesn't have to be the same
distribution as the one you have on the disk, but it does need to be new
enough to have drivers for your SATA controller.

>From a command line, mount the partitions onto /mnt again. "chroot /mnt" to
get a shell on the copied OS. Edit /etc/fstab to reflect your filesystem
layout (but without /mnt). Run update-grub or LILO to install the
bootloader. "exit" back to the rescue image, and reboot. In theory, you can
now boot off the 1TB disk.

Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list