bootc icon indicating copy to clipboard operation
bootc copied to clipboard

to-filesystem: support pre-created `/var` and other mount points

Open cgwalters opened this issue 7 months ago • 3 comments

We should supporting adding e.g. a separate partition for /var at install to-filesystem time.

cgwalters avatar Sep 16 '25 14:09 cgwalters

How do you envision this one looking? Something like bootc install reads from the existing /etc/fstab file and copies compatible mounts into the new filesystem deployments /etc/fstab

Or are you imaging a cli interface for users to provide arbitrary (but supportable) mounts?

bshephar avatar Sep 17 '25 11:09 bshephar

Nope, can't be existing /etc/fstab: https://github.com/bootc-dev/bootc/blob/main/docs/src/man/bootc-install-to-filesystem.8.md?plain=1#L16-L17

I think I'm mistaking to-filesystem with to-existing-root

bshephar avatar Sep 17 '25 12:09 bshephar

How do you envision this one looking? Something like bootc install reads from the existing /etc/fstab file and copies compatible mounts into the new filesystem deployments /etc/fstab

A crucial thing here to understand is that effectively, we can only support install-time mounting for /var or subdirectories of it.

Or to say it another way, we cannot (easily) split the operating system content (immutable image) across multiple physical filesystems, so if e.g. /opt is a mount point, it must be empty.

So really I think this probably boils down to adding bootc install to-filesystem --var-mount=/path/to/mountpoint,/ to make all of /var an external fs, or just e.g. --var-mount=/path/to/mountpoint,/lib/containers to have just e.g. /var/lib/containers be a distinct FS.

Now obviously the target OS needs to mount that on subsequent boots as well, which it could do in many ways (.mount units, /etc/fstab being the most obvious). For to-filesystem it's clearly the responsibility of the thing doing the install to set that up. For to-disk...this relates to https://github.com/bootc-dev/bootc/issues/448

cgwalters avatar Sep 17 '25 22:09 cgwalters