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
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set 172faeaf-7bfc-47a6-a91d-670823328b72
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=1400x1050
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set a5119f8f-c400-4374-8732-d934fd75eea2
set locale_dir=($root)/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set a5119f8f-c400-4374-8732-d934fd75eea2
insmod png
if background_image /grub/1019wallpaper-15_1600.png ; then
  set color_normal=black/black
  set color_highlight=magenta/black
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.35.4+ sda1' --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
}
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/sda5 ro acpi_sleep=s3_bios quiet
}
menuentry 'Debian GNU/Linux, with Linux 2.6.35.4+ (recovery mode)' --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/sda5 ro single acpi_sleep=s3_bios
}
menuentry 'Debian GNU/Linux, with Linux 2.6.35.3+' --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.3+ ...'
        linux   /vmlinuz-2.6.35.3+ root=/dev/sda5 ro acpi_sleep=s3_bios quiet
}
menuentry 'Debian GNU/Linux, with Linux 2.6.35.3+ (recovery mode)' --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.3+ ...'
        linux   /vmlinuz-2.6.35.3+ root=/dev/sda5 ro single acpi_sleep=s3_bios
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to