This section describes how to create trans metadevices (UFS logging).
A trans metadevice enables UFS logging, which is the process of recording UFS updates in a log before the updates are applied to the UNIX file system. A trans metadevice can increase overall file system availability after reboot, because it reduces the amount of time fsck(1M) has to run when the system reboots.
The system must contain at least three state database replicas before you can create a trans metadevice.
The trans metadevice normally has two devices: the master device and the logging device. The master contains the file system that is being logged. The logging device contains the log and can be shared by several file systems. It is a sequence of records, each of which describes a change to a file system. Both the master device and the logging device can be a slice or a metadevice.
Though logs can be shared between file systems, heavily-used file systems should have their own logging device.
Small file systems with mostly read operations probably do not need to be logged.
Any UFS, except root (/), can be logged.
Even if you don't have an available slice for a logging device, you can still set up a trans metadevice without a logging device. This is useful if you plan to enable logging on exported file systems, but do not have an available slice for the logging device at this time.
Before creating trans metadevices, identify the slices or metadevice to be used as the master devices and logging devices.
Avoid placing logs on heavily-used disks.
Do not use a RAID5 metadevice as a logging device. Instead, use a mirror for data redundancy.
Logs (the logging device) can be placed on a slice that already contains a state database replica.
Plan on using one megabyte of log space as a minimum, and an additional one megabyte of log space per 100 megabytes of file system data, up to a maximum log size of 64 Mbytes. Logs greater than 64 Mbytes waste space.
The master devices and logging devices of the same trans metadevice should be located on separate drives and possibly separate controllers.
Mirroring logging devices is strongly recommended. Losing the data in a logging device because of device errors can leave a file system in an inconsistent state which fsck(1M) may not be able to fix without user intervention. Using a mirror for the master device is a good idea to ensure data redundancy.
Before beginning, identify the slice or metadevice that contains the file system. You'll need this when creating the master device. Also, decide if you want to mirror the logging device. If so, use "How to Create a Trans Metadevice Using Mirrors (DiskSuite Tool)". If you are mirroring the logging device, it is a good idea that the master device be a mirror also.
You can create a file system on the trans metadevice later if the master device doesn't already have a file system.
To create a trans metadevice for a file system, such as /usr, that cannot be unmounted during normal system operation, refer to "How to Create a Trans Metadevice for a File System That Cannot Be Unmounted (DiskSuite Tool)".
Make sure you have met the prerequisites ("Prerequisites for Creating DiskSuite Objects") and have read the preliminary information ("Preliminary Information for Creating Trans Metadevices").
Click the trans metadevice template.
An unassigned and uncommitted Trans Metadevice object appears on the canvas. The metadevice name is automatically assigned.
[Optional] Change the default metadevice name.
Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.
Drag the slice or metadevice that will contain the master device to the master rectangle in the trans metadevice template.
When you can drag a slice from the Slice Browser, or drag a metadevice from the Objects list, a warning dialog box is displayed. Click Continue.
If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the trans metadevice's name.
Select the slice or metadevice that will contain the logging device, and drag it to the log rectangle of the trans metadevice template.
A Warning dialog box appears if the logging device is not mirrored.
Click the top rectangle of the Trans Metadevice object then click Commit.
Unmount then remount the file system on the trans metadevice.
Logging becomes effective for the file system when you remount the system. On subsequent reboots, instead of checking the file system, fsck(1M) displays this message:
/dev/md/rdsk/dx: is logging. |
To verify that the trans metadevice was committed, display the Configuration Log.
This example shows a committed trans metadevice, d8, consisting of slice c3t0d0s5 for the master device, and a mirror, d5, for the logging device. Notice how the master and logging devices are displayed within the trans object.
After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Trans Metadevices"), create the trans metadevice with the metainit(1M) command. Refer to the metainit(1M) man page for more information.
# umount /home1 # metainit d63 -t c0t2d0s2 c2t2d0s1 d63: Trans is setup (Edit the /etc/vfstab file so that the file system references the trans metadevice # umount /home1 |
Slice /dev/dsk/c0t2d0s2 contains a file system mounted on /home1. The slice to contain the logging device is /dev/dsk/c2t2d0s1. First, the file system is unmounted. The metainit command with the -t option creates the trans metadevice, d63.
Next, the /etc/vfstab file must be edited to change the entry for the file system to reference the trans metadevice. 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, fsck(1M) displays a logging message for the trans metadevice:
# reboot ... /dev/md/rdsk/d63: is logging |
# umount /home2 # metainit d40 -t d2 c1t2d0s0 d40: Trans is setup (Edit the /etc/vfstab file so that the file system references the trans metadevice) # mount /home2 |
Stripe d2 contains a file system mounted on /home2. The slice to contain the logging device is /dev/dsk/c1t2d0s0. First, the file system is unmounted. The metainit command with the -t option creates the trans metadevice, d40.
Next, the /etc/vfstab file must be edited to change the entry for the file system to reference the trans metadevice. For example, the following line:
/dev/md/dsk/d2 /dev/md/rdsk/d2 /home2 ufs 2 yes - |
should be changed to:
/dev/md/dsk/d40 /dev/md/rdsk/d40 /home2 ufs 2 yes - |
Logging becomes effective for the file system when it is remounted.
On subsequent reboots, instead of checking the file system, fsck(1M) displays a logging message for the metadevice:
# reboot ... /dev/md/rdsk/d40: is logging |
Use this procedure to log a file system, such as /usr, that cannot be unmounted during normal system operation.
Make sure you have met the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Creating Trans Metadevices").
Click the trans metadevice template.
An unassigned and uncommitted Trans Metadevice object appears on the canvas. The metadevice name is automatically assigned.
[Optional] Change the default metadevice name.
Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.
Click Slices to open the Slice Browser.
Select the slice or metadevice that contains the file system to be logged, and drag it to the master rectangle in the Trans Metadevice object.
This must be the slice or metadevice that contains the file system.
Confirm the device that will be the master.
Click the Continue button on the dialog box that appears.
Select the slice or metadevice that will contain the logging device, and drag it to the log rectangle of the Trans Metadevice object.
Confirm the slice that will be the log.
Click the Continue button on the dialog box that appears.
Click the top rectangle of the Trans Metadevice object then click Commit.
Click the Really Commit button on the confirmation dialog box.
To verify that the trans metadevice was committed, display the Configuration Log.
Reboot.
After the reboot, logging becomes effective for the file system.
This example shows a trans metadevice that contains the /usr file system.
After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Trans Metadevices"), use this procedure to log a file system, such as /usr, that cannot be unmounted during normal system operation. Refer to the metainit(1M) man page for more information.
# metainit -f d20 -t c0t3d0s6 c1t2d0s1 d20: Trans is setup (Edit the /etc/vfstab file so that the file system references the trans metadevice) # reboot |
Slice /dev/dsk/c0t3d0s6 contains the /usr file system. The slice to contain the logging 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 trans device, d20. Next, the line in the /etc/vfstab file that mounts the file system must be changed to reference the trans metadevice. 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.
You can increase data availability of a trans metadevice by using mirrors for the master and logging devices. Failure to mirror the logging device could result in significant data loss if the logging slice experiences errors. If you are mirroring the logging device, it is a good idea that the master device be a mirror also.
Make sure you have met the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Creating Trans Metadevices").
Refer to the tasks on creating mirrors ("How to Create a Mirror From Unused Slices (DiskSuite Tool)" to "How to Create a Mirror From a File System That Cannot Be Unmounted (Command Line)").
Create two mirrors, one for the master device, and one for the logging device. The mirror for the master device must contain the file system.
Refer to "How to Create a Trans Metadevice for a File System That Can Be Unmounted (DiskSuite Tool)".
Use the mirrors created in step 2 for the master and logging devices.
After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Trans Metadevices"), use the metainit(1M) to create the trans metadevice.
# umount /home1 # metainit d64 -t d30 d12 d64: Trans is setup (Edit the /etc/vfstab file so that the file system references the trans metadevice) # mount /home1 |
Mirror d30 contains a file system mounted on /home1. The mirror to contain the logging device is d12. First, the file system is unmounted. The metainit command with the -t option creates the trans metadevice, d64.
Next, the line in the /etc/vfstab file that mounts the file system must be changed to reference the trans metadevice. 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, fsck(1M) displays a logging message for the metadevice:
# reboot ... /dev/md/rdsk/d64: is logging |