Академический Документы
Профессиональный Документы
Культура Документы
Creating a LVM:-
we will firstly create partitions of disks /dev/sdb & /dev/sdc with partition id
8e. Process to do that is as follows.
$ fdisk /dev/sdb
* Type ‘n’ for creating new partition,
* Next type ‘p’ for creating the primary partition
* Next for First cylinder value & last cylinder value, press enter to use
default values i.e. full hdd space
* Type ‘t’ for accessing the partition followed by ‘1’ (partition number)
* Now this is the part where we will enter the partition id for creating LVM
i.e. 8e. Type ‘8e’ now & press ‘w’ to write changes.
*** We have partitioned /dev/sdb for LVM-creation, same steps are to be repeated
for /dev/sdc, /dev/sdd.
*You will get confirmation that Physical Volume has been created.
We can see & confirm the newly created Physical volume using ‘pvdisplay’
* Here, ‘vg01’ is the name of volume group. To confirm the creation of VG, we
will use ‘vgdisplay’ command
Lastly we will create Logical Volume from Volume group ‘vg01’ using ‘lvcreate’
command
Now our LV has been created but before we can use it we need to assign it a file
system & mount it to a point.
$ mkfs.ext4 /dev/vg01/lv01
LV is now formatted with ext4 filesystem. Next we will create a mounting point for
mounting lv01,
$ mkdir /data
But this is a temporary mount & will be unmounted if our system reboots.
To permanently mount it, we need to append the /etc/fstab file with the following
entry
$ vim /etc/fstab