0

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?

deanhuff
  • 3
  • 2

1 Answers1

0

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.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34