-
Notifications
You must be signed in to change notification settings - Fork 354
Discussion: Use overlay mounts instead of copying #1806
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
Comments
I'll take a look at any PRs but this problem is already solved by using a filesystem on the host that supports subvolumes or reflinks such as btrfs or xfs. |
Reflinks are great if the FS supports them and if everything is on the same file system. I should add to the docs that it's highly recommended to use XFS or btrfs to run mkosi on top of. |
We try to not leave the filesystem that mkosi is invoked from to make reflinks work as much as possible. A documentation update mentioning that COW filesystems are recommended would be much appreciated |
It's a bit of an aside, but how might |
Not possible unfortunately without mounting the filesystem which means root privileges. If we'd be OK with root I'd suggest to use sysupdate for this but since it requires root I don't think we want to support it. |
Actually I think after taking a look that setting Still working on the PR for this one. |
It will use that directory but that's the workspace which is emptied each run. systemd-repart cannot modify existing partitions it will always have to populate the partition from scratch. |
Of course. I was thinking that reflink based copying could be done but that doesn't really work once you start talking partitions. |
I don't see us implementing something like this. As explained in #1809, copies are always going to be required in mkosi's current architecture. We recommend running mkosi on a filesystem that supports reflinks (and optionally subvolumes) for fast image builds. |
There is a lot of copying going on in mkosi and a fair bit of it is fixed data that won't change. Rather than copy files around, why don't we use overlay mounts much more often. This would mean at least the following would become a part of a lower directory rather than a copy:
resue_cache()
)If this a bad idea then let's document the reason(s) why here. The reasons are:
If there's no major objection I'll clobber together a PR. If we just want to see where it leads to I can get a PR together for that as well.
The challenges are:
The text was updated successfully, but these errors were encountered: