From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: booting btrfs
Date: Fri, 20 Dec 2013 16:10:58 +0100 [thread overview]
Message-ID: <52B45E02.2060006@gmail.com> (raw)
In-Reply-To: <CAOx4COXRr1pSO0N9q7kxYRv1WToOxy09Q4z12Km8wKK3Oh-Dbg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4750 bytes --]
On 20.12.2013 15:54, Michael Chang wrote:
> 2013/12/20 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>> On 20.12.2013 10:46, Michael Chang wrote:
>>> 2013/12/20 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>>>> On 19.12.2013 17:13, Andrey Borzenkov wrote:
>>>>> В Mon, 28 Oct 2013 01:44:26 +0100
>>>>> Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
>>>>>
>>>>>> I changed in trunk to make / refer to real root and modified
>>>>>> grub-mkrelpath to follow the same convention, even if disk is mounted
>>>>>> with subvolid.
>>>>>>
>>>>>
>>>>> Can it cause compatibility issues? It means if config file that works
>>>>> for grub before this change will stop working after. So e.g. attempt to
>>>>> "configfile /file/from/partition/with/old/grub-mkconfig" will fail.
>>>>>
>>>> Normally I'd consider this a problem but the current behaviour is the
>>>> intended one, just back when the code was written thre were no changing
>>>> default yes
>>>>> May be subvolume support should use different syntax. Something like
>>>>>
>>>>> (hd0,1){sv=subvolume}/xxx
>>>>> (hd0,1){svid=NNN}/yyy
>>>>>
>>>> This would complicate the code a lot and commit us to maintaining it
>>>> long-term. Given that btrfs isn't clasified as stable, I consider this
>>>> behaviour change acceptable and it's better to handle this now rather
>>>> than perpetuating the issue.
>>>
>>> Please consider the case if a snapshot was taken against real root fs
>>> tree to a subvolume with SNAPSHOT_ID. With syntax above providing
>>> mount option support we can possibly boot that snapshot with this
>>> config.
>>>
>>> set root=(hd0,1){svid=<SNAPSHOT_ID>}
>>> set prefix=($root)/boot/grub2
>>> normal
>>>
>>> Without the syntax support it's almost impossible to do that. At lease
>>> I can't figure out any.
>>>
>> Every volume has a name, even if you don't know it. Use grub-mkrelpath
>> to find out.
>
> That means we need to modify the grub,cfg in snapshot to make files
> used by config refer to new path output by grub-mkrelpath (relative to
> real root), right ? That could be difficult to manage especially if
> you have a lot of snapshots and the update takes time to finish.
>
> Compare to use path relative to snapshot's fs root, we can leave the
> grub.cfg in snapshot unmodified and by setting snapshot id or name in
> a master config to switch the snapshot we want to boot. That will make
> things a lot easier.
>
This is not a reason to force part of path name to become part of device
name. Also it leaves problem of passing right options to kernel to mount
right root open.
Because generated config in snapshot will reset $root, any attempt to
alter its behaviour by setting $root will fail anyway.
Sounds like this needs additional complications in generated grub.cfg
when on btrfs (E.g. overrideable $subvolume variable) and attempts to
change device naming schemes don't really solve any of problems but
create bunch of new ones.
The real solution for your problem has to involve sth like:
if [ x$bootdir = x ]; then
bootdir=<precomputed bootdir>
fi
if [ x$rootdir = x ]; then
rootdir=<precomputed rootdir>
fi
...
search ....
linux $bootdir/vmlinuz-.... root=.. subvol=$rootdir
initrd $bootdir/initrd.img
> Probably a case is in os-prober, we can use that feature to have
> grub-mount test subvolumes without resorting to linux mount. But I
> admit that the gain is little.
>
Why isn't the use of subvolume name appropriate?
One of these days, just for the people who insist un numeric ids rather
than names I should write a patch to Linux which ones files only by
inode id and no file name.
> Regards,
> Michael
>
>>> Thanks,
>>> Michael
>>>
>>>>> And continue to interpret old syntax as relative to default.
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Grub-devel mailing list
>>>>> Grub-devel@gnu.org
>>>>> https://lists.gnu.org/mailman/listinfo/grub-devel
>>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Grub-devel mailing list
>>>> Grub-devel@gnu.org
>>>> https://lists.gnu.org/mailman/listinfo/grub-devel
>>>>
>>>
>>> _______________________________________________
>>> Grub-devel mailing list
>>> Grub-devel@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/grub-devel
>>>
>>
>>
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel
>>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]
next prev parent reply other threads:[~2013-12-20 15:11 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-13 18:04 booting btrfs Chris Murphy
2013-10-13 19:47 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-13 20:59 ` Chris Murphy
2013-10-13 23:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-13 23:58 ` Chris Murphy
2013-10-14 5:28 ` Andrey Borzenkov
2013-10-14 18:39 ` Chris Murphy
2013-10-14 19:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-14 20:20 ` Chris Murphy
2013-10-16 2:50 ` Andrey Borzenkov
2013-10-16 3:37 ` Chris Murphy
2013-10-28 0:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-19 16:13 ` Andrey Borzenkov
2013-12-19 18:14 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-20 3:24 ` Chris Murphy
2013-12-20 9:46 ` Michael Chang
2013-12-20 12:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-20 14:54 ` Michael Chang
2013-12-20 15:10 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2013-12-24 2:26 ` Michael Chang
2013-12-21 4:38 ` Chris Murphy
2013-12-21 7:18 ` Andrey Borzenkov
2013-12-23 4:45 ` Chris Murphy
2013-12-23 4:52 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-23 5:32 ` Chris Murphy
2013-12-24 3:16 ` Chris Murphy
2013-12-24 2:29 ` Michael Chang
2013-12-24 2:26 ` Michael Chang
2013-12-24 3:43 ` Chris Murphy
2013-12-24 3:46 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-24 3:57 ` Chris Murphy
2013-12-24 4:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-24 6:12 ` Chris Murphy
2013-12-24 6:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-24 7:28 ` Michael Chang
2013-12-24 7:46 ` Andrey Borzenkov
2013-12-31 4:10 ` Michael Chang
2014-01-10 18:23 ` Andrey Borzenkov
2014-01-13 5:05 ` Michael Chang
2014-01-13 5:34 ` Andrey Borzenkov
2014-01-13 9:12 ` Michael Chang
2014-01-13 13:08 ` Andrey Borzenkov
2014-01-14 4:16 ` Michael Chang
2014-01-21 8:09 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-01-21 9:08 ` Michael Chang
2013-12-30 10:18 ` Michael Chang
2013-12-30 11:28 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-30 11:52 ` Andrey Borzenkov
2013-12-31 7:50 ` Michael Chang
2013-12-31 21:20 ` Chris Murphy
2014-01-02 5:17 ` Michael Chang
2014-01-07 17:55 ` Chris Murphy
2014-01-08 20:57 ` Chris Murphy
2014-01-09 10:03 ` Michael Chang
2014-01-09 19:29 ` Chris Murphy
2014-01-13 5:13 ` Michael Chang
2014-01-13 5:53 ` Chris Murphy
2013-12-31 4:02 ` Michael Chang
2013-10-14 20:45 ` Chris Murphy
2013-10-14 20:50 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-15 2:33 ` Andrey Borzenkov
2013-10-15 3:12 ` Chris Murphy
2013-10-15 16:58 ` Andrey Borzenkov
2013-10-15 19:47 ` Chris Murphy
2013-10-15 20:02 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-15 20:27 ` Chris Murphy
2013-10-16 2:45 ` Andrey Borzenkov
2013-10-16 3:30 ` Chris Murphy
2013-10-15 21:55 ` Chris Murphy
2013-10-14 21:01 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-14 23:09 ` Chris Murphy
2013-10-14 23:44 ` Chris Murphy
2013-10-15 2:44 ` Andrey Borzenkov
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=52B45E02.2060006@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/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).