1

long time ago I mounted 3 lvm with same size on a virtual machine. now I want to umount one of them but I can't remember which lvm is mounded on which directory. How can find mount point of lvm in virtual machine?

New contributor
haj_baba is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    Could you please add to your post the output of: virsh dumpxml <VM_name> Replace any confidential details with something generic. – Mircea Vutcovici May 23 at 6:54
  • I wonder if you can use blkid on the block devices is the VM and outside and compare the outputs? – davidgo May 23 at 7:10
  • If that doesn't work, its not totally risk free, but maybe you could very slightly increas, by different amounts, the lvm blocks in the host and then reexamine these in the VM. I'm uncertain if this can be done without a restart of the VM though. – davidgo May 23 at 7:13
  • Another option could be to snapshot each lvm block and then mount and examine the copy in the host. – davidgo May 23 at 7:13
  • @allexiusw how would that help? – davidgo May 23 at 7:33
0

As Mircea Vutcovici said with virsh dumpxml <VM_name> you can see lvm name and its target in virtual machine. you sould look for disk section. Before knowing this solution I deleted wrong lvm. I hope others don't repeat my mistake. In below you can see disk section in dumpxml for one of my vms:

    <disk type='block' device='disk'>                                                                                                             
      <driver name='qemu' type='raw' cache='none' io='native'/>                                                                                   
      <source dev='/dev/vg/db_foo'/>                                                                                                     
      <backingStore/>                                                                                                                             
      <target dev='vda' bus='virtio'/>                                                                                                            
      <boot order='1'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
| improve this answer | |
New contributor
haj_baba is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

haj_baba is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.