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

Bug#1018894: rescue-mode: mounts wrong btrfs subvolume



On Sat, 2022-09-03 at 21:06 -0400, Nicholas D Steeves wrote:
> First, the automated case: Currently DI statically sets the rootfs to be
> "subvolume=@rootfs", which is a value unique to Debian.  The simple
> thing to do is to detect that a device has been formatted to btrfs
> before mounting, and then try to mount "-o subvol=@rootfs" as Ansgar
> suggested.  One step more flexible is to have a Rescue policy of
> something like only supporting read-write subvolumes with a name that
> matches '.*\@rootfs.*', and that exist in the / of the volume.  Ie:
> maxdepth=1.

Why not set the default subvolume to @rootfs then? (What `btrfs
subvolume set-default` does.)

That would also be useful for use with `systemd-gpt-auto-generator`.

It would not help with existing systems using @rootfs, but be
compatible with installations not using that.

>   awk '{print $1}' < /MOUNTPOINT/etc/issue
>   or perhaps
>   grep 'ID\=debian' < /etc/os-release

It should also test for `/usr/lib/os-release` in case the symlink in
`/etc/` is not present.


Ansgar


Reply to: