Salut Sylvain,

Sylvain Saboua wrote on Thu, Sep 17, 2026 at 02:10:11PM +0200:

> On my server I allocated 230GB on the SSD for
> the /var/www fstab directory.
> But most of my relevant data files will be on a
> single 16TB HDD partition mounted on the /mnt
> directory.

That sounds like a terrible idea.
Read the hier(7) manual page:

  /mnt/  Empty directory commonly used by system administrators as a
         temporary mount point.

So it seems likely that sooner or later, your data partition will
get stomped on by an admin trying to use the mount point for the
intended purpose, or even worse, by some system process using /mnt/
in a non-interactive manner.  For example, the installer uses /mnt/ -
though in that case, your private /mnt/ might possibly show up
as /mnt/mnt/, but i'm not convinced you are safe.  There might
also be other things beside the installer stomping on it.

If you need a completely private mount point, make it a habit
to not use any of the paths listed in hier(7).

> Say I wish to use nextcloud or otherwise make a
> web server mirror of my sftp server: is there a
> straightforward way to serve files located on
> the /mnt partition ?
> 
> I suppose that I am not the only one with such
> a use case. Has this been though about in
> designing httpd(8) ? Is the current situation a
> deliberate limitation or a temporary caveat ?

When putting a server on the Internet.  Designing the partition layout
properly is really a task to be taken care of up front; you will
hardly achieve a secure setup if you leave the partition layout
to an afterthought.

If the machine is exclusively (or mostly) a web server,
making one or more of the directories in /var/www dedicated
partitions might be warranted - for example, if the server
is serving massive amounts of manual pages via man.cgi(8),
separating /var/www/man/ out might make sense - for other
web services, other directories might be relevant.
In any case, /var/www/logs/ is prone to filling up,
so having it on the same partition as /var/log/ may be a good
or a bad idea, depending on how valuable in your particular case
the web logs are compared to the system logs (often, the
web logs might be much less valuable).  Inside /var/www/,
tmp directories might also be of concern: bad things can
happen when remote users find a way to fill them up.

If you end up doing some trickery, involving NFS or other tools
(i'm not sure that's particularly wise because complexity tends
to breed bugs), make sure unrelated data you have in /mnt/
does not end up in the webserver chroot, unless you want that
data stolen by remote attackers.

Either way, design such stuff, don't wing it.

Yours,
  Ingo

Reply via email to