Solaris Volume Manager Administration Guide

Creating Transactional Volumes


Note –

Transactional volumes are scheduled to be removed from the Solaris operating environment in an upcoming Solaris release. UFS logging, available since the Solaris 8 release, provides the same capabilities but superior performance, as well as lower system administration requirements and overhead. These benefits provide a clear choice for optimal performance and capabilities.



Caution – Caution –

Solaris Volume Manager transactional volumes do not support large (greater than 1TB) volumes. In all cases, UFS logging should be used. For more information, see mount_ufs(1M). See Overview of Large Volume Support in Solaris Volume Manager for more information about large volume support in Solaris Volume Manager.


ProcedureHow to Create a Transactional Volume

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

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


    # umount /export
    

    Note –

    If the file system cannot be unmounted, you can continue, but will have to reboot the system before the transactional volume can be active.


  3. Create 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 Action->Create Volume and follow the instructions in the wizard. For more information, see the online help.

    • Use the following form of the metainit command:


      metainit trans-volume -t master-device log-device
      
      • trans-volume is the name of the transactional volume to create.

      • master-device is the name of the device containing the file system you want to log.

      • log-device is the name of the device that will contain the log.

      The master device and log device can be either slices or logical volumes. See the metainit(1M) man page for more information.

      For example, to create a transactional volume (d10) logging the file system on slice c0t0d0s6 to a log on c0t0d0s7, use the following syntax:


      # metainit d10 -t c0t0d0s6 c0t0d0s7
      

      Note –

      You can use the same log device (c0t0d0s7 in this example) for several master devices. The sharing of log devices is fully supported.


  4. Edit the /etc/vfstab file so that the existing UFS file system information is replaced with that of the created transactional volume.

    For example, if /export was on c0t0d0s6, and the new transactional volume is d10, edit /etc/vfstab as shown here, so the mount points to the transactional volume rather than to the raw disk slice:


    #/dev/dsk/c0t0d0s6   /dev/rdsk/c0t0d0s6   /export  ufs   2     yes   -
    /dev/md/dsk/d10   /dev/md/rdsk/d10   /export  ufs   2     yes   -
    
  5. If possible, remount the file system.


    Note –

    If you are creating a transactional volume for a file system that cannot be unmounted, such as /usr, then reboot the system now to remount the transactional volume and start logging.



Example 19–1 Creating a Transactional Volume for a Slice


# umount /home1
# metainit d63 -t c0t2d0s2 c2t2d0s1
d63: Trans is setup
(Edit the /etc/vfstab file so that the file system references 
the transactional volume) 
# mount /home1

The slice /dev/dsk/c0t2d0s2 contains a file system mounted on /home1. The slice that will contain the log device is /dev/dsk/c2t2d0s1. First, the file system is unmounted. The metainit command with the -t option creates the transactional volume, d63.

Next, the /etc/vfstab file must be edited to change the entry for the file system to reference the transactional volume. For example, the following line:


/dev/dsk/c0t2d0s2 /dev/rdsk/c0t2d0s2 /home1 ufs 2 yes -

should be changed to:


/dev/md/dsk/d63 /dev/md/rdsk/d63 /home1 ufs 2 yes -

Logging becomes effective for the file system when it is remounted.

On subsequent reboots, instead of checking the file system, the fsck command displays a log message for the transactional volume:


# reboot
...
/dev/md/rdsk/d63: is logging


Example 19–2 Creating a Transactional Volume for /usr


# metainit -f d20 -t c0t3d0s6 c1t2d0s1
d20: Trans is setup
(Edit the /etc/vfstab file so that the file system references 
the transactional volume)
# reboot

Slice /dev/dsk/c0t3d0s6 contains the /usr file system. The slice that will contain the log device is /dev/dsk/c1t2d0s1. Because /usr cannot be unmounted, the metainit command is run with the -f option to force the creation of the transactional volume, d20. Next, the line in the /etc/vfstab file that mounts the file system must be changed to reference the transactional volume. For example, the following line:


/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 1 no -

should be changed to:


/dev/md/dsk/d20 /dev/md/rdsk/d20 /usr ufs 1 no -

Logging becomes effective for the file system when the system is rebooted.



Example 19–3 Creating a Transactional Volume for a Logical Volume


# umount /home1
# metainit d64 -t d30 d12
d64: Trans is setup
(Edit the /etc/vfstab file so that the file system references 
the transactional volume)
# mount /home1

RAID 1 volume d30 contains a file system that is mounted on /home1. The mirror that will contain the log device is d12. First, the file system is unmounted. The metainit command with the -t option creates the transactional volume, d64.

Next, the line in the /etc/vfstab file that mounts the file system must be changed to reference the transactional volume. For example, the following line:


/dev/md/dsk/d30 /dev/md/rdsk/d30 /home1 ufs 2 yes -

should be changed to:


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

Logging becomes effective for the file system when the file system is remounted.

On subsequent file system remounts or system reboots, instead of checking the file system, the fsck command displays a log message for the transactional volume:


# reboot
...
/dev/md/rdsk/d64: is logging

To avoid editing the /etc/vfstab file, you can use the metarename(1M) command to exchange the name of the original logical volume and the new transactional volume. For more information, see Renaming Volumes.