[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Pkg-zfsonlinux-devel] zfsutils-linux: /usr/sbin/grub-probe: error: unknown filesystem



So a plain zpool status (with no -P) shows these, right? Without -part1?

ata-SanDisk_SDSSDH120GG25_113334300609
ata-OCZ-VERTEX2_f24230012

In that case, you have a "wholedisk" pool, which you created with:
zpool create rpool mirror \
    ata-SanDisk_SDSSDH120GG25_113334300609 \
    ata-OCZ-VERTEX2_f24230012

I used to recommend this, as "wholedisk" is the native way ZFS likes to
do pools, but I gave up on it because of this and other issues. (Even
Solaris didn't use wholedisk for root pools.)

The problem is that GRUB2, on Linux, parses the output of `zpool
status`, and it returns the disk name, not the partition name. See this
bug (in Ubuntu):
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1527727

The best fix is to get grub to set ZPOOL_VDEV_NAME_PATH=YES (which is
equivalent to passing -P to zpool status), as in
debian/patches/zpool_full_device_name.patch in Ubuntu's grub2. I've
attached it, and maybe someone can get that included in Debian.

A work-around until then is to create symlinks for the by-id *disk*
names directly in /dev, but pointing to the *partition*. One or both of
these udev rules should do the trick:

KERNEL=="sd*[0-9]", IMPORT{parent}=="ID_*",
ENV{ID_PART_ENTRY_SCHEME}=="gpt",
ENV{ID_PART_ENTRY_TYPE}=="6a898cc3-1dd2-11b2-99a6-080020736631",
SYMLINK+="$env{ID_BUS}-$env{ID_SERIAL}"

KERNEL=="sd*[0-9]", IMPORT{parent}=="ID_*",
ENV{ID_FS_TYPE}=="zfs_member", ENV{ID_FS_USAGE}=="raid",
SYMLINK+="$env{ID_BUS}-$env{ID_SERIAL}"

If it's working correctly, you should have a
/dev/ata-SanDisk_SDSSDH120GG25_113334300609 symlink that points to
/dev/sdx1 where x is some value. Again, note closely that this is a
disk-name (no -part1) pointing to a partition (sdx1).

-- 
Richard
Description: zfs-initramfs currently provides extraneous, undesired symlinks to
  devices directly underneath /dev/ to satisfy zpool's historical output of
  unqualified device names. By including this environment variable to signal
  our intent to zpool, zfs-linux packages can drop the symlink behavior when
  updating to its upstream or backported output behavior.
Author: Chad MILLER <chad.miller@canonical.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1527727
Bug: https://savannah.gnu.org/bugs/?43653

--- a/grub-core/osdep/unix/getroot.c
+++ b/grub-core/osdep/unix/getroot.c
@@ -243,6 +243,7 @@ grub_util_find_root_devices_from_poolnam
   argv[2] = poolname;
   argv[3] = NULL;
 
+  setenv("ZPOOL_VDEV_NAME_PATH", "YES", 1);
   pid = grub_util_exec_pipe (argv, &fd);
   if (!pid)
     return NULL;

Reply to: