Ask Your Question
1

How do I cross reference lvm to /dev/sd?

asked 2017-09-07 18:14:17 -0500

lsatenstein gravatar image

I am cross referencing my fstab. My program works except for lvm organizationed /etc/fstab The example below is from my /etc/fstab

/dev/mapper/rfremix_rfronsda-root         /           ext4    defaults,noatime    1  1    
/dev/mapper/rfremix_rfronsda-home      /home      ext4    defaults,noatime    1  2
/dev/mapper/rfremix_rfronsda-swap      swap       swap    defaults,noatime    0  0

I know from using gparted, that it's on my /dev/sd8 How could I determine it by using some cross reference to the above

I don't know if I can rely on the following From the ls -l listing of /dev/disk/byid I extracted

lrwxrwxrwx. 1 root root 10 Sep  7 17:54 dm-name-rfremix_rfronsda-home -> ../../dm-2
lrwxrwxrwx. 1 root root 10 Sep  7 17:54 dm-name-rfremix_rfronsda-root -> ../../dm-0
lrwxrwxrwx. 1 root root 10 Sep  7 17:54 dm-name-rfremix_rfronsda-swap -> ../../dm-1
lrwxrwxrwx. 1 root root 10 Sep  7 17:54 dm-uuid-LVM-1T1JYyu6oEAXZ6iOBcHHTHTIxc1SjkgB3jSXQsAcajRpJdqigWJzTxgA4uwCwBuP -> ../../dm-0
 lrwxrwxrwx. 1 root root 10 Sep  7 17:54 dm-uuid-LVM-1T1JYyu6oEAXZ6iOBcHHTHTIxc1SjkgB5G4JMHO1BYynUkp8fwJoMurEkVxMwwad -> ../../dm-2
 lrwxrwxrwx. 1 root root 10 Sep  7 17:54 dm-uuid-LVM-1T1JYyu6oEAXZ6iOBcHHTHTIxc1SjkgBFEOWvbTT32wbyh1N6y18bZenZCB2CvGJ -> ../../dm-1
 lrwxrwxrwx. 1 root root 10 Sep  7 17:54 lvm-pv-uuid-NWM8Wp-nb7D-j2wK-mJHc-ma0d-soUN-Q43CBj -> ../../sda8

Can I rely on the lvm-pv-uuid line to always follow the dm-name entries.

Is there a set of links that I am not aware of that I can read to pick up the current /dev/sda8 more easily?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-09-08 07:38:11 -0500

A good overview is the output of lvs -o +devices. You also could query the information with lvdisplay, vgdisplay and pvdisplay.

edit flag offensive delete link more

Comments

Additionally the command pvs shows the relationship between physical volums and volume groups on them. (The third command of this trio is vgs)

jmt gravatar imagejmt ( 2017-09-09 18:04:35 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-09-07 18:14:17 -0500

Seen: 76 times

Last updated: Sep 08 '17