Re: Restore backup to KVM
- Date: Sat, 30 Sep 2017 14:04:02 +0300
- From: Reco <recoverym4n@xxxxxxxxx>
- Subject: Re: Restore backup to KVM
On Fri, Sep 29, 2017 at 06:30:21AM +0200, solitone wrote:
> On 28/09/17 08:58, Reco wrote:
> > It's initrd that first tries to mount tmpfs filesystems on /root (and
> > fails), and only *then* mounts your root filesystem to /root (with the
> > intention to switch to it as /).
> Also, I don't understand why it needs to mount the root filesystem to /root.
So, I did some tests. Results are somewhat unexpected.
First things first, either I'm missing something, or MODULES=most does
not work as advertised. It did not put "all harddrive drivers" into
initrd for me.
Second, once I convinced update-initramfs to put missing kernel modules
into initrd, QEMU booted successfully with "init=/bin/bash".
If I understand what's written in /usr/share/initramfs-tools/script
correctly, the way it should work is the following:
1) Unpack initrd, load kernel modules, etc.
2) Mount root filesystem to /root (and that's initrd's /root!).
3) Re-mount /dev into /root/dev (that's init-bootom/udev, and that's
where it fails for you).
4) Mount procfs, sysfs (and several others) into appropriate directories
5) Mount everything appropriate from /etc/fstab.
6) Execute pivot_root(8) to switch root filesystem, start init.
Therefore the next thing I have to suspect is that your backup misses
/dev directory (possibly /proc and /sys). The contents for those are
irrelevant. You simply do not have /dev, /proc, /sys in your root