Use rest of free space on LVM partition with new Logical Volume

I recently had to fix a few servers using 2TB hard drives. The client wanted 100GB used for the OS/Software while the rest was to be used for data storage. This was on an LVM for /dev/sda and the LVM was "already using the entire drive" (could not use fdisk to create additional partitions as the entire 2TB drive was on LVM).

For things like this, I hate LVM. to use the rest of the space on the LVM to fill the void and mount the "new partition". In the examples, $VGNAME should be replaced with the name of the Volume group that your LVM is using. The following commands were used to get the job done:

To create a new "logical volume" on top of the LVM that took the rest of the free space:

# lvcreate -l 100%FREE -n data1 $VGNAME

To create an EXT3 file system for the new LVM "data1" partition:

# mkfs.ext3 /dev/$VGNAME/data1

Create mount point and have this partition mounted to it:

# mkdir /data1
# mount /dev/$VGNAME/data1 /data1

Line to add to /etc/fstab to add this mount point to re-mount once the server boots/reboots:

/dev/$VGNAME/data1    /data1                  ext3    defaults        0 0
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Adding Secondary IP Addresses (CentOS/RHEL)

There are plenty of reasons you would need to add secondary IP addresss (and everyone agrees...

Adding Additional Disk Drives to CentOS 5/6

Adding a new drive to CentOS or RedHat systems. Making use of a second drive for extra space?...

Recover data from old RAID-1 Drive “linux_raid_member” File System

Recently had to migrate data from an old drive in an old server that was connected to the new...

See what modules are installed and enabled for Apache

For CentOS / RedHat -- if you want to see which modules are installed and/or enabled for...