View Single Post
  #3   (View Single Post)  
Old 15th February 2010
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,977
Default

It has been quite a while since FreeBSD went from wd to ad for hard disks. FreeBSD also not supports the mount option 'softdep'. You have to choose to either use 'soft updates' or not when you do a newfs of the label/partition.

Considering this it is somewhat OpenBSD specific

As consolation, a FreeBSD version with adds the "noatime" mount option.

First the FreeBSD fstab:
Code:
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad0s3b             none            swap    sw              0       0
/dev/ad0s3a             /               ufs     rw              1       1
/dev/ad0s3e             /tmp            ufs     rw              2       2
/dev/ad0s3f             /usr            ufs     rw              2       2
/dev/ad0s3d             /var            ufs     rw              2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0
The script:
Code:
# ---------------------------------------------------------
FILE=/etc/fstab
FILE=$( basename ${FILE} )
ORIG=${FILE}.orig

LABELS=adef
OPTIONS='noatime'       # no trailing "," after last option !
DISK=ad
NR=0
SLICE=s3

cat <<END
Enabling mount option(s) "${OPTIONS}" on disk ${DISK}${NR}${SLICE} for label(s): "${LABELS}"
END

cp -p ${FILE} ${ORIG} 
sed -e "/${DISK}${NR}${SLICE}[${LABELS}]/  s/rw/rw,${OPTIONS}/" ${ORIG} >${FILE}
The sed(1) line with all the variables expanded:

Code:
 sed -e /ad0s3[adef]/  s/rw/rw,noatime/ fstab.orig >fstab
The result:
Code:
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad0s3b             none            swap    sw              0       0
/dev/ad0s3a             /               ufs     rw,noatime              1       1
/dev/ad0s3e             /tmp            ufs     rw,noatime              2       2
/dev/ad0s3f             /usr            ufs     rw,noatime              2       2
/dev/ad0s3d             /var            ufs     rw,noatime              2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0
__________________
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