Resize LVM in Linux RHCSA Exam IMP Question 1

Resize Logical Partition (LVM) In Linux

A Red Hat Certified System Administrator (RHCSA) is able to perform the following tasks:

  • Understand and use essential tools for handling files, directories, command-line environments, and documentation
  • Operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services
  • Configure local storage using partitions and logical volumes
  • Create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systems
  • Deploy, configure, and maintain systems, including software installation, update, and core services
  • Manage users and groups, including use of a centralized directory for authentication
  • Manage security, including basic firewall and SELinux configuration.




Resize your logical partition to 350Mb and resize your logical volume to 150Mb.

CMD:

To increase the partition size use following commands,

root@linuxstorage:~#df -h

root@linuxstorage:~#lvextend -L 350M /dev/mapper/vgsrv-home

lvextend - extend the size of a logical volume.

Resize your file system with resize2fs


root@linuxstorage:~#resize2fs /dev/mapper/vgsrv-home
CMD: 

To reduce the partition size use following commands,

root@linuxstorage:~#df -h

Unmount the partition

root@linuxstorage:~#unmount /home

Run fsck on your file system



    root@linuxstorage:~#e2fsck -f /dev/mapper/vgsrv-home
    e2fsck 1.41.12
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
 


Resize your file system with resize2fs

root@linuxstorage:~#resize2fs /dev/mapper/vgsrv-home 150M

Lvreduce - reduce the size of a logical volume

root@linuxstorage:~#lvreduce -L 150M /dev/mapper/vgsrv-home


Remount the partition

root@linuxstorage:~#mount -a

Comments

Popular posts from this blog

Python reference Interview questions

[SOLVED]* Please wait for the system Event Notification service

Rebuild the initial ramdisk image in Red Hat Enterprise Linux