Bug#649217: bug #649217: confirmation and reason found!
Hi,
I am hit by this problem too. I am running Sid.
I debootstrap a second root filesystem into logical volume vg/deboot to
reinstall my original root filesystem. After re-installation of my system from
i386 to amd64 (deboostrap) I decided to save second root filesystem as second
"rescue" system.
deboot vg -wi-a--- 1.00g
It is ext4 including boot directory, important items follows:
bobek:/tmp# mount /dev/mapper/vg-deboot /mnt/
bobek:/mnt# ls -la vmlinuz initrd.img boot/
lrwxrwxrwx 1 root root 30 Nov 10 18:30 initrd.img -> /boot/initrd.img-3.2.0-4-amd64
lrwxrwxrwx 1 root root 26 Nov 10 18:30 vmlinuz -> boot/vmlinuz-3.2.0-4-amd64
boot/:
total 15864
drwxr-xr-x 2 root root 4096 Nov 10 18:34 .
drwxr-xr-x 24 root root 4096 Nov 10 21:58 ..
-rw-r--r-- 1 root root 2100042 Oct 22 18:57 System.map-3.2.0-4-amd64
-rw-r--r-- 1 root root 128869 Oct 22 18:57 config-3.2.0-4-amd64
-rw-r--r-- 1 root root 11170966 Nov 10 18:34 initrd.img-3.2.0-4-amd64
-rw-r--r-- 1 root root 2828288 Oct 22 18:54 vmlinuz-3.2.0-4-amd64
After update-grub I ended with 5 times menuentry for vg-deboot :(.
Investigating the problem I found a kernel/initrd is searched on mounted
partition. A partition is mounted using grub-mount preferably.
You can see this in the /usr/lib/linux-boot-probes/50mounted-tests
Grub-mount is in reality based on fuse.
bobek:/usr/lib/linux-boot-probes# grub-mount /dev/mapper/vg-deboot /mnt/1
bobek:/usr/lib/linux-boot-probes# mount|grep /mnt/1
grub-mount on /mnt/1 type fuse.grub-mount (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
bobek:/usr/lib/linux-boot-probes# ls -la /mnt/1/{vmlinuz,initrd.img,boot/}
-r--r--r-- 0 root root 32979968 Nov 10 18:30 /mnt/1/initrd.img
-r--r--r-- 0 root root 2828288 Nov 10 18:30 /mnt/1/vmlinuz
/mnt/1/boot/:
total 37147
dr-xr-xr-x 0 root root 0 Nov 10 18:34 .
dr-xr-xr-x 0 root root 0 Jan 1 1970 ..
-r--r--r-- 0 root root 2100042 Oct 22 18:57 System.map-3.2.0-4-amd64
-r--r--r-- 0 root root 128869 Oct 22 18:57 config-3.2.0-4-amd64
-r--r--r-- 0 root root 32979968 Nov 10 18:34 initrd.img-3.2.0-4-amd64
-r--r--r-- 0 root root 2828288 Oct 22 18:54 vmlinuz-3.2.0-4-amd64
Symlinks are converted into regular files! :(.
A code in the /usr/lib/linux-boot-probes/mounted/90fallback:
...
21 if [ -f "$kernfile" ] && [ ! -L "$kernfile" ]; then
...
There is a test on "$kernfile" and body of condition is processed only for
regular file - no symlink. And this is the problem with grub-mount.
The symlink in the root directory is not recognized and things are processed
several times.
bobek:/tmp/xxx# /usr/lib/linux-boot-probes/50mounted-tests /dev/mapper/vg-deboot
/dev/mapper/vg-deboot:/dev/mapper/vg-deboot::/vmlinuz:/initrd.img:root=/dev/dm-23
/dev/mapper/vg-deboot:/dev/mapper/vg-deboot::/vmlinuz:/initrd.img:root=/dev/dm-23
/dev/mapper/vg-deboot:/dev/mapper/vg-deboot::/boot/vmlinuz-3.2.0-4-amd64:/boot/initrd.img-3.2.0-4-amd64:root=/dev/dm-23
/dev/mapper/vg-deboot:/dev/mapper/vg-deboot::/vmlinuz:/initrd.img:root=/dev/dm-23
/dev/mapper/vg-deboot:/dev/mapper/vg-deboot::/vmlinuz:/initrd.img:root=/dev/dm-23
Disabling grub-mount in ./50mounted-tests uncovers the problem.
bobek:/tmp/xxx# ./50mounted-tests /dev/mapper/vg-deboot
/dev/mapper/vg-deboot:/dev/mapper/vg-deboot::/boot/vmlinuz-3.2.0-4-amd64:/boot/initrd.img-3.2.0-4-amd64:root=/dev/dm-23
bobek:/tmp/xxx# diff /usr/lib/linux-boot-probes/50mounted-tests 50mounted-tests
37c37
< if type grub-mount >/dev/null 2>&1 && \
---
> if false && type grub-mount >/dev/null 2>&1 && \
Cheers
--
Zito
Reply to: