Web lists-archives.com

Re: Restore backup to KVM




On 26/09/17 13:01, solitone wrote:
It's strange, since it finds /dev/sda, i.e. the entire disk:

=========================================================
[    6.438693] sd 0:0:0:0: [sda] 188743680 512-byte logical blocks: (96.6 GB/90.0 GiB)
[    6.469182] sd 0:0:0:0: [sda] Write Protect is off
[    6.482421] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
=========================================================

However, it then complains that /dev/sda1 does not exists

I've found out that if I specify /dev/sda like this:

$ qemu-system-x86_64 -hda alan_restore.img
-kernel /vmlinuz
-initrd /initrd.img
-append "root=/dev/sda ro init=/bin/bash"

then it finds, checks, and mounts the root file system. However now it fails because it tries to mount /dev and /run on /root/dev and /root/run, rather than simply /dev and /run:

=========================================================
[...]
Gave up waiting for suspend/resume device
done.
Begin: Will now check root file system ... fsck from util-linux 2.29.2
[/sbin/fsck.ext4 (1) -- /dev/sda] fsck.ext4 -a -C0 /dev/sda
/dev/sda: clean, 434616/5898240 files, 15174007/23592960 blocks
done.
[ 40.335292] EXT4-fs (sda): mounted filesystem with ordered data mode. Opts: (null)
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /dev on /root/dev failed: No such file or directory
done.
mount: mounting /run on /root/run failed: No such file or directory
run-init: opening console: No such file or directory
Target filesystem doesn't have requested /bin/bash.
run-init: opening console: No such file or directory
run-init: opening console: No such file or directory
run-init: opening console: No such file or directory
run-init: opening console: No such file or directory
run-init: opening console: No such file or directory
No init found. Try passing init= bootarg.
=========================================================