grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: Richard Laager <rlaager@wiktel.com>
Cc: grub-devel@gnu.org, Zachary Bedell <pendorbound@gmail.com>
Subject: Re: [Patch] Robustly search for ZFS labels & uberblocks
Date: Sat, 28 Jan 2012 20:21:19 +0100	[thread overview]
Message-ID: <4F244AAF.5030908@gmail.com> (raw)
In-Reply-To: <1327775600.9477.174.camel@watermelon.coderich.net>

On 28.01.2012 19:33, Richard Laager wrote:
> On Sat, 2012-01-28 at 13:51 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
> wrote:
>>> Index: grub/util/grub.d/10_linux.in
>>> ===================================================================
>>> --- grub.orig/util/grub.d/10_linux.in	2012-01-24 23:44:10.530591000 -0600
>>> +++ grub/util/grub.d/10_linux.in	2012-01-24 23:44:10.706928000 -0600
>>> @@ -56,8 +56,10 @@
>>>      LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
>>>    fi
>>>
>>> -if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ] \
>>> -    || [ "x`stat -f --printf=%T /`" = xbtrfs ]; then
>>> +LINUX_ROOT_FS=`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`
>>> +LINUX_ROOT_STAT=`stat -f --printf=%T / || true`
>>> +
>>> +if [ "x${LINUX_ROOT_FS}" = xbtrfs -o "x${LINUX_ROOT_STAT}" = xbtrfs ]; then
>>>      rootsubvol="`make_system_path_relative_to_its_root /`"
>>>      rootsubvol="${rootsubvol#/}"
>>>      if [ "x${rootsubvol}" != x ]; then
>>> @@ -76,6 +78,10 @@
>>>        GRUB_CMDLINE_EXTRA="$GRUB_CMDLINE_EXTRA crashkernel=384M-2G:64M,2G-:128M"
>>>    fi
>>>
>>> +if [ "x${LINUX_ROOT_FS}" = xzfs ]; then
>>> +  GRUB_CMDLINE_LINUX="boot=zfs \$bootfs ${GRUB_CMDLINE_LINUX}"
>>> +fi
>>> +
>>>    linux_entry ()
>>>    {
>>>      os="$1"
>>> @@ -114,6 +120,12 @@
>>>        fi
>>>        printf '%s\n' "${prepare_boot_cache}"
>>>      fi
>>> +  if [ "x${LINUX_ROOT_FS}" = xzfs ]; then
>>> +    cat<<   EOF
>>> +	insmod zfsinfo
>>> +	zfs-bootfs (\$root) bootfs
>> This makes 3 wrong assumptions in a row:
>> - / and /boot may be different.
> Despite the variable being called LINUX_ROOT_FS, this is really the
> output from grub-probe --device ${GRUB_DEVICE}. When / != /boot, is
> $GRUB_DEVICE the device of / or /boot?
Yes. But "zfs-bootfs (\$root) bootfs" will fill "bootfs" with the info 
for /boot.
>> - Linux may be in a non-root subvolume. Then the subvolid points to
>> wrong one.
> By "Linux", you're talking about the kernel, as opposed to the root
> filesystem, correct?
Sorry, I used wrong term. I meant "OS root".
>
> What do you mean by "non-root subvolume"? That sounds like a btrfs term,
> not a ZFS term, so I don't follow.
I refuse to use ZFS terminology due to its term misuse for marketing 
reasons (calling subvolume a "filesystem" just to say "we handle 
N*1000000 filesystems on the server" is pure marketing).
In short my system may be in mypool/OS/Debian and not just mypool/
>
>> - / may be unaccessible to GRUB altogether.
> Are you talking about at grub-install time or boot time? Can you provide
> an example of when this might happen, so I can understand.
boot time. Easy: ZFS on LUKS with a separate /boot and GRUB LUKS support 
disabled (like the default).
>> In short: this command line part has to be generated on grub-mkconfig
>> time and have a stable representation. I'd recommend UUID and subvolume
>> name.
> By "this command line part", are you talking about the path to the
> kernel?
The part "fs=zfs $bootfs"
>


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



  reply	other threads:[~2012-01-28 19:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19 18:45 [Patch] Robustly search for ZFS labels & uberblocks Zachary Bedell
2011-09-28 21:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-19 11:36   ` Richard Laager
2012-01-22 14:18     ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-22 20:31       ` Richard Laager
2012-01-24  7:12       ` Richard Laager
2012-01-27 19:04       ` Zachary Bedell
2012-01-27 22:22         ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-28  2:50         ` Richard Laager
2012-01-28 12:51           ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-28 16:50             ` Richard Laager
2012-01-28 17:06               ` Darik Horn
2012-01-28 17:39                 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-28 18:33             ` Richard Laager
2012-01-28 19:21               ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2012-01-29 22:42               ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-31  8:45                 ` Richard Laager
2012-02-02 11:13                   ` Richard Laager
2012-02-03 10:02                     ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-03  9:52                   ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-03 11:20                     ` Richard Laager
2012-01-28 18:40             ` Darik Horn
2012-01-28 19:27               ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-01-30  1:22             ` Richard Laager
2012-01-30  1:43               ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-11-03 14:45 ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F244AAF.5030908@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    --cc=pendorbound@gmail.com \
    --cc=rlaager@wiktel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).