[olug] Ubuntu home to RAID0

Phil Brutsche phil at brutsche.us
Wed Jul 14 07:41:27 UTC 2010

I've done what you're trying to do. You should be able to do all of this
as root on your live system.

You could just add the new disk space to the existing volume group,
expand the logical volume then use resize2fs:

umount /home
fdisk /dev/sdx into /dev/sdx1 (1TB) and /dev/sdx2 (.5TB)
/sbin/pvcreate /dev/sdx1
/sbin/vgextend VolumeGroup /dev/sdx1
/sbin/lvextend LogicalVolume /dev/sdx1 <- adds the amount of space in
/dev/sdx1 to LogicalVolume
/sbin/resize2fs LogicalVolume
mount /home

You don't get RAID0 with any of that though. Chances are the Ubuntu GUI
utilities will do something similar.

Alternatively, you could remove /home from the LVM and use that space
with the additional drive to make a RAID0 array:

umount /home
lvremove -f the logical volume /home was stored on
free up the PV with vgremove -f or vgreduce, depending on how your VGs
are set up
pvremove the physical volume
mdadm --create /dev/md0 --raid-devices=2 --level=raid0 ...
optionally put the RAID0 you just created into LVM with pvcreate,
vgcreate/vgextend, lvcreate, etc
mkfs.ext4 the new volume

On 7/13/2010 5:54 PM, Obi-Wan wrote:
> Running Ubuntu 10.04 32-bit desktop.
> OK, I've run out of space on my 1.0TB /home filesystem (separate drive).
> I have another 1.5TB drive available, and I want to use 1.0TB of that
> along with my old 1.0TB drive to create a striped (RAID0) 2TB partition
> as the new /home.  I do NOT want to reinstall anything over my current
> root drive.  The data on my old /home filesystem is already backed up
> and therefore expendable.  I want the leftover 500GB on the second drive
> to be available for some other purpose.
> The catch is that I've seen the text-based commands for setting up LVM,
> and it's enough to convince me that I *really* want to use a GUI utility
> to handle the LVM setup for me.  Can I do that as root while wiping my
> /home filesystem?  Can I do it while booted off my main root drive, or
> must I boot off a live CD?
> I need to do this ASAP.  Any pointers are appreciated.


Phil Brutsche
phil at brutsche.us

More information about the OLUG mailing list