0

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?

domsson
  • 103
  • 4

2 Answers2

2

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.

shodanshok
  • 47,711
  • 7
  • 111
  • 180
  • 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? – domsson Jul 23 '21 at 11:23
  • 2
    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. – shodanshok Jul 23 '21 at 11:46
1

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

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • That makes sense. Does that mean that the LV could've as well shown up underneath any of the other three partitions? – domsson Jul 23 '21 at 06:36