Disable access time (atime) recording on ZFS

If you have a filesystem that contains data which is accessed often, but you do not want to record the access time information because it is static data (e.g. content for a webserver) you can change this in zfs properties.

You can see the full list of zfs properties

root@sc5acn02-d2:/var/fmw# zfs get all logpool/fmw_app
NAME             PROPERTY              VALUE                  SOURCE
logpool/fmw_app  aclinherit            restricted             default
logpool/fmw_app  aclmode               discard                default
logpool/fmw_app  atime                 on                     default
logpool/fmw_app  available             1.57T                  -
logpool/fmw_app  canmount              on                     default
logpool/fmw_app  casesensitivity       mixed                  -
logpool/fmw_app  checksum              on                     default
logpool/fmw_app  compression           off                    default
logpool/fmw_app  compressratio         1.00x                  -
logpool/fmw_app  copies                1                      default
logpool/fmw_app  creation              Wed Jun  4 15:47 2014  -
logpool/fmw_app  dedup                 off                    default
logpool/fmw_app  devices               on                     default
logpool/fmw_app  encryption            off                    -
logpool/fmw_app  exec                  on                     default
logpool/fmw_app  keychangedate         -                      default
logpool/fmw_app  keysource             none                   default
logpool/fmw_app  keystatus             none                   -
logpool/fmw_app  logbias               latency                default
logpool/fmw_app  mlslabel              none                   -
logpool/fmw_app  mounted               yes                    -
logpool/fmw_app  mountpoint            /logpool/fmw_app       default
logpool/fmw_app  multilevel            off                    -
logpool/fmw_app  nbmand                off                    default
logpool/fmw_app  normalization         none                   -
logpool/fmw_app  primarycache          all                    default
logpool/fmw_app  quota                 none                   default
logpool/fmw_app  readonly              off                    default
logpool/fmw_app  recordsize            128K                   default
logpool/fmw_app  referenced            30.1G                  -
logpool/fmw_app  refquota              none                   default
logpool/fmw_app  refreservation        none                   default
logpool/fmw_app  rekeydate             -                      default
logpool/fmw_app  reservation           none                   default
logpool/fmw_app  rstchown              on                     default
logpool/fmw_app  secondarycache        all                    default
logpool/fmw_app  setuid                on                     default
logpool/fmw_app  shadow                none                   -
logpool/fmw_app  share.*               ...                    default
logpool/fmw_app  snapdir               hidden                 default
logpool/fmw_app  sync                  standard               default
logpool/fmw_app  type                  filesystem             -
logpool/fmw_app  used                  30.1G                  -
logpool/fmw_app  usedbychildren        0                      -
logpool/fmw_app  usedbydataset         30.1G                  -
logpool/fmw_app  usedbyrefreservation  0                      -
logpool/fmw_app  usedbysnapshots       0                      -
logpool/fmw_app  utf8only              off                    -
logpool/fmw_app  version               6                      -
logpool/fmw_app  vscan                 off                    default
logpool/fmw_app  xattr                 on                     default
logpool/fmw_app  zoned                 off                    default

You can use the set to command to change the property.

root@sc5acn02-d2:/var/fmw# zfs set atime=off logpool/fmw_app

You do not need to remount the filesystem, the change is applied instantly

root@sc5acn01-d2:/var/bea# mount
[snipped output]
/var/fmw/app on logpool/fmw_app read/write/setuid/devices/rstchown/nonbmand/exec/xattr/noatime/dev=47d0012 on Wed Jun  4 16:19:57 2014
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s