Il 18 dicembre 2016 10:51, Piviul <piv...@riminilug.it> ha scritto: > Ciao a tutti, in uno script devo scoprire il logical volume a cui appartiene > un determinato path. Prima di jessie (systemd?) per farlo usavo prima il > comando df, poi lvdisplay. > > Ad esempio se volessi scoprire il device in cui è montata la home da script > lanciavo il comando: > > $ df --output=source /home > Filesystem > /dev/dm-0 > > e poi il risultato lo davo in pasto a lvdisplay: > > $ lvdisplay /dev/dm-0 > Volume group "dm-0" not found > Skipping volume group dm-0 > > Come vedete su jessie non funziona. Il problema sembra essere che lvdisplay, > il device lo vuole in altro modo (come /dev/vggoup/lvname). Infatti nel mio > caso specifico /dev/dm-0 è il device a cui /dev/vg0/lv_root punta: > > $ ls -l /dev/vg0/lv_root > lrwxrwxrwx 1 root root 7 Dec 17 11:02 /dev/vg0/lv_root -> ../dm-0 > > e infatti > > $ root@servercam:~# lvdisplay /dev/vg0/lv_root > --- Logical volume --- > LV Path /dev/vg0/lv_root > ... > > Qualcuno ha qualche idea di come possa risolvere? Come faccio a trovare il > LV a cui un percorso appartiene un LV però che lvdisplay riconosce? > > Mille grazie > > Piviul >
io ho sempre usato le periferiche settate in mapper mauro@SamGange:~$ sudo lvdisplay /dev/mapper/SamGange--vg-home --- Logical volume --- LV Path /dev/SamGange-vg/home LV Name home VG Name SamGange-vg LV UUID 1SzdIr-MeLJ-jN6Q-xRGV-3YJ6-Jeqz-D9EWmz LV Write Access read/write LV Creation host, time SamGange, 2016-06-17 12:04:44 +0200 LV Status available # open 1 LV Size 435,40 GiB Current LE 111463 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:2 è vero che sono dei link, in questo caso /dev/dm-2 ed è vero anche sulla mia che lvdsplay non mi fornisce alcun dato chiamando direttamente il device: mauro@SamGange:~$ sudo lvdisplay /dev/dm-2 Volume group "dm-2" not found Cannot process volume group dm-2 -- Gollum1 - http://www.gollumone.it Tesssssoro, dov'é il mio tessssoro...