Solaris: Mount filesystem with UFS logging enabled

Contributor Icon Contributed by qmchenry  
Tag Icon Tagged: Solaris system administration  

When UFS logging is enabled, UFS write operations are broken into transactions which are stored to a log before being committed to the filesystem. The use of UFS logging maintains filesystem consistency and prevents the need to run fsck against the filesystem. This can significantly reduce the time required to reboot a system.


UFS logging requires minimal system resources, using about 1 MB per GB of filesystem although it can grow to no more than 64 MB/GB. UFS logging is disabled by default.

To enable UFS logging, alter the filesystem’s entry in /etc/vfstab to include the ‘logging’ option, such as:

/dev/dsk/c0t0d0s1 /dev/rdsk/c0t0d0s1 / ufs 1 yes logging

This will enable UFS logging on the root filesystem after the next system boot. To mount a filesystem from the command line with logging on, use the mount command:

mount -F ufs -o logging /dev/dsk/c0t0d0s3 /mnt

To remount a currently mounted filesystem and enable logging, use the remount option:

mount -F ufs -o remount,logging /var

 

1 Comment -


  1. Cesare said on March 3, 2009

    Hy,

    the same configuration can be applied on LVM slice (DiskSuite), also in mirroring configuration.

    Also, it’s better to flush the cache used by the logging configuration running the “lockfs (1M)”. The option “-f” forces a synchronous flush of the named filesystem. It returns when all data has been written to disk and the log has been rolled.

    Using your example:

    /usr/sbin/lockfs -f /dev/dsk/c0t0d0s3

    Better if insert the command in the crontab for flush log in a specified time every day.

    Cesare

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -