Open main menu

CDOT Wiki β

Changes

OPS235 Lab 5 - CentOS7 - SSD

531 bytes removed, 16:36, 13 June 2016
no edit summary
# Open a shell terminal, and login as '''root'''.
#Issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">ls /dev/vd*</span></code></b><br><br>'''NOTE:''' If nothing displays, issue the command: '''ls /dev/sd*''' and use that device pathname '''/dev/sda''' instead.<br><br>
   <li>#Issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">fdisk /dev/vda</span></code></b><br>(or ''fdisk /dev/sda'' if the previous command didn't work)</li> <li>#At the fdisk prompt issue the command: '''p'''. What does this do?</li> <li>#Now issue the commands '''n''' (new partition), '''p''' (primary partition), '''3''' (i.e. next available partition number). When prompted for initial block, '''press enter to accept the default beginning block size''', and '''type: +2G''' at ending block (create 2GB for partition) and '''press enter'''. </li> <li>#At the fdisk prompt, issue the command '''p''' to review the partition information, then type '''w''' to save partition table and exit (ignore WARNING message).</li> <li>#You <u>'''must'''</u> restart your centos2 VM to allow changes to take effect</li>. <li>#Open a terminal as root, and format your newly-created partition by issuing the command: <b><code><span style="color:#3366CC;font-size:1.2em;">mkfs -t ext4 /dev/vda3</span></code></b><br>(or ''mkfs -t ext4 /dev/sda3'')</li></ol>{| width="40%" align="right" cellpadding="10"|- valign="top"|[[Image:lvm3.png|thumb|right|500px|What '''system-config-lvm''' display should appear after using '''fdisk''' to create new partition (/dev/sda3), '''formatting''' partition, '''adding partition to LVM''', and '''allocating partition''' to our default volume group.]]|[[Image:lvm4.png|thumb|right|200px|Creating a new logical volume from our newly created physical volume]]|}<ol> <li value="21">#'''Restart the system-config-lvm utility'''. Do you see a new /dev/sda3 partition under Physical Volumes?</li>
<li>To add the newly created partition, you need to add it into LVM to be used. '''Exit the system-config-lvm utility''' and '''issue the following command to add the partition into LVM:'''<br><b><code><span style="color:#3366CC;font-size:1.2em;">pvcreate /dev/vda3</span></code></b> (or ''pvcreate /dev/sda3'' ) (enter '''y''' to proceed - ignore warning)</li>
<li>'''Restart system-config-lvm'''. You should notice a section at the bottom indicating <u>Unallocated</u> Physical Volumes. Click on the <u>unallocated</u> partition /dev/vda3 and then click '''Add to Existing Volume Group''' (click on other button in next screen to continue). The screen should now show the partition ''/dev/vda3'' contained in our default Volume Group (refer to diagram on right-side for reference).</li>
13,420
edits