0

I am working on a desktop running on Ubuntu 16.04. I want to isolate the directories /var, /etc, /opt in separate partitions. Creating new partitions is fine.

At this moment, the fstab only mounts copies (say, /media/var, /media/etc, /media/opt) on the newly created partitions, so as to interfere with the ordinary course of things minimally.

I am aware of this other post Recommended fstab settings and of the Ubuntu fstab summary which only provides general information.

At the point of editing the /ect/fstab file, I became aware of the importance of setting an appropriate mount option field (the fourth field, indicated as <options>).

The naive evidence is:

  • Choosing defaults as a mount option makes the rebooting of Ubuntu stall. After logging in, the greeter does not move on to the password request for the encrypted file system.
  • On the contrary, if I copycat the option nodev, nosuid from the option already set for /home (indeed residing on an own partition), I do manage to access my desktop manager as usual.

However, I don't want to presume that this will be the best option when the new partitions have the real /var, /etc, /opt directories mounted on. For the example, the mount options for the current / directory are errors=remount-ro. This option may well also be suitable also for any subdirectory moved out to an independent partition. I wish to avoid guesswork though.

The question is: what are the mount options for standalone /var, /etc and /opt such that the system performs like when they are subdirectories of /?

0

You can use the same mount options for standalone parts of the system such as /var, /opt, etc. Using defaults is not the cause of your problem.

Your description is not precise enough to identify what went wrong in one attempt and why the other attempt succeeded. However, there's one thing you mention that's doomed to failure: /etc belongs on the root partition. It contains /etc/fstab as well as the scripts that would trigger the mounting of the other partitions. You must leave /etc on the root filesystem.

Splitting off /var, /usr and /opt is generally not useful, but not harmful either. Splitting off some specific parts of /var can make sense, for example split off /var/mail on a mail server, split off /var/log on a server that has a lot of important logs, etc.

You can use nodev everywhere except /dev. A system partition should generally not have nosuid, but it can make sense for some parts of /var.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.