27.12.2012 Views

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Metadata Areas 2<br />

Metadata Sequence No 2<br />

VG Access read/write<br />

VG Status resizable<br />

MAX LV 0<br />

Cur LV 1<br />

Open LV 1<br />

Max PV 0<br />

Cur PV 2<br />

Act PV 2<br />

VG Size 2.29 GiB<br />

PE Size 4.00 MiB<br />

Total PE 586<br />

Alloc PE / Size 586 / 2.29 GiB<br />

Free PE / Size 0 / 0<br />

VG UUID 9HPTso-Amw3-70HQ-3ofl-AszO-1aeo-dFvB7z<br />

# vgextend homevg /dev/dasdg1<br />

Volume group "homevg" successfully extended<br />

# vgdisplay homevg<br />

--- Volume group ---<br />

VG Name homevg<br />

System ID<br />

Format lvm2<br />

Metadata Areas 3<br />

Metadata Sequence No 3<br />

VG Access read/write<br />

VG Status resizable<br />

MAX LV 0<br />

Cur LV 1<br />

Open LV 1<br />

Max PV 0<br />

Cur PV 3<br />

Act PV 3<br />

VG Size 4.58 GiB<br />

PE Size 4.00 MiB<br />

Total PE 1172<br />

Alloc PE / Size 586 / 2.29 GiB<br />

Free PE / Size 586 / 2.29 GiB<br />

VG UUID 9HPTso-Amw3-70HQ-3ofl-AszO-1aeo-dFvB7z<br />

Note there are 586 new free physical extents (PEs).<br />

Extend the logical volume and the file system<br />

Now that you have free space in the volume group, you can increase the size of the existing<br />

logical volume with the lvextend command. <strong>The</strong> -l option specifies the number extents to<br />

add. Finally, use the ext2online command to increase the size of the file system while it is<br />

still mounted.<br />

You can use the df command to show the file system size be<strong>for</strong>e and after you extend it as<br />

the following example shows:<br />

# df -h /home<br />

/dev/mapper/homevg-homelv<br />

2.3G 68M 2.1G 4% /home<br />

# lvextend -l +586 /dev/homevg/homelv<br />

Extending logical volume homelv to 4.58 GB<br />

Logical volume homelv successfully resized<br />

# resize2fs /dev/homevg/homelv<br />

resize2fs 1.41.12 (17-May-20<strong>10</strong>)<br />

Filesystem at /dev/homevg/homelv is mounted on /home; on-line resizing required<br />

Chapter 13. Miscellaneous recipes 199

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!