As far as I know, to mount something at boot you need to edit fstab.
I need to add / remove disks from fstab automatically (this is a script, not me personally). This script identifies disks by their UUID. Is there an utility to do this ?
As for the interests: editing fstab by using a text editor is just for manual changes. Doing it in a script requires to write a parser for the format ; maybe someone already took the time to write it ? Also such an utility would be able to prevent some errors by checking for them for example...
sed
,awk
or justbash
.fstab
has many options. In such a case, there is not much to win to script it, since the command to run the script would equally require the option to set many options. You could however easily automate adding entries tofstab
(since you can easily make a script to do anything when a new mount or anything occurs), but you would still need to set the options in advance.echo ... >> /etc/fstab
is not sufficient as we should also check the mount is not already added (and other verifications). What's more, removing a mount is not straightforward. That's why a cli would be hugely beneficial... I can hardcode some of the mount options in the script (ex UUID or filesystem).