-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Btrfs2 #787
Btrfs2 #787
Conversation
…o two points; the handling of the addressing of subvolumes re. physical partitions, and the small changes at the bootloader level
…adrd drive management
This is one example of the partition part of disk_layouts.json of btrfs partition with subvolumes {
"btrfs": {
"subvolumes": {
"@":"/",
"@.snapshots": null,
"@home": "/home",
"@log": "/var/log",
"@pkgs": "/var/cache/pacman/pkg",
"@/home": "/home2",
"@/log": "/var/log2",
"@/pkgs": "/var/cache/pacman/pkg",
"root": null,
"home": null,
"sieso/total":null,
"/sieso/parcial":"/opt"
}
},
"encrypted": false,
"filesystem": {
"format": "btrfs"
},
"format": true,
"mountpoint": null,
"size": "100%",
"start": "518MiB",
"type": "primary"
} Special entriesThe first interesting entry is mountpointIt can contain either None (null) or a string representing a mount point in the target system . The second point of interest is the dictionary [btrfs][subvolumes]It is a series of entries subvolume name:mount point, where mount point can be null. As you can see, this last follows the usual UNIX filesystem notation. As subvolumes are materialized as directories, the subvolume name is also a directory name , but has some semantic twists:
What the current implementation is missing.We miss a place where to document btrfs and mount options for subvolumes. As probably is need to have backward compatibility we change the structure as: When to define a mount point and when not.Some tips. We have no plan to implement them as rules, for the time being.
[1] Actually, the current implementation does not behaves that way. It uses the content of the item. We feel it is an error as we prefer to have separted namespaces for subvolumes and the FSH |
A bit of a big change and I saw some things that looked strange (it looked like some |
I hope not. The biggest departure from master now is the script, which is a descendent from the original guided.py, prior to the TUI fication, |
Most of the changes in Partition.py and disk/helper.py are due to the same reason. For subvolumes the path the system exposes is /dev/partition[/subvolume]. I've created two new properties (device_path and bind_name) which separates its components and have changed all uses of Partition.path regarding lsblk and findmnt to Partititon.device_path (which for normal partitions would be equal to Partition.path). For the few cases outside a partition instance i've created a function which does the same (split_bind_path). |
I've added an hipercommented version of the manage_btrfs_subvolumes function as it is probably the most "hard" part of my processing.
The nodatacow option has an special treatment (it shouldn't be a mount option), and the rest of the options are functionally available. |
the conflict at partition solves by using device_path instead of path at helper is a bit simpler but needs the split_bind_ function
Now there are a couple of known conflicts with master. I have accepted the changes in master, using the new properties i defined in partition, and the patch for path (in complex situations) i have for the same situations when not inside a partition. |
This is exactly what I was asking for when the original Btrfs PR was merged. Great work! |
As for the default, it's probably best to go with what other major distros are doing. (source)
And make home optional with a separate prompt. Being able to fully configure this on the command line would be even more awesome. Maybe offer
Not sure how "custom" would work. Does archinstall have an option to custom configure regular partitions which could serve as inspiration? Otherwise gdisk/fdisk can serve as inspiration. |
@timakro Sadly it is still incomplete. The biggest missing piece (aside from UI) is the integration with encryption handling. |
We are now able to use an encrypted btrfs partition with subvolume mounts. |
Mentioning this here so it's seen before a decision is made on this - If you see my comment on the aforementioned issue, that is not the only layout used by major distros. Opensuse uses something different that is the only fully compatible layout for snapper, which is one of the two main btrfs snapshot programs / wrappers, the other obviously being timeshift. (I'd say snapper has more features out of the box. It's also CLI only, with a separate GUI for people to install if they want.) Long winded way of saying that Opensuse was the one that really mainstreamed btrfs when they made it the default for all installations. They have used it as a core component of their distro for a while, rather than having it as an optional feature (as Ubuntu, Manjaro, etc. do), meaning they probably have a better idea of it's limits and the best ways to configure it, and for that reason, I think their layout should be considered for being default as much as the other suggestion in that issue, whether as the only default, or as an option alongside the original suggestion. (Something else to look at is possibly adding an extra Y/N if the Opensuse layout is selected to also install and set up snapper and snap-pac with Sorry if this whole comment is out of line, or if this isn't the right place, I'm entirely new to the.. contributor? side of github, and I know there's usually some sort of etiquette with these kind of things. I'm happy to help test and answer any questions I can on what would have to be done for it to function correctly. I barely know any python, or I would do it myself. If I did managed to code something that worked, it would almost certainly be below the standards for being officially added. |
I'm running and debugging this now :) It's a major change so it's going to take me some time. And I get that BRFS layouts are something that are very different depending on who you talk to and where you look. But it's a good step towards supporting more complex and different designs. |
Tested and it seems to work. |
* All the changes needed to make btrfs subvolumes work. It boils down to two points; the handling of the addressing of subvolumes re. physical partitions, and the small changes at the bootloader level * We added a new script only_hd for testing purposes. It only handles hadrd drive management * restoring an escape hatch during subvolume processing * hipercommented manage_btrfs_subvolumes * Ready to be able to select and process options in subvolume mounting * Separte nodatacow processing * Solving a flake8 complain * Use of bind names @ get_filesystem_type * compress mount option bypass * Preparations for encryption handling * Compatibility to master version re. encrypted btrfs volumes * Now we can create subvolumes and mountpoints inside an encrypted btrfs partition * changes for entries file generation with systemd-bootctl * flake8 corrections plus some comments Co-authored-by: Anton Hvornum <anton@hvornum.se>
* Btrfs2 (#787) * All the changes needed to make btrfs subvolumes work. It boils down to two points; the handling of the addressing of subvolumes re. physical partitions, and the small changes at the bootloader level * We added a new script only_hd for testing purposes. It only handles hadrd drive management * restoring an escape hatch during subvolume processing * hipercommented manage_btrfs_subvolumes * Ready to be able to select and process options in subvolume mounting * Separte nodatacow processing * Solving a flake8 complain * Use of bind names @ get_filesystem_type * compress mount option bypass * Preparations for encryption handling * Compatibility to master version re. encrypted btrfs volumes * Now we can create subvolumes and mountpoints inside an encrypted btrfs partition * changes for entries file generation with systemd-bootctl * flake8 corrections plus some comments Co-authored-by: Anton Hvornum <anton@hvornum.se> * Fixed flake8 Co-authored-by: Werner Llácer <wllacer@gmail.com>
I'm glad to see it merged. There are still some open issues i'm working now, but they'll come next year |
Really appreciated! Heh, next year sounds so far away ^^ Happy new year btw! |
Contains all the changes to make btrfs subvolumes work correctly in archinstall (thus solving #718 and paving the way for things like #781 .
I hope you'all cant test it and get whatever is missing / wrong.
Things missing, because I need help in this areas
have only tested it in non encripted environments. I feel this path is still incompleteOnly tested with systemd-bootctl. For unexplained reasons I've been unable to boot wih Btrfs, Grub and loop files, together. The code for grub needs changes for sureI haven't still implemented code for handling btrfs mount options, although it is needed and has some twists. Real Soon Now(done)The faster way of testing would be to download my branch wllacer/archinstall/btrfs2 , and use the script only_hd, which only manages partition creation and mounting
Edit 20/12 Grub works without any manual intervention under VM. The problem seems to be with loop files and grub