Imran: Now you do have some understanding
of how LVM works, which is of course
for logical volume management.
And we will go through our Linux OS installation
and we will configure LVM for the very first time
while we are doing our Linux installation.
So let's open up our package
and attach our ISO image to our VM.
So let's go into our virtual machine,
click on New.
And this time put LVM Linux OS.
It doesn't matter.
You could pick any name that you like.
The type should be Linux and the version is the 64 bit.
Click Next.
Leave the memory as one gig.
Create a new virtual disk.
Next.
Leave a default for the virtual physical disk.
This is the name of your folder where it will be created
and this is the the size of your hard disk.
Okay, so now you have two virtual machines,
one you have already running previously
and the second one you just created.
So let's start it.
Okay, we have to specify where is our CentOS ISO image is.
And click Start.
Okay, this is going to boot the system in 54 second.
The first one is install CentOS 7.
The second one, test this media and install OS.
Don't pick that.
Click the up arrow key and go with install CentOS 7.
Hit Enter.
The first thing that you will see
during the installation is welcome to CentOS 7.
You'll leave that default as English and English
and you'll click on Continue.
On the second page you'll see the date.
Leave that default as America and New York time.
If you are in a different region,
you could pick according to your region.
Keyboard, it will also getting the list of keyboards
and I will have it set to default,
which is also going to be US English.
Language Support is English to the United States.
Again, the first one is the localization.
You should pick these settings according to your location.
The next one is a software installation source
is the local media which we have already
attached to this installation.
And on the right-hand side
you'll see the software selection.
We will keep the software selection to minimum
which means there will be no GUI installed.
'Cause this is just the demonstration
of the LVM configuration.
Kdump is enabled.
Security policy, you leave it as is.
Let's pick the host name and network.
If you scroll down, the host name is right here.
I want you to pick any host name that you like.
I will just pick host123 and click on Apply.
And you see on the right-hand says it says,
"Current host name: host123."
For now you will leave the network setting
as disconnected and turn off.
Click Done.
Then go to Installation Destination.
This is where you would have to specify your disks,
your partitions and what kind of LVM partitions
you will be configuring.
Okay, we have our disk as set to eight gig of memory.
So select that.
When you have this check mark
we'll have the option enabled at the bottom,
and it says automatically configure partitioning.
Now this time you will check,
"I will configure partitioning myself."
Once you click on it and then go to click Done.
Once it is done, it will bring you to a page
where it would ask you the new CentOS 7 installation.
And it says you have created any mount points
for your CentOS 7 installation yet.
So we have to create it of course.
Create new mount points
by clicking the Plus button, right here.
Before we click the plus button, it'll ask,
"New mount points will use
the following partitioning scheme."
Which is LVM.
You could click standard partition,
which will not be LVM related.
If you click on LVM and click Plus sign it will actually
apply the LVM configuration to the partition.
And you pick the mount point.
For example, you want to have home directory,
and pick 2g, meanings two gig you want to give it
to your home directory.
click Add Mount Point.
As soon as you click Add Mount Point, on the right-hand side
it will give you the mount point /home.
The capacity that you have picked.
The device type will be LVM.
Again, you could change it if you want to,
but we are working with LVM so we will leave that as LVM.
The group name is sent centos_host123.
This is the host name, sorry group name
that is being picked by the installation itself.
You can modify it if you want to give it a different name
by clicking modify.
File system type is XFS,
which is the most latest one in Linux.
You could pick a different file system if you desire to.
Then the label, you could leave it as is.
And the name of course is home.
So you have given two gig to this
and you have left with six gig.
So let's pick another partition.
So you click Plus.
And this time you will pick var.
Var wanted to give two gig as well.
2g, and click Add Mount Point.
And same thing as we had for home.
It is giving us mount point var, two gig LVM,
centos_host123, volume group is the same volume group
that has the whole entire eight gig assigned.
You can modify to change it again.
But anyway, now you see we have four gig left.
Now simply what you could do is you could click Add here.
And if you wanted to add swap, let's add swap.
Swap is a virtual memory
which is just like a regular memory in your disk.
But this will be used to be available
when the physical memory is run out of space.
So you click on Add Mount Point again.
And again there is no mount point for swap
because it's just a virtual memory.
Everything will be the same.
And now you have three gig left.
So click Plus again and this time you pick the rest,
which will be / everything else that is left
on your disk space will go to / directory.
So if you see it has here 3063.97.
You could type all those numbers
or you could just simply type "all."
When you type "all" it will take the entire disk space left
and assign it to your last mount point, which is /.
Add mount point.
And confirm the configuration on the right-hand side.
The device type is LVM, the group is the same.
The name of that petition is gonna be root.
And as you see we only have 992.5 kilobyte, this space left.
So you could just leave it as is.
The system needs it to leave it out.
And now you could just click Done.
It will just tell you the summary
of all the changes that you have done,
that it will create these home directories.
That's okay. Click accept changes.
And now it says, "Error checking storage configuration."
Select this and this click Done again.
And just confirm one more time.
Everything looks good.
Yep, everything looks good.
So let's go back again.
Error check, click for details.
Press Done again to continue.
"The boot file system cannot be of type LVM."
Yes, that is true.
I forgot to pick boot.
Boot also has to be picked.
So I will pick...
So I will remove this first
because we need to create boot first.
So the last petition, that / that we were picking,
I removed that now I will add boot first.
And I will give this 500 meg, which is half a gig.
That is added.
Same thing, XFS file system.
Now the rest I want to give it to root file system.
And just assign all.
Everything is added.
Just make sure no error messages.
Click on Done.
Accept changes.
Custom partition selected.
Everything here looks good
and no red letters of error messages.
Perfect. Now begin the installation.
We'll set the root password real quick.
And user creation, if you want to.
You would have to click Done twice
because the password that I have entered is weak password.
So it asks us to click the Done button twice
just to confirm that you are are aware
that you have picked the weak password.
Anyway, if you notice at the bottom you'll see we have
300 packages that it has to go through
and it is applying all those packages.
I will fast forward from here.
The installation has been completed successfully.
As you see at the bottom it says, "CentOS is now
successfully installed and ready for you to use."
When you come down, you'll see the option to reboot.
So just go ahead and simply reboot.
Okay, the system has been rebooted
and we've got the login prompt.
We'll go ahead and log in.
Okay, now run df -h.
This command will give you all the partitions
that we have created during an installation
and it will show you the size
and the used space and available space.
The first line, if you notice, we have the root file system
and you see it is,
it has a file system starting with /dev/mapper.
So anything that you have in LVM
it will start with /dev/mapper.
Anything that is not with LVM or just a swap space
does not have the partition file system.
So on the right-hand side you'll see it is mounted
on /dev, which is the swap.
All of them are swap.
The next one that you'll see from the list
is /home, /var, and /boot.
Those are all three partitions are mounted.
Sorry, only two, home and var are mounted under LVM
whereas boot does not get mounted under LVM.
It's a standard file system.
And let's look at our other Linux machine.
So the difference between with this machine
and other machine is this machine has GUI.
The other one we did not install the GUI
because we just wanted to cover
how the LVM is configured during the installation.
So run df -h.
In this one you will see the first line,
right here it says /dev/mapper/centos-root.
Now if you notice this machine
is also configured with LVM.
It did the configuration on its own
because we did not partition it ourself.
So by default Linux installation will create
your file system under the LVM unless you specifically
tell it to use a standard partition.
But in this system you'll see we don't have /var, /home,
/var, We don't have those partition because we actually
included all those partition within the first partition.
In this one you could still have
everything under one partition.
Sorry.
This one you could have everything
under one partition, which is /.
But the reason we picked separate partitions
/home, /var is just to cover this lesson
so you will understand how LVM is configured
for each mounted partition.