Simple Ubuntu Server - Expanding disk space - adding a new drive LVM, RAID0 existing setup - how?

1

1

I have a 1TB ext4 partition mounted at / with all my data and Ubuntu 11.04 (natty) installed.

Now this drive is almost full (I used it as a database server for some processing). RAID0 is ok, I can take a failure (touch wood). But I need a way to grow this partition.

I have a new 1TB drive I want to add, however as my Ubuntu boot and all data is on the one partition I'm not sure how I can go about setting up a RAID0 or LVM array without loosing all my data.

So the question is how can I extend my existing ext4 partition over two physical drives without losing data?

Thanks!

NightWolf

Posted 2012-04-06T04:32:47.057

Reputation: 143

Answers

0

I'm sure there are many ways to do this, but here, in broad strokes, is how I might tackle it:

  1. Install the new drive into the server.

  2. Change the hard drive boot priority (in BIOS), to put the new drive ahead of the old one.

  3. Install Ubuntu Server onto the new drive, making certain to set it up with LVM.

  4. Copy over all data from the old drive to the new one (using rsync, cp, or similar).

  5. Wipe the old drive, and add it as a new Physical Volume (PV) to the LVM's Volume Group (VG) (pvcreate and vgextend).

  6. Extend Logical Volumes (LV) as desired using the newly added free space (lvextend).

  7. Extend the corresponding filesystems (resize2fs).

  8. Done!

Steven Monday

Posted 2012-04-06T04:32:47.057

Reputation: 1 445