How can I mount a root virtual disk from another VM on my CentOS ? In order to change some files on it, not to use it as a real root disk.
there are 2 partitions on my virtual disk : /boot (Linux partition) and / (LVM)
I've already added it to my VM by using virsh attach-disk, then I can see it on my CentOS but I can't use it :
mount /dev/vdx /mnt/test
mount: unknown filesystem type 'LVM2_member'
And something really weird, if I add my disk on my VM template, my centOS use the /boot partition of it (/dev/vdc1) instead of the /boot partition (/dev/vda1) that it has to use...
Thanks for help
[EDIT] :
This is the actual situation and my problem :
- VM1 has virtual drive #1, provided by hypervisor (logical volume LVM). This VM is KO, I can't boot it because of I/O errors.
- VM2 has virtual drive #2, provided by hypervisor (LVM too). It works fine.
The 2 virtual drives are cut like that on their VM : - /dev/vda1 = /boot (Linux partition) - /dev/vda2 = / (LVM partition)
Problem : I need to recover datas from VM1.
So I've already attach vd#1 to VM2. On VM2 I can see that drive, as /dev/vdc, but how can I mount it and read it ?
Thanks.
@psusi and @Halfgaar
Hypervisor :
virsh attach-disk my_VM /dev/vgdata/disk10 vdc
on my VM :
ls -la /dev/vd*
brw-rw---- 1 root disk 252, 0 Dec 22 11:22 /dev/vda
brw-rw---- 1 root disk 252, 1 Dec 22 11:22 /dev/vda1
brw-rw---- 1 root disk 252, 2 Dec 22 11:22 /dev/vda2
brw-rw---- 1 root disk 252, 16 Dec 22 11:22 /dev/vdb
brw-rw---- 1 root disk 252, 32 Dec 22 11:48 /dev/vdc
brw-rw---- 1 root disk 252, 33 Dec 22 11:48 /dev/vdc1
brw-rw---- 1 root disk 252, 34 Dec 22 11:48 /dev/vdc2
vgchange -ay ok. But how can I activate the volumes inside /dev/vdc if they are the same as my actual VM?
dm_mod
module is not loaded. Can you check whetherdm_mod
is getting listed in the output oflsmod
?