On Sun, May 12, 2013 at 7:08 PM, Marco Shaw <span dir="ltr"><<a href="mailto:marco.shaw@gmail.com" target="_blank">marco.shaw@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div>I'm playing around trying to see how to resize disks with RHEL6.4 on VMware Workstation 9.</div><div>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.</div>

<div>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?</div>

<div>Also:</div><div>sg3_utils has a "scsi-rescan" command (reference <a href="http://jreypo.wordpress.com/2010/10/28/how-to-rescan-the-scsi-bus-in-linux/" target="_blank">http://jreypo.wordpress.com/2010/10/28/how-to-rescan-the-scsi-bus-in-linux/</a>).  Is there a GUI equivalent?</div>

</div></blockquote><div><br></div><div>You have two (2) options.</div><div><br></div><div>Recommended:  </div><div>- Create another Physical Volume (PV) with the space and add it to the same Volume Group (VG)</div><div><br>

</div><div><div>Another option (not always safe or possible):  </div><div>- Resize the existing Physical Volume (PV) to encompass the new space.</div><div><br></div><div>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).</div>

<div><br></div><div>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.</div><div>  # parted /dev/sda unit MiB print</div><div>

  # parted /dev/sda mkpart primary (start)MiB (end)MiB</div><div>  # parted /dev/sda set (newpart#) lvm on</div><div><br></div><div>Then create and add your PV and add it to the existing VG.</div><div>  # pvcreate /dev/sda(newpart#)</div>

<div>  # vgextend (VGname) /dev/sda(newpart#)</div><div><br></div><div>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.</div>

<div><br></div><div>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.</div>

<div><br></div></div><div><br></div><div>--</div></div>Bryan J Smith - Professional, Technical Annoyance<br>b.j.smith at <a href="http://ieee.org" target="_blank">ieee.org</a> - <a href="http://www.linkedin.com/in/bjsmith" target="_blank">http://www.linkedin.com/in/bjsmith</a><br>

<br>