[Bug 1527727] Re: grub-probe for zfs assumes all devices prefix with /dev, ignoring /dev/disk/...

Hajo Möller 1527727 at bugs.launchpad.net
Fri Feb 5 18:18:21 UTC 2016


As the pool name is known we could run:
zdb -C poolname
to get the pool's configuration, which includes the path to all members of all (available) vdevs.

To get the configuration of a known, exported pool we could use:
zdb -C -e poolname
This will work as long as the pool is not imported and its devices can be found in /dev/.

Sample output follows:
root at sbooblehat:~/zfs# zdb -C sbooblehat-rpool

MOS Configuration:
        version: 5000
        name: 'sbooblehat-rpool'
        state: 0
        txg: 3550165
        pool_guid: 13767226917234919597
        errata: 0
        hostid: 2831164860
        hostname: 'sbooblehat'
        vdev_children: 1
        vdev_tree:
            type: 'root'
            id: 0
            guid: 13767226917234919597
            children[0]:
                type: 'disk'
                id: 0
                guid: 2058733885599967477
                path: '/dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21UNSAG310692M-part1'
                whole_disk: 1
                metaslab_array: 35
                metaslab_shift: 29
                ashift: 13
                asize: 90011336704
                is_log: 0
                DTL: 59
                create_txg: 4
        features_for_read:


root at sbooblehat:~/zfs# zdb -C -e sbooblehat-rpool
zdb: can't open 'sbooblehat-rpool': File exists


root at sbooblehat:~/zfs# zdb -C -e TEMP
zdb: can't open 'TEMP': No such file or directory


root at sbooblehat:~/zfs# zdb -C -e -p . TEMP

MOS Configuration:
        version: 5000
        name: 'TEMP'
        state: 1
        txg: 8
        pool_guid: 6410361307144069801
        errata: 0
        hostid: 2831164860
        hostname: 'sbooblehat'
        vdev_children: 1
        vdev_tree:
            type: 'root'
            id: 0
            guid: 6410361307144069801
            create_txg: 4
            children[0]:
                type: 'file'
                id: 0
                guid: 15915301152600074830
                path: '/root/zfs/A'
                metaslab_array: 34
                metaslab_shift: 24
                ashift: 9
                asize: 100139008
                is_log: 0
                create_txg: 4
        features_for_read:
            com.delphix:hole_birth
            com.delphix:embedded_data

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1527727

Title:
  grub-probe for zfs assumes all devices prefix with /dev, ignoring
  /dev/disk/...

Status in grub:
  Unknown
Status in grub2 package in Ubuntu:
  Confirmed

Bug description:
  update-grub runs /usr/sbin/grub-probe

  Without libzfslinux support compiled in, /usr/sbin/grub-probe runs
  ["zpool", "status", poolname] to find out ZFS info.

  zpool responds with device names as used at (I think!) pool creation
  time. Often, this is /dev/disk/by-id/... names, without the path.

  grub-probe then parses the output, and takes the names of devices, and
  if they do not start with a "/", it prepends "/dev/".

  It then tests the existence of the path name of the device. it fails.

  grub-probe then returns  something like

  /usr/sbin/grub-probe: error: failed to get canonical path of `/dev
  /ata-ST31000333AS_99999999-part1'.

  The actual path is of course /dev/disk/by-
  id/ST31000333AS_99999999-part1

  It can prepend smarter than "/dev" or it can understand ZFS natively,
  to fix the problem.

To manage notifications about this bug go to:
https://bugs.launchpad.net/grub/+bug/1527727/+subscriptions



More information about the foundations-bugs mailing list