View Single Post
  #7   (View Single Post)  
Old 10th January 2016
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

The following has been tested on an old OpenBSD machine:
Code:
# uname -a 
OpenBSD hercules.utp.xnet 5.2 GENERIC#9 amd64
So beware .
Code:
# ls -l /Template/var
total 92
drwxr-xr-x   2 root    wheel      512 Dec 21  2012 account
drwxrws---   2 root    wheel      512 Dec 21  2012 audit
drwxrwx---   2 root    authpf     512 Dec 21  2012 authpf
drwx------   2 root    wheel     6144 Jan 10 01:30 backups
drwxr-xr-x   3 root    wheel      512 Dec  4  2012 cache
drwxrwx---   2 root    wheel      512 Dec 26  2012 crash
dr-xr-xr-x   4 root    wheel      512 Jan 10 22:00 cron
drwxr-xr-x  10 root    wheel      512 Jan  9 03:30 db
drwxr-xr-x   3 root    wheel      512 Dec 21  2012 empty
drwxrwxr-x   5 root    games      512 Dec 26  2012 games
drwxr-xr-x   3 root    wheel     2048 Jan 10 22:00 log
drwxr-xr-x   2 root    wheel      512 Jan 10 01:30 mail
drwx------   8 _mysql  _mysql    2048 Aug 10 13:58 mysql
drwxr-xr-x   8 root    wheel      512 Dec 26  2012 named
drwxr-xr-x   6 root    wheel      512 Dec 21  2012 nsd
drwxr-x---   2 root    operator   512 Dec 21  2012 quotas
drwxr-xr-x   3 root    wheel      512 Jan 10 21:53 run
drwxr-xr-x   2 root    wheel      512 Dec 21  2012 rwho
drwxr-xr-x  11 root    wheel      512 Dec 31  2012 spool
drwxrwxrwt   3 root    wheel      512 Jan  9 03:30 tmp
drwxr-xr-x   2 root    wheel      512 Dec 21  2012 yp

# mount
/dev/wd0a on / type ffs (local, noatime, softdep)

# cat /etc/fstab
3a6d4322b09ba067.b none swap sw
3a6d4322b09ba067.a / ffs rw,noatime,softdep 1 1
swap               /monkey mfs rw,noatime,nosuid,noexec,-P=/Template/var,-s=120000

# mount
/dev/wd0a on / type ffs (local, noatime, softdep)

# swapctl -l
Device      512-blocks     Used    Avail Capacity  Priority
/dev/wd0b      4180991        0  4180991     0%    0

# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/wd0a     27.6G   15.0G   11.2G    57%    /

# mount -a
pax: /monkey/./cron/tabs/.sock skipped. Sockets cannot be copied or extracted
pax: /monkey/./empty/dev/log skipped. Sockets cannot be copied or extracted

# mount
/dev/wd0a on / type ffs (local, noatime, softdep)
mfs:5237 on /monkey type mfs (asynchronous, local, noatime, noexec, nosuid, size=120000 512-blocks)

# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/wd0a     27.6G   15.0G   11.2G    57%    /
mfs:5237      56.7M   38.1M   15.7M    71%    /monkey

# ls -l /monkey
total 56
drwxr-xr-x   2 root    wheel      512 Dec 21  2012 account
drwxrws---   2 root    wheel      512 Dec 21  2012 audit
drwxrwx---   2 root    authpf     512 Dec 21  2012 authpf
drwx------   2 root    wheel     6144 Jan 10 01:30 backups
drwxr-xr-x   3 root    wheel      512 Dec  4  2012 cache
drwxrwx---   2 root    wheel      512 Dec 26  2012 crash
dr-xr-xr-x   4 root    wheel      512 Jan 10 22:00 cron
drwxr-xr-x  10 root    wheel      512 Jan  9 03:30 db
drwxr-xr-x   3 root    wheel      512 Dec 21  2012 empty
drwxrwxr-x   5 root    games      512 Dec 26  2012 games
drwxr-xr-x   3 root    wheel     2048 Jan 10 22:00 log
drwxr-xr-x   2 root    wheel      512 Jan 10 01:30 mail
drwx------   8 _mysql  _mysql    2048 Aug 10 13:58 mysql
drwxr-xr-x   8 root    wheel      512 Dec 26  2012 named
drwxr-xr-x   6 root    wheel      512 Dec 21  2012 nsd
drwxr-x---   2 root    operator   512 Dec 21  2012 quotas
drwxr-xr-x   3 root    wheel      512 Jan 10 21:53 run
drwxr-xr-x   2 root    wheel      512 Dec 21  2012 rwho
drwxr-xr-x  11 root    wheel      512 Dec 31  2012 spool
drwxrwxrwt   3 root    wheel      512 Jan  9 03:30 tmp
drwxr-xr-x   2 root    wheel      512 Dec 21  2012 yp
You will notice that I deleted /Template/var/www but forgot to do that with /Template/var/mysql as well as to empty /Template/var/mail:
Code:
# ls -lh /Template/var/mail
total 6368
-rw-------  1 adriaan  adriaan   229K Dec 28  2014 adriaan
-rw-------  1 root     wheel     2.8M Jan 10 01:30 root
I am now going to do this on an Alix board with an recent OpenBSD version and will report my findings.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote