Logical Volume Manager (LVM)

source : brainupdater.net

In this post, I will discuss LVM. What is LVM? LVM stands for Logical Volume Manager. Clearly, LVM is a method of allocating storage space to more flexible storage media than conventional partitions. LVM is another form of storage virtualization.

In general, LVM allows us to combine or combine several partitions and / or disks into one larger Logical Volume which then allows it to be changed, merged and or moved in the conditions being used. This means that no downtime is needed to increase or decrease storage capacity. This is useful because it does not interfere with the ongoing operational process. Logical Volume Management (LVM) is a disk management option that is almost available on every Linux distribution. Source.

Just go to the tutorial

If we want to do it on our own laptop, without using a virtual box or something, I suggest backing up the data that you have first, because it can happen if the steps are wrong, the result will be fatal, the data you have may be lost.

The first
Just like the previous posting, if we haven’t created a partition, we make it first, the explanation is in that post. If you have, we just need to replace the type of partition from ext2 / ext3 / ext4 (depending on you) to LVM.

The second
If we already have a partition that we want to change, we just have to change it, this is how:

fdisk / dev / sdb (adjust to your device name), then follow the one below

Command (m for help): t
Partition number (1,2, default 2):
Partition type (type L to list all types): 8e (this is the lvm code)

Changed type of partition ‘Linux’ to ‘LVM Linux’.

Command (m for help): t
Partition number (1,2, default 2): 1
Partition type (type L to list all types): 8e

Changed type of partition ‘Linux’ to ‘LVM Linux’.

Command (m for help): w (this is for save)

The table partition has been altered.
Calling ioctl () to re-read partition table.
Syncing disks.
The third
Immediately, we immediately create Physical Volume in a way

pvcreate / dev / sdb1 / dev / sdb2
Adjust it to the device you want to make LVM, because I want to make sdb1 & 2, so I write it like that. After we type it, the output will come out like this:

After that, try typing

the output will come out like this:

The fourth
Next we create a group volume

vgcreate tinydata (this is free, adjust what you want to do with the design) / dev / sdb1 / dev / sdb2 (adjust as usual)
Then the output will come out like this:

The fifth
Then, we create logical volumes, here I make it with the name tinydata. The way is this:

lvcreate –name logical-tiny –size 300M data

The fifth
Without a filesystem in a logical volume, we can not be sympathetic in it. Then we make it this way:

mkfs -t ext4 / dev / tinydata / logical-tiny

The sixth
Now, I will mount the logical volume. I will mount it on / mnt / teeny (it’s free), then we create the first folder in it

mkdir / mnt / teeny

or you can, you enter the folder / mnt / and mkdir inside it.
Then, we mount by:

mount / dev / tinydata / logical-tiny / mnt / teeny /
Adjust to what you make.

Then run it

df -h
Thank you
Maybe that’s what I can write this time, as usual, criticism & suggestions are needed in my writing to be better in the future. So, you can contact me via Twitter, Instagram, which is listed at the bottom of my website, or on the criticisms & suggestions menu which is right on the top of my web.


Leave a Reply

Your email address will not be published. Required fields are marked *