Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question

migrated from serverfault.com Apr 6 '12 at 17:09

This question came from our site for professional system and network administrators.

add comment

1 Answer 1

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!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.