All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: booting btrfs
Date: Tue, 24 Dec 2013 07:25:20 +0100	[thread overview]
Message-ID: <52B928D0.5060405@gmail.com> (raw)
In-Reply-To: <089F5D53-DF80-44BD-A163-2FB5D489C969@colorremedies.com>

[-- Attachment #1: Type: text/plain, Size: 4849 bytes --]

On 24.12.2013 07:12, Chris Murphy wrote:
> 
> On Dec 23, 2013, at 9:20 PM, Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> wrote:
> 
>> On 24.12.2013 04:43, Chris Murphy wrote:
>>> d point. Your snapshot tool could first create a read only snapshot, then for no space
>>> cost also create a rw snapshot of the read only one, then add the rw snapshot to the grub.cfg.
>>> The tool could give the user the option to always "revert" the changes caused by booting a snapshot
>>> - this would cause the rw snapshot being deleted and a new rw snapshot created from the read only one.
>> I don't like the idea of constantly modifying grub.cfg.
> 
> OK. But in any case, is it valid that we want grub-mkconfig to still be able to produce complete and valid grub.cfgs? We don't want it to revert to a snapshot incapable grub.cfg. If the grub.cfg is corrupt or accidentally deleted, or /boot must be restored, we'd probably want grub-mkconfig to produce a fully correct and capable grub.cfg, yes?
> 
you can use source_extract / configfile_extract to take only entries.
>> Points to consider:
>> - core of GRUB be it in embedding area or efi executable isn't snapshottable
>> - core and modules version have to match.
>> - translations should match originating strings.
>> Three together imply that snapshotting $prefix/$cpu-$platform is useless
>> if not outright harmful. modules should reside either in .efi
>> (mkstandalone way) or in a separate volume, never to be snapshotted.
>> The path to this volume would be baked in core, so default volume
>> changes won't create core/module mismatch.
> 
> Yeah I agree. There's a possible work around if someone can think of why /boot should be snapshotable:
Did I mention /boot at all? I spoke only about stuff under $prefix.
> /boot is a subvolume and /boot/grub is also a subvolume;

> if a snapshot is made of /boot it will not contain /boot/grub at all (the creation of a snapshot does not

> recursively create snapshots of subvolumes within a subvolume). So in effect if /boot/grub is a subvolume

> that will make it immune to being dragged along in a snapshot unintentionally. *shrug* But I'm

> still not imagining a significant advantage to snapshotting /boot.
>
/boot has to be snapshotted together with / to ensure coherency between
kernel, modules and userland. Only $prefix needs exclusion with grub.cfg
requiring special handling.

> 
>> The configuration of master GRUB could have a list of all
>> snapshots/distros/w/e (alternatively they could be listed at runtime)
>> and source a grub.cfg from this snapshot (either directly or after user
>> has chosen the submenu) setting some variable to indicate the path to
>> snapshot. This slave grub.cfg would contain only entries.
>>
>> Configuration like themes and timeouts would be set on master level.
>> In case of submenu it's possible to change resolution/theme/font and so
>> on but it seems like only waste of time.
>>
>> Init scripts will take care of creating rw clone of snapshot if necessarry.
> 
> The user space tool that manages these snapshots, and whatever modifications
> need to be made to make them bootable,
You need special init handling as you need ability to revert several
times to a given snapshot every time branching to a new series.
> should be able to give grub whatever
> it needs to boot these snapshots. If it's possible that grub, via a module or
> grub.cfg, can dynamically adjust the menu to show available snapshots to boot
> from, without constantly modifying grub.cfg, I think that sounds much more stable.
>
insmod regexp
for x in /debian/*; do
  if [ -f $x/boot/grub/grub.cfg ]; then
    submenu "Debian (snapshot at $x)" "$x" {
      configfile_extract $1/boot/grub/grub.cfg
    }
done

> 
>>
>> In this scenario you don't care what the default volume is, and that's
>> the way it should be as single btrfs may contain several distributions
>> but only one can own the default.
> 
> Yes, I'm strongly leaning toward the user alone should own the default
> subvolume. Consider that the user can still change the default subvolume,
> and this can't be taken away from them. If a distro uses it, and successful
> boot depends on the correct subvolume being set as default, the user can
> inadvertently break boot by changing the set-default. It doesn't sound OK
> to put the user in that situation.
>
I don't see any usefullness in default subvolume for fstab-ed disks.
Every fstab entry should contain explicit subvolume name, possibly
derived from boot parameters. Default subvolume is mainly interesting
for removable media.

> 
> Chris Murphy
> _______________________________________________
> 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 --]

  reply	other threads:[~2013-12-24  6:25 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
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 [this message]
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=52B928D0.5060405@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.