Score:0

lsblk shows LVM volume as subcomponent of a partition

tr flag

Given two physical drives, sda and sdb, I have:

  • Used fdisk to make sda1, sda2, sdb1 and sdb2
  • Created four physical volumes accordingly: pvcreate /dev/sda1 etc
  • Created a volume group: vgcreate datavg /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2
  • Created a logical volume: lvcreate -L 4096 -n datalv datavg
  • Made a filesystem: mkfs -t ext4 /dev/datavg/datalv

This seems to have worked fine as far as I can tell. However, the relevant output of lsblk now looks like this:

NAME              MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                 8:0    1  58.7G  0 disk 
|-sda1              8:1    1  29.4G  0 part 
`-sda2              8:2    1  29.3G  0 part 
sdb                 8:16   1  58.7G  0 disk 
|-sdb1              8:17   1  29.4G  0 part 
| `-datavg-datalv 254:0    0     4G  0 lvm  /mnt/data
`-sdb2              8:18   1  29.3G  0 part 

I don't quite get why datavg-datalv would show up underneath sdb1. Is this indicative of some error during my setup?

Score:2
ca flag

sda1 is a component device (a physical volume in LVM lingo) of datavg volume. The output of lsblk is perfectly normal given the command you issued.

domsson avatar
tr flag
Does that mean that the LVM showing up underneath `sdb1`, in particular, was basically just chance and it could've as well ended up under `sda2`, for example?
shodanshok avatar
ca flag
It means that you small 4G volume was allocated on `sdb1` only (simply because it fits in a single physical volume). Anyway, to inspect LVM you should use `pvs`, `vgs`, `lvs` and related commands. If you can/want, share the output of these commands for further inspection.
Score:1
cz flag

Your LV is not large enough to span more than one PV.

domsson avatar
tr flag
That makes sense. Does that mean that the LV could've as well shown up underneath any of the other three partitions?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.