Академический Документы
Профессиональный Документы
Культура Документы
LVM Features
1. It is flexible to expand the space at any time.
2. Any file systems can be installed and handle.
3. Migration can be used to recover faulty disk.
4. Restore the file system using Snapshot features to earlier stage. etc
We can see the Physical Volume (PV), Volume Group (VG), Logical Volume (LV) by using following
command.
# pvs
# vgs
# lvs
This will create the volume group using 32MB PE size in the name of myvg using 3 Physical
volumes.
To get more information about newly created volume groups, run the following command.
# vgdisplay tecmint_add_vg
# pvcreate /dev/sda1
# vgextend vg_tecmint /dev/sda1
We can even see which PV are used to create particular Volume group using.
# pvscan
Use + to add the more space. After Extending, we need to re-size the file-system using.
# resize2fs /dev/vg_tecmint/LogVol01
Here we are going to see how to reduce the Logical Volumes. Everyone say its critical and may end
up with disaster while we reduce the lvm. Reducing lvm is really interesting than any other part in
Logical volume management.
1. Before starting, it is always good to backup the data, so that it will not be a headache if
something goes wrong.
2. To Reduce a logical volume there are 5 steps needed to be done very carefully.
3. While extending a volume we can extend it while the volume under mount status (online),
but for reduce we must need to unmount the file system before reducing.
Lets see what are the 6 steps below.
Re-size the file-system back, In this step if there is any error that means we have messed-up our
file-system.
# resize2fs /dev/vg_tecmint_extra/tecmint_reduce_test
________________________________________
LVM Snapshots are space efficient pointing time copies of lvm volumes. It works only with lvm
and consume the space only when changes are made to the source logical volume to snapshot
volume. If source volume has a huge changes made to sum of 1GB the same changes will be made
to the snapshot volume. Its best to always have a small size of changes for space efficient. Incase
the snapshot runs out of storage, we can use lvextend to grow. And if we need to shrink the
snapshot we can use lvreduce.
If we have accidentally deleted any file after creating a Snapshot we dont have to worry because
the snapshot have the original file which we have deleted. It is possible if the file was there when
the snapshot was created. Dont alter the snapshot volume, keep as it while snapshot used to do a
fast recovery.
Snapshots cant be use for backup option. Backups are Primary Copy of some datas, so we cant
use snapshot as a backup option.