cancel
Showing results for 
Search instead for 
Did you mean: 
  • 5,139 Views

Linux LVM real time scenarios for practice

Hi  Team,

   I am learning LVM in Linux class . could you please share some 20 or 30 real time sceanrios so which i am able to practice.

4 Replies
NunoMartins
Flight Engineer Flight Engineer
Flight Engineer
  • 5,129 Views

Hi, I think the best way to really practice is just to get virtualbox up and running with a few VMs - once you have your VM's running add more disks to the VMs and then you can test the creating of disk groups and LVMs on them  to share data etc to your other VMs. 

Depending how experienced you are you could also create a vm running a few disks as an LVM and share this out as a iscsi target to another vm or local machine. 

Then, practive resizing the lvm disks and filesystems as you see fit. You should makesure you are also comfortable with expanding the disks by extents and not just a generic capacity ie, expanding by adding 5G etc... Its always good to understand inodes and how to work with them. 

0 Kudos
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 5,119 Views

I'm not certain what resizing by inodes is, and I don't see any reference them in the man pages... Perhaps I missed something?

In the RH134 class, we practice resizing logical volumes by (logical) extents.

It basically boils down to the difference between how the -L (uppercase; resize by size) and
-l (lowercase; resize by extents - by number, %FREE, or . . .) options work.

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
Raul1
Flight Engineer Flight Engineer
Flight Engineer
  • 5,043 Views

Exercise:

Your hypervisor is running out of space, you have only 50GB left but you need 70 GB for your new VM, you have a VM with the following characteristics:

- The vm has two disks sda of 20GB and sdb of 50GB

- sda can't be touched.

- a volume group (vg) made of a 50GB pysical volume (pv), sdb,

  - on that volume group you have a one logical volume (lv) with the following:

    - 50 GB, mounted on /home, ext4 filesystem, 30% usage.

Your objective is to reduce the size assigned to the vg to 30GB with the minimal or no downtime by using lvm to move the data,

 

 

varelov
Flight Engineer Flight Engineer
Flight Engineer
  • 5,002 Views

I don't know about 20- 30 real time scenarios for practicing LV management, but what Raul presented is a pretty solid problem.

Here's another one:

- you need to open adittional 20GB free space in volume group vg1 to later create a separate logical volume for your shining new MariaDB install. You inspect the available free space in vg1 and discover there's meager 30MB free space there. A dash of hope for you is that hiring in your organization is stagnant and it's not likely there will be new users logging in the system and using available free space any time soon, so /dev/vg1/home with its 30GB size and used only meager 36MB seems like a good candidate to carve space out of.

By using snapshots, shrink /dev/vg1/home to 1GB without data loss.

Join the discussion
You must log in to join this conversation.