Next task is to manage LLVM logical volumes.
So on server 1, create a logical volume with the name myfiles and ensure it uses 8 MB extents.
Then configure the volume to use 75 extents.
Format it with XFS and ensure it mounts persistently on MNT data.
Also, increase the size of the slash logical volume with 5 GB.
And if volume groups need to be created, create them as needed.
Let me show you the solution.
Now on the real exam as well, sometimes you need to think before you are doing.
And that is the case right here.
Because we need to create a new logical volume with an extent size of 8 MB.
And we also need to extend the root logical volume.
So how are you going to do that?
Well, the root logical volume is already in a volume group.
And you need a new logical volume with 8 MB extents.
That means that you need a new volume group.
Because the default extent size is 4 MB.
And that means that you need 2 volume groups.
And for that reason also 2 partitions.
So we start with fdisk on dev nvme 0 and 1 like before.
So the first partition that I'm going to create is partition number 6.
And it starts at the default.
And I will make it plus 1 G.
And oh, there we can see that from a previous attempt it contains an LVM2 member signature.
Yes, I want to remove that signature.
Because we want a clean partition.
Now I can use n to create another partition, partition number 7.
And this partition number 7, I want to make it a total of 6 GB.
So plus 6 G.
I create my partitions bigger than the actual logical volume size.
Because we always need a little bit of space for metadata.
Now I'm going to use T on partition number 7.
And I'm setting it to LVM.
And also T on partition number 6.
And I'm setting it to LVM.
And then P to verify where we can see a smaller partition 6, a bigger partition 7.
And that will be OK.
And I'm using W to write.
And now we should be good.
All right.
Then we are going to do what?
Well, let's take care of the volume groups.
I'm using vgcreate minus S8M.
That's for the physical extent size.
So this is setting an 8 MB physical extent.
And I'm calling it vgfiles.
And I'm putting in dev nvme0n1p6, partition number 6.
So now I have a vgfiles volume group.
And that means that I can continue with the logical volume that needs to be created.
lvcreate minus n myfiles and minus lowercase l75.
That is how you address a number of extents.
We already have set the extents to 8 MB.
And I'm allocating 75 of them.
And we do that from the vgfiles volume group.
Let's finish this and use mkdir on mnt data
and mkfs.xfs on dev vgfiles myfiles to format it as XFS.
And finally, in etcfs step, I'm going to include it.
For logical volumes, you don't really need UUID
because the logical volume name itself is already a persistent name.
It won't change spontaneously.
So we mount it on slash mnt slash data.
XFS is the file system type.
Default is the mount option in 0 and 0.
And that is taking care of the first logical volume.
Then we need to increase the size of the slash logical volume by 5 GB.
To do so, we need to start analyzing the volume groups.
And I see there is the rel volume group,
which is where the root logical volume is.
And there is a v3 of 0.
So I need vgextent.
And I'm going to vgextent the rel volume group
with dev nvme 0 and 1 p7.
And now when we use vgs,
we can see that we have less than 6 GB available in this rel volume group.
Well, that is big enough because now I can use lvextent.
In lvextent, always use minus R to resize the file system as well.
And next, we are going to use minus uppercase L plus 5 G,
which is adding 5 GB to dev rel root.
And there we can see logical volume rel root was successfully resized.
So if I use df minus H this time on the top line,
I can see root logical volume with the size of 22 GB and 13 GB available.
And what does that mean?
Well, that means that we are done with this task.
And let's move forward to the next one.