How to Remove a Transactional Volume and Retain the Mount Device
This procedure works only for situations in which the transactional volume and the underlying device are both Solaris Volume Manager logical volumes.
Check "Prerequisites for Creating Solaris Volume Manager Elements" and "Background Information for Transactional Volumes".
Unmount the UFS file system for which you want to remove the transactional volume and disable logging.
Detach the log device 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
master-volume is the name of the transactional volume that contains the file system that is being logged.
Exchange the name of the transactional volume with that of the master device.
Remove (clear) 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 Delete. For more information, see the online help.
Use the following form of the metaclear command:
metaclear master-volume
Run the fsck command on the master device.
When asked whether to fix the file system's state in the superblock, respond y.
Remount the file system.
Example--Removing a Transactional Volume While Retaining the Mount Device
This example begins with a transactional volume, d1, that contains a mounted file system, and ends up with a file system that is mounted on the transactional volume`s underlying master device, which will be d1.
# metastat d1 d1: Trans State: Okay Size: 5600 blocks Master Device: d21 Logging Device: d0 d21: Mirror Submirror 0: d20 State: Okay Submirror 1: d2 State: Okay ... d0: Logging device for d1 State: Okay Size: 5350 blocks # umount /fs2 # metadetach d1 d1: log device d0 is detached # metarename -f -x d1 d21 d1 and d21 have exchanged identities # metastat d21 d21: Trans State: Detached Size: 5600 blocks Master Device: d1 d1: Mirror Submirror 0: d20 State: Okay Submirror 1: d2 State: Okay # metaclear 21 # fsck /dev/md/dsk/d1 ** /dev/md/dsk/d1 ** Last Mounted on /fs2 ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups FILE SYSTEM STATE IN SUPERBLOCK IS WRONG; FIX? y 3 files, 10 used, 2493 free (13 frags, 310 blocks, 0.5% fragmentation) # mount /fs2 |
The metastat command confirms that the transactional volume, d1, is in the "Okay" state. The file system is unmounted before detaching the transactional volume's log device. The transactional volume and its mirrored master device are exchanged by using the -f (force) flag. Running the metastat command again confirms that the exchange occurred. The transactional volume and the log device (if desired) are cleared, in this case, d21 and d0, respectively. Next, the fsck command is run on the mirror, d1, and the prompt is answered with a y. After the fsck command is done, the file system is remounted. Note that because the mount device for /fs2 did not change, the /etc/vfstab file does not require editing.
Sharing Log Devices
How 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.
Check "Prerequisites for Creating Solaris Volume Manager Elements" and "Background Information for Transactional Volumes".
If possible, unmount the file system for which you want to enable logging.
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
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
Edit the /etc/vfstab file to modify (or add) the entry for the file system to reference the transactional volume.
Remount the file system. If the file system cannot be unmounted, reboot the system to force your changes to take effect.