Мотирование образа диска KVM
sudo losetup /dev/loop1 disk.img
sudo kpartx -a -v /dev/loop1
sudo mount -t ntfs /dev/mapper/loop1p1 /mnt/tmp
Если монтируемый образ системы LVM то
sudo pvs
# /dev/dm-5 NAME lvm2 a- 9.52g 0
sudo lvdisplay
File descriptor 7 (pipe:[1047772]) leaked on lvdisplay invocation. Parent PID 20537: bash
– Logical volume –
LV Name /dev/NAME/root
VG Name NAME
LV UUID MC2xwj-3cUr-7iYk-t4d8-dmfp-2RDX-In6Op7
LV Write Access read/write
LV Status NOT available
LV Size 9.02 GiB
Current LE 2310
Segments 1
Allocation inherit
Read ahead sectors auto
– Logical volume –
LV Name /dev/NAME/swap_1
VG Name NAME
LV UUID rKuLfE-Drsk-KXPg-2Ghw-03mP-kjpA-8iY7hF
LV Write Access read/write
LV Status NOT available
LV Size 512.00 MiB
Current LE 128
Segments 1
Allocation inherit
Read ahead sectors auto
sudo vgchange -ay NAME
sudo mount /dev/solur/root /mnt/tmp
Размонтирование:
sudo umount /mnt/tmp
Если подключали LVM то
sudo vgchange -an NAME
sudo kpartx -dv /dev/loop1
sudo losetup -d /dev/loop1
sudo kpartx -a -v /dev/loop1
sudo mount -t ntfs /dev/mapper/loop1p1 /mnt/tmp
Если монтируемый образ системы LVM то
sudo pvs
# /dev/dm-5 NAME lvm2 a- 9.52g 0
sudo lvdisplay
File descriptor 7 (pipe:[1047772]) leaked on lvdisplay invocation. Parent PID 20537: bash
LV Name /dev/NAME/root
VG Name NAME
LV UUID MC2xwj-3cUr-7iYk-t4d8-dmfp-2RDX-In6Op7
LV Write Access read/write
LV Status NOT available
LV Size 9.02 GiB
Current LE 2310
Segments 1
Allocation inherit
Read ahead sectors auto
LV Name /dev/NAME/swap_1
VG Name NAME
LV UUID rKuLfE-Drsk-KXPg-2Ghw-03mP-kjpA-8iY7hF
LV Write Access read/write
LV Status NOT available
LV Size 512.00 MiB
Current LE 128
Segments 1
Allocation inherit
Read ahead sectors auto
sudo vgchange -ay NAME
sudo mount /dev/solur/root /mnt/tmp
Размонтирование:
sudo umount /mnt/tmp
Если подключали LVM то
sudo vgchange -an NAME
sudo kpartx -dv /dev/loop1
sudo losetup -d /dev/loop1