blob: 3d1423dd61e0e1a684151a097d860c9be7066e96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#! /usr/bin/env sh
if [ "$(id -u)" -ne 0 ]; then
echo 'This script must be run by root.' >&2
exit 1
fi
# https://gist.github.com/pshchelo/6ffabbffaedc46456b39c037d16e1d8c
#LIBGUESTFS_PATH=/usr/share/guestfs/appliance \
# guestmount -a "$1" -m /dev/vda1 --ro "$2"
modprobe nbd max_part=8
#qemu-nbd --connect=/dev/nbd0 /var/lib/libvirt/images/devuan.qcow2
#cryptsetup open /dev/nbd0p3 vm-disk
#pvscan --cache /dev/mapper/vm-disk
qemu-nbd --connect=/dev/nbd1 /var/lib/libvirt/images/nixos-test.qcow2
pvscan --cache /dev/ndb1p3
#qemu-nbd --connect=/dev/nbd2 /var/lib/libvirt/images/tora.qcow2
#pvscan --cache /dev/ndb2p3
vgscan
lvscan
#mount /dev/shima-vg/root /mnt/tmp/
mount /dev/test-vg0/root /mnt/tmp/
#mount /dev/tora-vg0/root /mnt/tmp/
|