zfsonlinux / grub

GRUB enhancements for ZFS on Linux
16 stars 18 forks source link

Fixes for issue #1441 #1

Closed FransUrbo closed 10 years ago

FransUrbo commented 11 years ago

Commit fddc52e is dajhorns, and 2026859 is my addition.

To make it build on Debian GNU/Linux Squeeze, I added 690c44a - gcc v4.7 is just not necessary.

To make it work on my system, I added 8ccc6b2 which only takes ONE entry if 'grub-probe -t device /' returns multiple entries (as it does on my system which have a mirror root). This might not be the best/correct solution, but without it, I'll get a double entry in grub.cfg:

            [...]
            echo    'Loading Linux 3.9.0-rc6+tf.1 ...'
            linux   /ROOT/debian/boot/@/ROOT/debian/boot@/vmlinuz-3.9.0-rc6+tf.1 root=/dev/sda1
    /dev/sdb1 ro single nomodeset boot=zfs $bootfs 
    }

Yes, there's a newline after 'sda1'.

dajhorn commented 11 years ago

@FransUrbo, I pulled this into the snapshot branch and sent a trial build to ppa:zfs-native/staging.

According to the commit logs, the dependencies on particular compilers were added for multilib support.

FransUrbo commented 11 years ago

@dajhorn ok fair enough. I'll just keep that part private then.

arittner commented 11 years ago

Hi!

I'm playing around to run Ubuntu (raring) on ZFS root. But I stuck in many problems with Grub2.

My way to install a basic system are this tutorials: https://github.com/zfsonlinux/pkg-zfs/wiki/HOWTO-install-Ubuntu-to-a-Native-ZFS-Root-Filesystem http://blog.ls-al.com/booting-ubuntu-on-a-zfs-root-file-system/ and my own: http://www.aljoscha-rittner.de/blog/archive/2013/10/03/zfs-ubuntu-root-installation/ (german)

Only difference: I use Grub version 2.00-13ubuntu3+zfs3raring and a mirrored pool named datpool. Anything works fine. But if I boot the system, the grub2 loader runs into this error message:

couldn't find a valid label

After that I'm in a busy box shell.

Error message:

Command: zpool import -f -N rpool Message: cannot import 'rpool': no such pool available. Error: 1

Yes, my pool is "datpool"

After entering the import by hand:

zpool import -d /dev/disk/by-id -f -N datpool

and exit:

I get the next error:

cannot open 'rpool': no such pool Command: zpool list -H -o bootfs rpool Error: 1, unable to get the bootfs property

Manually mount...

It is possible to import the pool and mount the pool by hand (3*exit and I can login).

If I look into the environment with "set" I can't find the bootfs variable. I can find two a root and a ROOT variable, but nowhere rpool as value or bootfs as variable name.

It is not possible to set own varaibles.

Any try to set a variable like this:

set bootfs=datpool/ROOT/ubuntu-1

results in

_=rpool=datpool/ROOT/ubuntu-1

IMHO a bug in the Grub2 shell?

Manipulating the Ubuntu-Menu entry with "e" and replacing the $bootfs with my filesystem doesn't work (same errors)

My grub.cfg shows this line:

linux /ROOT/ubuntu-1@/boot/vmlinuz-3.8.0-19-generic root=ZFS=datpool/ROOT/ubuntu-1 ro boot=zfs $bootfs quiet splash $vt_handoff

IMHO this is a correct syntax (but I miss a / before the @ - could be ok).

dajhorn commented 11 years ago

linux /ROOT/ubuntu-1@/boot/vmlinuz-3.8.0-19-generic root=ZFS=datpool/ROOT/ubuntu-1 ro boot=zfs $bootfs quiet splash $vt_handoff

This parameter syntax is from the GRUB trunk, or at least a build release that happened after Ubuntu 13.04, so the ancillary packages for Raring don't recognize it.

My interest in releases after Ubuntu 12.04 LTS is low, but a contributed update for the current series would certainly be welcome. The logic should be moved from the boot= plugin to the main root= handler in /init.

arittner commented 11 years ago

This parameter syntax is from the GRUB trunk, or at least a build release that happened after Ubuntu 13.04, so the ancillary packages for Raring don't recognize it.

This is, what I get if I using ppa:zfs-native/stable and ppa:zfs-native/grub

apt-add-repository --yes ppa:zfs-native/stable
apt-add-repository --yes ppa:zfs-native/grub
apt-get update
apt-get install --no-install-recommends linux-image-generic linux-headers-generic
apt-get install ubuntu-zfs
apt-get install grub2-common grub-pc
apt-get install zfs-initramfs
apt-get dist-upgrade

Is there any workaround?

dajhorn commented 11 years ago

This parameter syntax is from the GRUB trunk, or at least a build release that happened after Ubuntu 13.04, so the ancillary packages for Raring don't recognize it.

This is, what I get if I using ppa:zfs-native/stable and ppa:zfs-native/grub

Okay, then this is a new bug assuming that the packages are not mismatched.

Is there any workaround?

Force the pool name and root dataset on the Linux command line in the /etc/default/grub file using the bootfs= and rpool= parameters according to the FAQ. Remember to run update-grub after editing the configuration file.

In the past week, a few other people have reported a new couldn't find a valid label error. Is this a fresh installation or an older computer that has been recently upgraded?

arittner commented 11 years ago

In the past week, a few other people have reported a new couldn't find a valid label error. Is this a fresh installation or an older computer that has been recently upgraded?

Absolute fresh installation. Three times with different drives, pool names, VM ;-)

Ok, I'll test it. Thank you.

arittner commented 11 years ago

@dajhorn Thank you, now the system boots from zfs root. Only the "couldn't find a valid label" is visible (and waits few seconds) but after that I can immediately login.

FransUrbo commented 10 years ago

The issue where hijacked somewhere in the middle, but the original issue have been resolved so closing this.