Score:0

Can Block Device IDs in LVM be set statically?

ru flag

I have a system using LVM2 with a single PV which contains 1 VG which in-turn contains 5 logical volumes (/, /home, /var, /swap, /data).

When I create a snapshot of LV / (lvcreate -L 15G -s -n root_snap_test01 /dev/vg01/lv_root), upon reboot the device id (using something like stat /home) will show that it's device id has been incremented for each snapshot of / that is created. Further, if / is restored (lvconvert --merge ...) from a snapshot, /home's device id will become /'s original device id.

Is there a way to specify the Block Device (and assuming resulting device id that is output as part of the stat command) for a given set of Logical Volumes?

Is this something that could be applied statically given a LV Name?

Score:0
cn flag

Device from coreutils' stat is the major and minor device numbers. This is a lower level identifier than most storage administration tools deal with. I do not think it can be provided by the user, nor is it static.

An identifier that stays with the data is file system UUID. For XFS, set one with xfs_admin -U generate When taking snapshots, the UUID is duplicated, but can be re-generated or set, for example: xfs_admin -U 195d1175-1231-4773-834e-d738bf665bea

Also, LVM maintains named symlinks. /dev/vg01/lv_root is a link to a device mapper special file, representing the major and minor for the kernel.

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.