Using Unallocated space for /home

Richard Shaw hobbes1069 at gmail.com
Wed Jul 1 03:27:45 UTC 2009


On Tue, Jun 30, 2009 at 2:14 PM, Michael Schwendt <mschwendt at gmail.com> wrote:
>
> On Tue, 30 Jun 2009 12:33:04 -0400, Jim wrote:
>
> > FC11, Using Gparted
> > I have 5gb unallocated space that I want to give to /home , how would I
> > do it , (Detail Please)
> >
> > Below is how my partitions are laid  out below;
> >
> > sda1  /boot
> > sda2  /home
> > sda3  /
> > unallocated      5gb
> > sda4 extended
> > sda5  swap
>
> That's a poor partitioning scheme, because all primary partitions
> are occupied, and the free space could only be used to grow /.
> Alternatively, if the extended partition contains no logical
> partitions other than swap, you could
>  - disable swap,
>  - remove the swap partition,
>  - remove the extended partition,
>  - recreate it at the start of the free space,
>  - recreate swap,
>  - create an additional logical 5G partition.
> And then you could either use the logical partition for
> a filesystem to be mounted somewhere below your /home where
> you need more space. [Or you use LVM (with two physical volumes
> building a volume group from which to allocate space for a new
> /home as a logical volume).]

I agree that's probably the best approach. The OP didn't list the
sizes of the other partitions but a 5GB home directory is pretty small
if you're going to do much of anything.

To add a little more detail:

backup existing /home (assuming it's not already part of a LVM)
Disable swap "swapoff -a"
Use gparted to remove the swap and extended partitions.
Recreate sda4 at the beginning of the unallocated space.
recreate an sda5 (first logical) for swap
create sda6 for the second piece of /home
Initialize your partitions for LVM "pvcreate /dev/sda2 /dev/sda6"
Create a volume group "vgcreate vol_group_name /dev/sda2 /dev/sda6"
Activate the volume group "vgchange -a y vol_group_name"
Create one logical volume "lvcreate -l 100% -n<lv_name> vol_group_name"
Format the logical volume whatever filesystem you like but use the
/dev/<vol_group_name>/<lv_name>
Update /etc/fstab for /home (using the same dev name as the previous
line) and swap
Re-enable swap "swapon -a"
Mount /home
Restore your backup.

That should do it but I did this from memory so YMMV. Also, check out
the LVM howto[1] as it has a wealth of information. It's really what
made me comfortable with LVM.

Richard

[1] http://tldp.org/HOWTO/LVM-HOWTO/index.html




More information about the fedora-list mailing list