12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

176CHAPTER 7Managing StorageTIPEach LV has a device name in /dev/ with the format /dev//.By default, logical volumes are created linearly over the physical volumes. However, theycan be striped over multiple PVs:lvcreate -i -I -l -n The -i option sets the number of stripes, or physical volumes to use. The-I is the stripe size, which must be 2^n, where n is an integer from 2 to 9.Provide the number of PEs to use with the -l option or give the size of the LVwith the --size option. The -n option specifies the LV name, and represents the name of the VG to use. Optionally, list the PVs to use, ,at the end of the command separated by spaces. The number of PVs listed should beequal to the number of stripes.After creating the logical volume, you must create a filesystem on it. To create an ext3filesystem, execute the following as root:mke2fs -j /dev//If the LV is to be used as swap, execute the following as root instead:mkswap /dev//Next, still as the root user, create an empty directory as its mount point with the mkdircommand, and use the mount command to mount the filesystem:mount /dev// /mount/pointIf it mounts properly, the last step is to add it to /etc/fstab so it is mounted automaticallyat boot time. As root, add a line similar to the following, replacing with the appropriatevalues:/dev// /mount/point ext3 defaults 1 2To extend a logical volume, expand the volume group if necessary, and then use thelvextend command. Either specify the final size of the logical volume:lvextend --size /dev//or specify how much to expand the logical volume:lvextend --size + /dev//Just like physical volumes are composed of 4KB physical extents, logical volumes consistof logical extents, which also have a default size of 4KB. Instead of specifying the size oramount of space to add in gigabytes, it is also possible to use the -l to provide

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

Saved successfully!

Ooh no, something went wrong!