Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
Chapter 18

Transactional Volumes (Tasks)

This chapter provides information about performing tasks that are associated with transactional volumes. For information about the concepts involved in these tasks, see Chapter 17, Transactional Volumes (Overview).


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.


Transactional Volumes (Task Map)

The following task map identifies the procedures needed to manage Solaris Volume Manager transactional volumes.

Task

Description

Instructions

Create a transactional volume 

Use the Solaris Volume Manager GUI or the metainit command to create a transactional volume.

"How to Create a Transactional Volume"

Convert transactional volumes to UFS logging

Use the metaclear and mount commands to clear a transactional volume and mount the file system with UFS logging.

"How to Convert a Transactional Volume to UFS Logging"

Check the status of transactional volumes 

Use the Solaris Volume Manager GUI or the metastat command to check the status of a transactional volume.

"How to Check the State of Transactional Volumes "

Attach a log device to a transactional volume

Use the Solaris Volume Manager GUI or the metattach command to attach a log device.

"How to Attach a Log Device to a Transactional Volume"

Detach a log device from a transactional volume

Use the Solaris Volume Manager GUI or the metadetach command to detach a log device.

"How to Detach a Log Device from a Transactional Volume"
Expand a transactional volume 

Use the Solaris Volume Manager GUI or the metattach command to expand a transactional volume.

"How to Expand a Transactional Volume"
Delete a transactional volume 

Use the Solaris Volume Manager GUI, the metadetach command, or the metarename command to delete a transactional volume.

"How to Remove a Transactional Volume"
Delete a transactional volume and retain the mount point 

Use the Solaris Volume Manager GUI or the metadetach command to delete a transactional volume.

"How to Remove a Transactional Volume and Retain the Mount Device"
Share a log device Use the Solaris Volume Manager GUI or the metainit command to share a transactional volume log device."How to Share a Log Device Among File Systems"
Recover a transactional volume with a file system panic Use the fsck command to recover a transactional volume with a panic. "How to Recover a Transactional Volume With a Panic"
Recover a transactional volume with hard errors Use the fsck command to recover a transactional volume with hard errors. "How to Recover a Transactional Volume With Hard Errors"

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.


How to Create a Transactional Volume

  1. Check "Prerequisites for Creating Solaris Volume Manager Elements" 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/c0t0d0s5   /dev/rdsk/c0t0d0s5   /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--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--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--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

Note - 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".


Converting Transactional Volumes to UFS Logging

Converting any existing transactional volumes on your system to use UFS logging could improve performance and maintainability. Additionally, because transactional volumes will not be supported at some time in the future, you will eventually need to move to UFS logging. The following section outlines the conversion process.

 
 
 
  Previous   Contents   Next