Bug#595458: /usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?). [btrfs]

Nicolas STRANSKY Nico at stransky.cx
Sun Sep 19 16:25:14 UTC 2010


Hello and thanks for your reply. See my answers below.

On 09/15/2010 10:30 AM, Alexander Kurtz wrote:

>  * grub-pc 1.98_20100602-1
>    This version make grub-probe work with / on btrfs[1]. Note that this
>    does not mean GRUB can boot from btrfs, you'll still need a separate
>    boot partition. Also note that currently only the single-device case 
>    is supported.

I have:
ii  grub-common                          1.98+20100804-4
ii  grub-pc                              1.98+20100804-4
So these versions are supposed to work with btrfs.

>  * btrfs-tools 0.19-11
>    This version adds initramfs integration[2]. Without this package your
>    initramfs will simply not contain the btrfs kernel module so the 
>    kernel won't be able to mount the root fs.

I have:
btrfs-tools:
  Installed: 0.19+20100601-3
  Candidate: 0.19+20100601-3
This is the latest available on sid.

>  * klibc-utils 1.5.18-1
>    This version adds support for btrfs to the 
>    `/usr/lib/klibc/bin/fstype' program[3]. This is needed for
>    example if you use cryptsetup to encrypt your root fs.

klibc-utils:
  Installed: 1.5.20-1
  Candidate: 1.5.20-1
Note that I do not use cryptsetup.

> You'll probably already have all these packages installed in the
> required versions, but please re-check.

OK.

> As mentioned above GRUB does not really support btrfs (otherwise you
> wouldn't need a separate /boot partition). However it should support
> correctly writing the root device into `/boot/grub/grub.cfg'. I assume
> that is precisely your problem, right?

Yes, this is correct.

> So can you try these commands as root and send me the output:
> 
> 	mount
> 	grub-probe --target=device --verbose /

# mount
/dev/sda1 on / type btrfs (rw)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sda3 on /boot type ext3 (rw,commit=0)
/dev/sda4 on /home type btrfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc
(rw,noexec,nosuid,nodev)

# grub-probe --target=device --verbose /
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: the size of hd0 is 625142448.
grub-probe: info: changing current directory to /dev.
grub-probe: info: changing current directory to mapper.
grub-probe: info: changing current directory to disk.
grub-probe: info: changing current directory to by-label.
grub-probe: info: changing current directory to by-uuid.
grub-probe: info: changing current directory to by-id.
grub-probe: info: changing current directory to by-path.
grub-probe: info: changing current directory to snd.
grub-probe: info: changing current directory to by-path.
grub-probe: info: changing current directory to bsg.
grub-probe: info: changing current directory to bus.
grub-probe: info: changing current directory to usb.
grub-probe: info: changing current directory to 002.
grub-probe: info: changing current directory to 004.
grub-probe: info: changing current directory to 005.
grub-probe: info: changing current directory to 003.
grub-probe: info: changing current directory to 001.
grub-probe: info: changing current directory to input.
grub-probe: info: changing current directory to hdaps.
grub-probe: info: changing current directory to by-path.
grub-probe: info: changing current directory to block.
grub-probe: info: changing current directory to char.
grub-probe: info: changing current directory to dri.
grub-probe: info: changing current directory to cpu.
grub-probe: info: changing current directory to net.
grub-probe: info: changing current directory to shm.
grub-probe: info: changing current directory to pts.
grub-probe: error: cannot find a device for / (is /dev mounted?).

>> *********************** BEGIN /proc/mounts
>> /dev/root / btrfs rw,relatime 0 0
>> /dev/sda3 /boot ext3 rw,relatime,errors=continue,commit=5,barrier=0,data=writeback 0 0
>> /dev/sda4 /home btrfs rw,relatime 0 0
>> *********************** END /proc/mounts
> 
> Hmm `/dev/root' sounds strange to me. Are you using any special hw (raid
> controller etc.)? Or what does this mean?

> Please give a short short overview over your partitions, e.g.
> /dev/sda1 contains /boot, /dev/sda2 contains /, /dev/sda3 contains
> swap, etc.

I'm not sure what it means, I'm not using anything too special here. But
maybe I have a configuration error somewhere that somehow was silent before.

# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / btrfs rw,relatime 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev tmpfs rw,relatime,size=10240k,mode=755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0
/dev/sda3 /boot ext3
rw,relatime,errors=continue,commit=5,barrier=0,data=writeback 0 0
/dev/sda4 /home btrfs rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc
rw,nosuid,nodev,noexec,relatime 0 0

# grep -v "^#" /etc/fstab
/dev/sda3       /boot           ext3    defaults        0       2
/dev/sda1       /               btrfs    defaults        0       1
/dev/sda6       none            swap    sw              0       0
/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sda4	/home 		btrfs	defaults	0	2

And here is the current entry I have in /boot/grub/grub.cfg:
menuentry 'Debian GNU/Linux, with Linux 2.6.35.4+' --class debian
--class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos3)'
	search --no-floppy --fs-uuid --set a5119f8f-c400-4374-8732-d934fd75eea2
	echo	'Loading Linux 2.6.35.4+ ...'
	linux	/vmlinuz-2.6.35.4+ root=/dev/sda1 ro acpi_sleep=s3_bios quiet
}

> Can you please show how your grub.cfg looks like, before manually
> altering it?

Beside the specific entry above that I had to edit manually, please find
attached the full grub.cfg. It works fine, the only problem is that I
can't get grub-mkconfig to generate it automatically.

> Finally did you do anything special when migrating your / to btrfs? Any
> config files you changed (for example something under
> `/etc/initramfs-tools' or `/etc/grub.d') or any scripts you hacked (for
> example some of the grub scripts), etc.?

Yes, I did something special. I have two partitions with /. /dev/sda5
and /dev/sda1. /dev/sda5 was in xfs and I decided to copy it entirely to
/dev/sda1 that was formatted in btrfs, and then to edit grub.cfg to boot
on that partition, the rest being unchanged. That worked but then I
couldn't get grub-mkconfig to work. Depending on which entry I chose at
the time of boot, I can boot on /dev/sda1 or /dev/sda5.
I didn't hack any of the grub scripts, I think I only added an entry in
grub.cfg. Didn't edit /etc/initramfs-tools/ or /etc/grub.d/.

Thanks a lot for your help

-- 
Nico
GPG FBFA4781
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: grub.cfg
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20100919/4478e973/attachment.asc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20100919/4478e973/attachment.pgp>


More information about the Pkg-grub-devel mailing list