Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

To determine in which partition an LVM is located, you can use the lsblk or fdisk -l

commands in the Linux terminal.

The lsblk command will show a tree-like structure of all storage devices and their partitions,
including any LVM Logical Volumes. The LVM Logical Volumes will be listed under the
mapper directory.

Here's an example output:

ruby
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 40G 0 disk
├─sda1 8:1 0 20G 0 part /
└─sda2 8:2 0 20G 0 part
└─ubuntu--vg-ubuntu--lv
251:0 0 39G 0 lvm /mnt

In this example, /dev/sda2 is a partition that contains the LVM Logical Volume ubuntu--vg-
ubuntu--lv.

Alternatively, you can use the fdisk -l command to list all available storage devices and their
partitions. The output will show the partition name and the type, which will be LVM for Logical
Volumes.

Here's an example output:

python
$ sudo fdisk -l
Disk /dev/sda: 40 GiB, 42949672960 bytes, 83886080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2949f74c

Device Boot Start End Sectors Size Id Type


/dev/sda1 * 2048 41945087 41943040 20G 83 Linux
/dev/sda2 41945088 83884031 41943044 20G 8e Linux LVM

In this example, the partition /dev/sda2 is an LVM partition, indicated by the Id Type of 8e
Linux LVM.

You might also like