14.06.2014 Views

Red Hat Certified System Administrator (RHCSA) EX200 Study Guide

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

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

12/ 17/ 12<br />

www. linuxexplor er s. com / r ed- hat - cer t if ied- syst em - adm inist r at or - r hcsa- ex200- st udy- guide/<br />

5/ 11<br />

# lv create -v 15g -n LV02 VG01<br />

Explanation:<br />

In order to create a logical volume the first thing that needs to be done is to format the partitions so they can be added to a<br />

volume group. This is done with the “pvcreate” command.<br />

The next step is to add the phy sical volumes to the volume group and that is done with the vgcreate command. The “-s 32”<br />

option define the phy sical extent size. The phy sical extent size determines the maximum size of the logical volume and the<br />

default phy sical extent size which 4mb. There are 65,536 phy sical extents available to a volume group with gives y ou a total<br />

size of 262,114mb or 256gb (4mb x 65,536 mb = 262,114mb) for the volume group. By setting the extent size to 32mb the<br />

maximum size of the volume group would be 2,097 ,152mb or approximately 2 teraby tes (32mb x 65,536 = 2,097 ,152mb).<br />

Once the volume group has been defined the next step is to add the logical volumes to the volume group.<br />

The volumes created in the example above will be located in /dev/VG01/LV01 and /dev/VG01/LV02<br />

these logical volumes can now be formatted with a file sy stem, mounted and placed in the fstab so that they are mounted<br />

when the sy stem boots.<br />

Format the Volumes<br />

# m kfs.ext4 /dev /VG01/LV01<br />

# m kfs.ext4 /dev /VG01/LV02<br />

Delete Volumes<br />

In order to remove the volumes y ou will need to run the following sequence of commands.<br />

# lv rem ov e /dev /VG01/LV01<br />

# lv rem ov e /dev /VG01/LV02<br />

# v grem ov e /dev /VG01<br />

# pv rem ov e /dev /sda1 /dev /sda2<br />

Create and configure LUKS-encrypted partitions and logical volumes to prompt for password<br />

and mount a decrypted file system at boot.<br />

The following procedure assumes that the dm_cry pt module has been loaded. For a more detailed explanation please see<br />

# cry ptsetup luksForm at /dev /sda1 //formats the drive and prompts y ou to create a passphrase<br />

# cry ptsetup luksOpen /dev /sda1 luks01 //opens drive /dev/sda1 and maps it to /dev/mapper/luks01<br />

# m kfs.ext4 /dev /m apper/luks01 //formats the volume with the ext4 file sy stem.<br />

Now that the LUKS-encry pted volume has been created and formatted it can be added to the boot process.<br />

Create an “/etc/cry pttab” file.<br />

Add the following line to the file and save it:<br />

luks01 /dev /sda1<br />

the cry pttab file will attempt to open the encry pted volume at boot and will prompt y ou for a password. If the file is<br />

successfully opened its mapped to /dev/mapper/luks01

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

Saved successfully!

Ooh no, something went wrong!