-
Notifications
You must be signed in to change notification settings - Fork 115
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
support for mounting additional devices (as /perm, or separately) #236
Comments
I would also use this, definitely with a stable identifier and probably mounting to an otherwise read-only mount point, so that if mounting fails data is not written anyway somewhere it doesn't belong. I assume the mounts would happen before applications are started, but what if the filesystem needs checking, which can take a long time? Maybe there should be Alternatively, if there was a way to specify a dependency order between applications, this could just be an application configured with an ExtraFile, which the applications that need disks wait for. |
That’s a good point. We should probably introduce a
Generally, applications have to declare what they are waiting for, gokrazy doesn’t sequence dependencies or delay application startup. In the early days of gokrazy, this was only possible by modifying the source to call e.g. I like your suggestion of In #235 (comment), @thirdeyenick links to the start of an implementation. I’m not sure if we need the diskfs dependency, as gokrazy already has its own code to deal with partition tables that might be good to extend for this purpose (to avoid any dependencies we don’t absolutely need). But aside from that detail, it looks like a good start :) |
Alright, I implemented a first version of this feature (see the attached commits). Here’s what I included in my instance configuration: "MountDevices": [
{
"Source": "PARTUUID=c995c848-1d29-4f08-a34d-cd811e84a763",
"Type": "ext4",
"Target": "/mnt/logs",
"Options": ""
}
]
This is what my Raspberry Pi printed on the serial console on boot (note how the first mount attempt failed before the USB memory stick was enumerated, but gokrazy keeps trying):
Let me know if you have any feedback / if it works for you! Next steps:
|
There has been some interest in mounting external disks as
/perm
(permanent data partition) or on arbitrary mountpoints:I’m not opposed to adding support for mounting disks, but we need to carefully think through which features we want to support and in which way.
For example, we don’t use udev, so we don’t have stable symlinks to the device nodes in
/dev
. Especially once you have more than one external disk, the order is not necessarily stable on boot, so I think it will be vital to have some sort of stable identifier to use. See also https://michael.stapelberg.ch/posts/2020-01-21-initramfs-from-scratch-golang/#3-block-device-identificationHere’s a strawman proposal for how the configuration could look like:
(And aside from
Device
, one or more ways to specify a stable identifier should be supported.)The text was updated successfully, but these errors were encountered: