Solaris Volume Manager Administration Guide

ProcedureHow to Share a Log Device Among File Systems

This procedure assumes that you have already set up a transactional volume with a log for another file system.

Steps
  1. Check Prerequisites for Creating Solaris Volume Manager Components and Background Information for Transactional Volumes.

  2. If possible, unmount the file system for which you want to enable logging.

  3. If you already have an existing log device, detach it from the transactional volume by using one of the following methods:

    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node, then choose the transactional volume from the listing. Right-click the volume, and choose Properties. For more information, see the online help.

    • Use the following form of the metadetach command:


      metadetach master-volume 
      

      See the metadetach(1M) man page for more information.

  4. Attach a log device to the transactional volume by using one of the following methods:

    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node, then choose the transactional volume from the listing. Right-click the volume, and choose Properties. For more information, see the online help.

    • Use the following form of the metattach command:


      metattach master-volume logging-volume 
      

      See the metattach(1M) man page for more information.

  5. Edit the /etc/vfstab file to modify (or add) the entry for the file system to reference the transactional volume.

  6. Remount the file system. If the file system cannot be unmounted, reboot the system to force your changes to take effect.


Example 19–10 Sharing a Logging Device


# umount /xyzfs
# metainit d64 -t c0t2d0s4 d10
d64: Trans is setup
(Edit the /etc/vfstab file so that the entry for /xyzfs references 
the transactional volume d64)
# mount /xyzfs
# metastat
...
d10: Logging device for d63 d64
...

This example shows the sharing of a log device (d10) defined as the log for a previous transactional volume, with a new transactional volume (d64). The file system to be set up as the master device is /xyzfs and is using slice /dev/dsk/c0t2d0s4. The metainit -t command specifies the configuration is a transactional volume. The /etc/vfstab file must be edited to change (or enter for the first time) the entry for the file system to reference the transactional volume. For example, the following line:


/dev/dsk/c0t2d0s4 /dev/rdsk/c0t2d0s4 /xyzfs ufs 2 yes -

should be changed to:


/dev/md/dsk/d64 /dev/md/rdsk/d64 /xyzfs ufs 2 yes -

The metastat command verifies that the log is being shared. Logging becomes effective for the file system when the system is rebooted.

Upon subsequent reboots, instead of checking the file system, the fsck command displays these messages for the two file systems:


/dev/md/rdsk/d63: is logging.
/dev/md/rdsk/d64: is logging.