[rhelv6-list] LVM and "unpartioned space"

Bryan J Smith b.j.smith at ieee.org
Sun May 12 23:35:52 UTC 2013


On Sun, May 12, 2013 at 7:08 PM, Marco Shaw <marco.shaw at gmail.com> wrote:

> I'm playing around trying to see how to resize disks with RHEL6.4 on
> VMware Workstation 9.
> I installed the OS and used up 20GB of /dev/sda (with /boot, lv_root and
> lv_swap).  Then I went in VMware and increased the disk (/dev/sda) from
> 20GB to 25GB.
> Now in the LVM GUI, I see that extra 5GB in /dev/sda as "Unpartioned
> space".  Specifically in the LVM *GUI*, can I do anything with this space
> to make it usable?  Do I have to go to the command-line to create a
> partition first?
> Also:
> sg3_utils has a "scsi-rescan" command (reference
> http://jreypo.wordpress.com/2010/10/28/how-to-rescan-the-scsi-bus-in-linux/).
> Is there a GUI equivalent?
>

You have two (2) options.

Recommended:
- Create another Physical Volume (PV) with the space and add it to the same
Volume Group (VG)

Another option (not always safe or possible):
- Resize the existing Physical Volume (PV) to encompass the new space.

The former will almost always work.  You just create another Slice
(Partition) with the new space in the Disk Label (MBR Partition Table I
assume) for /dev/sda, and then add it to the same Volume Group (VG).

E.g., with parted, I like to use MiB (2^20) for units.  The "print" will
tell you where the prior partition ends and the new can start.
  # parted /dev/sda unit MiB print
  # parted /dev/sda mkpart primary (start)MiB (end)MiB
  # parted /dev/sda set (newpart#) lvm on

Then create and add your PV and add it to the existing VG.
  # pvcreate /dev/sda(newpart#)
  # vgextend (VGname) /dev/sda(newpart#)

Done.  It doesn't matter you are using two (2) slices (partitions), they
are in the same VG and usable for storage.  No performance hit,
DeviceMapper acts the same on devices whether they are LVM or not,
contiguous or not.

The latter requires the space added to be contiguous to extend the Slice
(Partition) in the Disk Label (MBR Partition Table), and then extended with
the PV command (pvresize).  I don't recommend this method.


--
Bryan J Smith - Professional, Technical Annoyance
b.j.smith at ieee.org - http://www.linkedin.com/in/bjsmith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/rhelv6-list/attachments/20130512/def1d335/attachment.htm>


More information about the rhelv6-list mailing list