SIMULATION -
Create a volume group, and set the size is 500M, the size of single PE is 16M. Create logical volume named lv0 in this volume group, set size is 20 PE, make it as ext3 file system, and mounted automatically under data.
SIMULATION -
Create a volume group, and set the size is 500M, the size of single PE is 16M. Create logical volume named lv0 in this volume group, set size is 20 PE, make it as ext3 file system, and mounted automatically under data.
To create a volume group and logical volume as specified, follow these steps. First, initialize the physical volume using 'pvcreate /dev/your_device'. Next, create the volume group with 'vgcreate -s 16M vg0 /dev/your_device', where '-s 16M' sets the physical extent size to 16M. Then, create the logical volume using 'lvcreate -n lv0 -l 20 vg0', where '-l 20' specifies the logical volume size in physical extents. Format the logical volume with 'mkfs.ext3 /dev/vg0/lv0'. Create the mount point with 'mkdir /data'. To ensure the filesystem mounts automatically, add the entry '/dev/vg0/lv0 /data ext3 defaults 0 0' to '/etc/fstab'. Finally, use 'mount -a' to mount all filesystems and verify with 'mount | grep data'.
sudo gdisk /dev/sdc sudo partprobe sudo pvcreate /dev/sdc4 sudo vgcreate vg0 --physicalextentsize 16M /dev/sdc4 sudo lvcreate vg0 --extents 20 --name lv0 sudo lvdisplay sudo mkfs.ext3 /dev/mapper/vg0-lv0 sudo mkdir /dataz tail -n1 /etc/fstab /dev/mapper/vg0-lv0 /dataz ext3 defaults 0 0 sudo systemctl daemon-reload sudo mount -a sudo findmnt | grep dataz
'vgcreate -s' is to specify the size of 'Physical Extent' of 16M, not the total disk size. 'lvcreate -l' specify 20 units of the extents, the requirement says LV named as 'lv0'. after LV has created, there is no '/dev/mapper/'.
pvcreate /dev/nvme1n1 vgcreate -s 500M VGEX /dev/nvme1n1 lvcreate -n lvex -L 320M VGEX mkfs.ext3 /dev/VGEX/lvex mkdir /mnt/data echo “/dev/mapper/VGEX-lvex /mnt/data ext3 defaults 0 0” >> /etc/fstab mount -a mount