Changes

Jump to: navigation, search

OPS235 Lab 5

1 byte removed, 11:46, 27 June 2016
no edit summary
# You can create a partition by using the fdisk command. Issue the following command: <br><b><code><span style="color:#3366CC;font-size:1.2em;">fdisk /dev/vda</span></code></b> (or fdisk /dev/sda if there is no /dev/vda).
#At the '''fdisk''' prompt, issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">p</span></code></b>. What does this do?
#Now issue the commands <b><code><span style="color:#3366CC;font-size:1.2em;">n</span></code></b> (new partition), <b><code><span style="color:#3366CC;font-size:1.2em;">p</span></code></b> (primary partition), <b><code><span style="color:#3366CC;font-size:1.2em;">3</span></code></b> (i.e. next available partition number). When prompted for initial block, press '''enter''' to accept the default beginning block size, and type: <b><code><span style="color:#3366CC;font-size:1.2em;">+2G3G</span></code></b> at ending block (create 2GB for partition) and press '''enter'''.
#At the fdisk prompt, issue the command <b><code><span style="color:#3366CC;font-size:1.2em;">p</span></code></b> to review the partition information.
#Enter the command <b><code><span style="color:#3366CC;font-size:1.2em;">w</span></code></b> to save partition table and exit (ignore WARNING message).
#To add the newly created partition, you need to add it into LVM to be used. 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)
# Issue the following command to add your new-created and formatted partition called /dev/vda3 to your volume group:<br><b><code><span style="color:#3366CC;font-size:1.2em;">vgextend centos_centos2 /dev/vda3</span></code></b>
# Create a new logical volume by issuing the following command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">lvcreate -L 1G 2G -n archive centos_centos2</span></code></b>
# Format your newly-created partition by issuing the command: <b><code><span style="color:#3366CC;font-size:1.2em;">mkfs -t ext4 /dev/centos_centos2/archive</span></code></b>
# Issue the '''ssm list''' command to view the new physical volume and logical volume information.
# Reduce the file-size by issuing the command: <b><code><span style="color:#3366CC;font-size:1.2em;">lvreduce -r -L 0.5G centos_centos2/archive</span></code></b>
# Issue the '''ssm list''' command to verify.
# Increate the file-size by issuing the command: <b><code><span style="color:#3366CC;font-size:1.2em;">lvextend -L +0.25G 1G centos_centos2/archive</span></code></b>
# Issue the '''ssm list''' command to verify.
13,420
edits

Navigation menu