On 2026-09-17 16:52, Ingo Schwarze wrote:
Salut Sylvain,

Guten Abend Ingo,

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.

Yes, I know about this.

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.

OK, I didn't know about this.

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

Gotcha. My setup is already not perfect because the 16TB disk
is used/planned for different purposes :
srv$ ls -1 /mnt
bin # various scripts
bkup # tar backup (see https://got.saboua.xyz/?action=summary&path=bkup project) fam # sftp(8) server to be accessed by the family (would involve NextCloud over httpd(8))
git # git repositories served by gtod(8) and gotwebd(8)
mdia # media files, mostly music and videos (now accessible via sftp, would also involve NextCloud)
pvt # private files
trt # torrent files (hardlinked in mdia once completed)

Does it sound too lazy to just put it all into one partition because
I don't want to failingly attempt to figure out how much space each
needs and risk to end up with unused (wasted) space ? This is also the
kind of problem I run into everytime I have to allocate partitions in
the installer.

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.

OK. For now this server is not in production, only local.
I will give it more thought. Thanks for the observation.

If the machine is exclusively (or mostly) a web server,

Is is an all-purpose server ! Started out as webserver for
my self-hosting project, then for gotwebd(8); also a sftp
server to share my private music and movies/series collection
(only mostly used by me); a gotd(8) server; and for some time
I've been thinking to host a private server for the family
files and pictures, a cloud if you want.

Does that sound it goes against the OpenBSD way to do things ?

Now that you're telling me, I could go with this PC for private
media collection and family cloud (doesn't need to be accessed
publicly by everyone), and keep my present laptop-turned-server
for my self-hosted website and GoT. Backups could be sent to a
third machine on a remote location, as makes the most sense,
once I manage to get one.

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.

OK.

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.

I suppose that is the kind of 'scenario' I am using OpenBSD
against ...

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

Here we go.

Yours,
Cheers

--
Sylvain Saboua
looking for a PDP-11

Reply via email to