0

I tried to install a new Debian 10 system using debootstrap:

mount /dev/sda5 /mnt/chroot
debootstrap --variant=minbase buster /mnt/chroot ftp.au.debian.org

The bootstrap looks good so far. Now switching to the chroot

mount --bind /dev /mnt/chroot/dev
mount --bind /proc /mnt/chroot/dev
mount --bind /sys /mnt/chroot/dev 

chroot /mnt/chroot/
apt-get update
apt-get --no-install-recommends install busybox linux-image-amd64 systemd-sysv pciutils usbutils
passwd

which also completes without error. The installed kernel is /vmlinuz -> boot/vmlinuz-4.19.0-11-amd64 and the kernel modules are in /lib/modules/4.19.0-11-amd64.

Now re-booting via GRUB into the new install, using

insmod all_video; search --label test; linux /vmlinuz root=LABEL=test; initrd /initrd.img

I get

uname -r
4.9.0-13-amd64

which is not the kernel installed by debootstrap (4.19.0-11)! Instead it is the kernel 4.9.0-13 from the parent system when I ran debootstrap. Importantly, the new installation does not have any matching kernel modules for 4.9.0-13, so the new system is missing a bunch of device drivers.

If I use

insmod all_video; set root=(hd1,gpt5); linux /vmlinuz root=/dev/sda5; initrd /initrd.img; boot

instead, I boot into the new system with the new kernel.

Any ideas where this could have come from, and how to fix?

Many thanks.

0
1

The GRUB commands you used,

insmod all_video; search --label test; linux /vmlinuz root=LABEL=test; initrd /initrd.img

pick up the kernel (/vmlinuz) and initramfs (/initrd.img) from the default GRUB root, which is your parent system’s.

This is why specifying

insmod all_video; set root=(hd1,gpt5); linux /vmlinuz root=/dev/sda5; initrd /initrd.img

instead works: it’s not a label problem, it’s that you’ve set the GRUB root to use your new system’s partition, and the kernel and initramfs are loaded from there.

To fix this, assuming you want the installation in /dev/sda5 to be the new default, the best solution would be to boot that (using the second GRUB command line above), and then install GRUB from the booted system, running Debian 10.

1
  • Ah, interesting. I incorrectly thought search --label test set root to the found device. search --label --set test is the correct command to set root to the found device. Thanks for the insight! – schieghoven Oct 14 '20 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.