RHCE-Interview Question || LVM01


Part-01

1. What are LVM1 and LVM2?

LVM1 and LVM2 are the versions of LVM.
LVM2 uses device mapper driver contained in 2.6 kernel version.
LVM 1 was included in the 2.4 series kernels.

2. What is the maximum size of a single LV?

For 2.4 based kernels, the maximum LV size is 2TB.
For 32-bit CPUs on 2.6 kernels, the maximum LV size is 16TB.
For 64-bit CPUs on 2.6 kernels, the maximum LV size is 8EB.


For 64-bit CPUs on 3.0 kernels, the maximum LV size is "(theoretical)-8EB (tested)-500TB"
3. List of important LVM related files and Directories?

## Directories
/etc/lvm                - default lvm directory location
/etc/lvm/backup         - where the automatic backups go
/etc/lvm/cache          - persistent filter cache
/etc/lvm/archive        - where automatic archives go after a volume group change
/var/lock/lvm             - lock files to prevent metadata corruption

# Files
/etc/lvm/lvm.conf       - main lvm configuration file
$HOME/.lvm              - lvm history

4.What is the steps to create LVM in Linux?

Create a physical volume by using pvcreate command
#pvcreate /dev/sdax

Add physical volume to volume group by “vgcreate” command
#vgcreate VG0 /dev/sdax

Create logical volume from volume group by “lvcreate” command.
#lvcreate -L 1G -n LV0 VG0

Now create file system on /dev/sdax  partition by “mke2fs”  or "mkfs.ext3" command.
#mkfs.ext3 /dev/VG0/LV0




5. How to extend a File system in Linux?

Check the free space on vg

#vgdisplay -v VG0

Now extend the FS

# lvextend -L+1G /dev/VG0/LV0

# resize2fs /dev/VG0/LV0

No comments: