[plug] Moving Running System to new HDD

Patrick Coleman blinken at gmail.com
Thu Dec 7 08:14:32 WST 2006


On 12/7/06, Timothy White <weirdit at gmail.com> wrote:
> > I realise it's not much help to you right now, but it might be a good
> > idea to put LVM on the new drive so its easier to do this in future.
> > Under LVM, you can install a new drive, migrate / to it, and remove
> > the old drive in about four commands, and all without ever taking the
> > system down (assuming you can hotswap hdds). Very neat stuff.
>
> Hmmm, well this system was strangely built without / on LVM. So far,
> all my systems seem to be / on a normal partition, and the rest under
> LVM (including swap a lot of the time).
>
> Say it was LVM, what would you do? (hotswap is out though, due to one
> drive being IDE).

Normally you'd have /boot on a normal partition, with the rest on LVM,
because most bootloaders don't do LVM afaik. Stick in your new drive,
partition it with the /boot and LVM partitions. Copy the /boot data
across and setup the bootloader.

Run pvcreate <device> to create a LVM volume on the new device. Note
this can be bigger or smaller, as long as it fits the size of the
current LVM 'partition'.

Run vgextend <volumegroupname> <device> to add the second drive to the
volume group. Run vgreduce <volumegroupname> <olddevice> to remove the
old device from the system. This should move the data across, so it'll
take a while to complete. Note thats from memory, so check its right
before you go nuking things :P

Once thats done, yank the old drive.

--Patrick



More information about the plug mailing list