Venom1991 / refind-btrfs

Generate rEFInd manual boot stanzas from Btrfs snapshots
GNU General Public License v3.0
144 stars 8 forks source link

The 'subvol' mount option #28

Closed renyuneyun closed 2 years ago

renyuneyun commented 2 years ago

I'm encountering an error while trying to execute refind-btrfs. The complete output is:

Initializing the block devices using lsblk.
Initializing the physical partition table for device '/dev/nvme0n1' using lsblk.
Initializing the live partition table for device '/dev/nvme0n1' using findmnt.
Found the ESP mounted at '/efi' on '/dev/nvme0n1p1'.
Found the root partition on '/dev/nvme0n1p6'.
Found a separate boot partition on '/dev/nvme0n1p8'.
Searching for snapshots of the '@root-arch' subvolume in the '/.snapshots' directory.
Found subvolume '@root-arch' mounted as the root partition.
Found 28 snapshots of the '@root-arch' subvolume.
Searching for the 'refind.conf' file on '/dev/nvme0n1p1'.
Found 1 boot stanza matched with the root partition.
Initializing the static partition table for subvolume '@root-arch/.snapshots/4420/snapshot' from its fstab file.
ERROR (refind_btrfs.state_management.refind_btrfs_machine/refind_btrfs_machine.py/run): The 'subvol' mount option cannot be defined multiple times!

I'm new to refind-btrfs, so it's likely I did something wrong. I found https://github.com/Venom1991/refind-btrfs/issues/10#issuecomment-814084886. But the solution for him is hard to understand, and it seems to involve further manual work. Therefore, I would like to avoid that kind of manual work -- the reason for using refind-btrfs is to avoid manually modifying the configurations, isn't it?

I tried to manually remove everything related to subvol in fstab, including the comments. But executing refind-btrfs still gives the same error. It makes me hard to understand why.

Therefore, I would like to ask for a clarification of the cause of this, and (hopefully) the possible solutions.

System information

Venom1991 commented 2 years ago

If you've fixed the main fstab file (on your root subvolume) that itself won't automagically fix any of the fstab files belonging to snapshots which were created from the source subvolume before the manual fix.

You could check the contents of the @root-arch/.snapshots/4420/snapshot/etc/fstab file and see for yourself.

Any snapshot created after the manual fix should be fine. You don't have to remove every "subvol" option you find in it, there should be exactly one. Alternatively, you could use the "subvolid" option but that one isn't a popular choice because, well, strings are usually easier to remember than numbers.
I personally use a combination of "subvol" and "subvolid" (as shown in the readme) but either one should be fine on its own, I believe.

renyuneyun commented 2 years ago

Thanks for the explanation! That makes it a lot clearer!

Indeed, I used two subvols in the same line. That's why I started to remove one in the first place. But the persisted error even after removing everything made me confused.

Maybe it's worth explaining this (i.e. the two subvols are in the snapshot's fstab, not the current live root's fstab) in the error message?

Venom1991 commented 2 years ago

That'd be a pretty huge error message, imho far too long for logging purpose.

What I could do is add this piece of information to the readme file and hopefully someone who encounters this type of issue could figure it out and fix it.
Maybe even a section dedicated to common issues (such as this one, apparently) would be sufficient.

renyuneyun commented 2 years ago

Great! But the README is a bit too long IMO. Anyway, I agree having them there is better than currently.

Venom1991 commented 2 years ago

It is a bit too long as-is precisely because I wanted to explain everything that I could think of and yet it seems there's still stuff that could be added to it.
I dunno, maybe a wiki page is the next logical step or something like that? :smirk: