Contained Within
Find More Documentation
Featured Support Resources
| PDF로 이 문서 다운로드
UFS Logging
6
- This chapter provides information on how to use Solstice DiskSuite Tool (metatool(1M)) to create and manipulate UFS logging (trans) devices. Refer to Chapter 3, "Overview of DiskSuite Tool," for information on using DiskSuite Tool.
- Use the following table to locate specific information.
-
Overview of UFS Logging
- DiskSuite's UFS logging facility speeds up reboots, provides faster local directory operations, and decreases synchronous disk writes. UFS file system updates are safely recorded in a log before they are applied to the file system itself.
- UFS file systems are checked at boot time because unscheduled system downtime can interrupt file system updates. These partially completed updates can leave inconsistencies in a file system. Mounting a file system without first checking it and repairing any inconsistencies can cause panics or data corruption. Checking consistency for large file systems can be a time-consuming process. With the UFS logging feature, file systems do not have to be checked at boot time because the changes from unfinished system calls are discarded.
- A pseudo device, called the trans device, manages the contents of the log. Like other metadevices, the trans device behaves the same as an ordinary disk partition. The trans device is made up of two subdevices: the logging device and the master device. These can be disk partitions, or metadevices, but not trans devices.
- The logging device can be shared by several file systems. The logging device contains the log. This log is a sequence of records, each of which describes a change to a file system. The master device contains the file system itself. The master device can either contain a file system initially, or you can create a file system on the trans device. Logging begins automatically when the trans device is mounted.
How UFS Logging Works
- You set up and configure a trans device using DiskSuite Tool. The configuration of the device and other state information is stored in the metadevice state database. The dynamic concatenation facility provides dynamic concatenation of both the master and logging devices.
- Trans devices have the same naming convention used for other metadevices.
- After a trans device is configured, it can be used just as if it were a physical partition. This means it can be used as a device that is as large as one terabyte in size. A file system can be created on the trans device if the master device doesn't already have a file system. Most UNIX disk utilities will work normally on trans devices, with the exception of format(1M).
- In addition, all usual file system operations can be performed on a trans device. The following list offers examples of file system operations:
-
- Mount (mount(1M)) the trans device on a directory
- Unmount (umount(1M)) a mounted trans device
-
- Copy files to the mounted trans device
- Read and write files from and to the mounted trans device
- Run ufsdump(1M) and ufsrestore(1M) on the trans device
- The following sections provide answers to some of the questions you'll need to resolve before you begin setting up UFS logging on your system.
Space Requirements for Logs
- The minimum size for a logging device is one Mbyte of disk space. Larger logs allow for more simultaneous file system operations per second. As a general rule, you need about one Mbyte of log space for every 100 Mbytes of file system space being logged.
-
Note - Only the first 64 Mbytes allocated to a log are used. Larger logs will contain unused space.
Selecting Which File Systems Should Be Logged
- It is possible to log any UFS file system with the exception of root (/). The root file system cannot be a trans device. In addition, it is probably not necessary to log small file systems with mostly read activity.
-
Caution - Logging must be disabled for /usr, /var, /opt, or any other file system used during a Solaris upgrade or installation.
- In general, you will want to log your largest UFS file systems and the UFS file systems whose data is changed most frequently.
- All logged file systems can share the same log. For performance considerations, however, the file systems with the heaviest loads should have separate logs.
-
Note - You should mirror all logs. Losing the data in a log because of device errors can leave a file system in a corrupt state.
Determining the Location of Logs
- Before you begin the procedures for setting up UFS logging, you should determine where to place the logs. You have two options for placement of logs:
-
- On unused partitions
- On the partitions containing the state databases
- The second of these options can be a practical solution if you are unable to commit an unused partition to logging. Refer to Chapter 2 and Chapter 10 in the Solstice DiskSuite 4.0 Administration Guide for additional information.
How to Set Up UFS Logging on an Existing File System
- After you have determined which file systems you want to log and where the log will be located, follow the steps in this section to set up UFS logging.
-
Note - The procedure for setting up UFS logging on slices that are not occupied by a UFS is the same as the following procedure. It is not necessary to unmount the file system. However, you must initialize the file system (using newfs(1M)) before mounting the file system.
- The following instructions tell you how to set up the master for UFS logging on an existing file system. In this example, the file system is named /abcfs:
-
-
As root, use the umount(1M) command to unmount /abcfs.
-
-
-
Start DiskSuite Tool.
-
-
-
Open a trans device template on the Metadevice Editor canvas.
Click on the Trans template. An unassigned and uncommitted Trans template is opened. When you point to the template, the message line displays the Trans device name, size, use, and status.
-

-
-
Open the Slice Browser.
Click on Slices on the button panel.
-

-
-
Select the slice that will contain the UFS logging master.
Click on the slice that will contain the UFS logging master. Then point to the slice, press the middle button, and drag the slice to the master rectangle in the Trans template. In this example, c4t1d4s0 is selected.
-

-
-
Select the slice that will contain the UFS log.
Click on the slice that will contain the UFS log. Point to the slice, press the middle button, and drag the slice to the log rectangle of the Trans template. In this example, slice c6t0d4s6 is selected.
-

- If the log slice is not mirrored, the following warning dialog box is displayed.
-

-
-
Commit the Trans device.
Click on the top rectangle of the Trans template. Then click on the Commit button.
-

- The Configuration Log displays the message that the Trans device has been committed.
-

-
-
Edit the /etc/vfstab file.
After you complete the previous steps, you must change the entry for /abcfs in the /etc/vfstab file. For example, the following line:
-
/dev/dsk/c4t1d4s0 /dev/rdsk/c4t1d4s0 /abcfs ufs 4 yes --
|
- should be changed to read:
-
/dev/md/dsk/d6 /dev/md/rdsk/d6 /abcfs ufs 4 yes --
|
-
-
Mount the file system.
Invoke the mount(1M) command and mount the /abcfs file system.
-
-
/abcfs is now a logging file system. When you reboot the system, fsck(1M) will notice that this is a logging file system and will not check it. Instead, fsck will display:
-
/dev/md/rdsk/d6: is logging.
|
How to Share a Log Between File Systems
- DiskSuite Tool supports sharing logs between several or all file systems. This section contains the instructions for sharing a log between file systems.
- In this example, the /abcfs file system that was logged in the previous subsection and the /xyzfs file system will share the same log. The two file systems will have different masters.
- The following instructions tell you how to set up /xyzfs to share the same log with /abcfs:
-
-
Unmount the file system.
Invoke the umount command and mount the /xyzfs file system.
-
-
-
Start DiskSuite Tool.
-
-
-
Open a Trans device template on the Metadevice Editor canvas.
Click on the Trans template. In this example, d7 is the Trans device that opens.
-
-
Open the d6 Trans device.
Point to the d6 Trans device in the device list of the Metadevice Editor window and double-click the left button.
-

-
-
Open the Slice Browser.
Click on Slices on the button panel.
-

-
-
Select the slice that will contain the UFS log.
Click on the slice that will contain the UFS log. Then point to the slice, press the middle button, and drag the slice to the log rectangle in the d7 Trans template. In this example the same log used by the d6 Trans device is selected (c6t0d4s6).
-

- If the log slice is not mirrored, the following warning dialog box is displayed.
-

-
-
Select the slice that will contain the d7 UFS master. Click on the slice that will contain the UFS master. Point to the slice, press the middle button, and drag the slice to the master rectangle in the Trans template. In this example, c7t0d1s0 is selected.
-

-
-
Commit the d7 trans device.
Click on the Trans template. Then click on the Commit button.
-

- The Trans devices now share the same log, c6t0d4s6.
-

-
-
Edit the /etc/vfstab file.
After you complete the previous steps, you must change the entry for /xyzfs in the /etc/vfstab file. For example, the following line:
-
/dev/dsk/c7t0d1s0 /dev/rdsk/c7t0d1s0 /xyzfs ufs 4 yes --
|
- should be changed to read:
-
/dev/md/dsk/d7 /dev/md/rdsk/d7 /xyzfs ufs 4 yes --
|
-
-
Mount the file system
Invoke the mount command and mount the /xyzfs file system.
-
-
/xyzfs is now a logging file system. When you reboot the system, fsck will notice that /abcfs and /xyzfs are logging file systems and will not check them. Instead, fsck will display:
-
/dev/md/rdsk/d6: is logging.
/dev/md/rdsk/d7: is logging.
|
Removing UFS Logging
- This subsection contains the instructions for removing a log from a file system by using DiskSuite Tool.
- To remove UFS logging from the /abcfs file system, perform the following steps:
-
-
Unmount the /abcfs file system.
Invoke the umount command and unmount the /abcfs file system.
-
-
-
Start DiskSuite Tool.
-
-
-
Open the d6 Trans device on the Metadevice Editor window's canvas. Point to the Trans device in the device list and double-click.
-

-
-
Delete the d6 Trans device.
Point inside the top rectangle of the d6 Trans device and press the right button. Select the Delete option.
-

-
-
Confirm the deletion of the d6 Trans device. Click on the Really Delete button.
-

-
-
Edit the /etc/vfstab file to remove the d6 Trans device. In this case, you would change the line:
-
/dev/md/dsk/d6 /dev/md/rdsk/d6 /abcfs ufs 5 yes --
|
- to read:
-
/dev/dsk/c4t1d4s0 /dev/rdsk/c4t1d4s0 /abcfs ufs 5 yes --
|
-
-
Run the fsck command.
Because /abcfs is no longer a logging file system, you must run fsck before you can mount it. The following output is generated when you run fsck:
-
# fsck /dev/rdsk/c4t1d4s0
FILE SYSTEM STATE IN SUPERBLOCK IS WRONG; FIX? y
|
-
-
Mount the file system.
Invoke the mount command on the /abcfs file system.
-
- The /abcfs file system is no longer logging.
Logging a File System That You Cannot Unmount
- DiskSuite Tool supports UFS logging on file systems that cannot be unmounted while the system is running, such as /var, /opt, or /usr.
- The following example provides step-by-step instructions for creating a UFS log on the /var file system.
-
-
Start DiskSuite Tool.
-
-
-
Open a Trans template on the Metadevice Editor canvas.
Click on the Trans template.
-

-
-
Open the Slice Browser.
Click on Slices on the button panel.
-

-
-
Locate the file system that will be logged.
Scroll through the list of slices and locate a slice that contains the /var file system. In this example, /var is on the c4t0d0s0 slice.
-

-
-
Move the slice to the d6 Trans device master. Point to the c4t0d0s0 slice and press the middle button. Drag the slice to the master rectangle of the Trans device.
-

-
-
Confirm the slice will be the master.
When the c4t0d0s0 slice is dropped in the master rectangle, the validation warning dialog box is displayed. Click on the Continue button.
-

-
-
Select the slice that will contain the UFS log.
Scroll through the list of slices in the Slice Browser and choose one that will be the UFS log. In this example, c5t1d2s6 was selected.
-
-
Drag the slice to the d6 Trans device
Point to the c5t1d2s6 slice and press and hold down the middle button. Drag the slice to the log rectangle in the d6 Trans template.
-

-
-
Confirm the slice will be the log.
When the c5t1d2s6 slice is dropped in the log rectangle, the validation warning dialog box is displayed. Click on the Continue button.
-

-
-
Commit the Trans device.
Click on the top rectangle of the Trans template. Then click on the Commit button.
-

-
-
Confirm the commit.
When you commit the d6 Trans device, a confirmation dialog box is displayed. Click on the Really Commit button.
-

-
-
Reboot the system.
Until the system is rebooted, the logging on /var does not begin.
Removing UFS Logging From a File Systems You Cannot Unmount
- DiskSuite Tool does not support removing a UFS log from swap, or any other file systems (for instance, /opt and /usr) that cannot be unmounted while the system is running.
- This procedure must be done using the DiskSuite command line functionality as documented in Chapter 6 of the Solstice DiskSuite 4.0 Administration Guide.
Using Metadevices and Mirrors as Trans Components
- A logging device or a master device can be a physical component, a metadevice, a RAID or a mirror. Physical components have been used as logging and master devices in the example procedures provided in this chapter. See Chapter 4, "Concatenating and Striping," Chapter 5, "Mirroring," and Chapter 9, "RAID Devices" for examples of how to set up metadevices and mirrors.
- To ensure data is reliable and available, use mirrors for logging devices. Otherwise, device errors on the logging device that is a physical component could cause a significant loss of the file system's data.
- The procedure you would use to create trans devices when using DiskSuite Tool would be:
-
-
Open a mirror object and populate it with two or more slices.
-
Drag the mirror into the master field of the Trans device object.
- Using metadevices, for example a stripe, for logging or master devices can increase performance. Using metadevices also provides more configuration options. For example, you can expand the master device and grow its file system while the trans device is still mounted and in use. You could also expand the logging device.
- Even if you are unable to mirror the logging and master devices, you should configure the logging and master devices as one-way mirrors. This enables you to add a second submirror later, without reconfiguring the Trans device.
- See Chapter 5, "Mirroring," for information on how to create mirrors.
Trans Information Window
- The Trans Information window allows you to view and modify the attributes and components of a specific Trans metadevice. Figure 6-1 shows the Trans Information window. There are three ways to display the Trans Information window:
-
- Point to the Trans object in the Metadevice Browser and double-click. The Trans is opened on the Metadevice Editor's canvas and the Trans Information window is displayed.
- If the Trans metadevice object is on the Metadevice Editor's canvas, point inside the Trans rectangle and bring up the Trans menu. Select the Info choice.
- Double-click on a Trans object on the Metadevice Editor's canvas.

Figure 6-1
- Once changes are made, the Trans object must be committed before the policy changes take effect.
-
Table 6-1 lists the functionality associated with the regions of the Trans Information window.
-
Table 6-1
| Field | Functions |
| Device name | The metadevice name of the Trans device. |
| Status | Description of the Trans device status. See "Checking the Status of Trans Metadevices" on page 165 for a description of the values that can appear here. |
| Size | The size of the Trans device. |
| Use | How the Trans device is currently used (for example, file system or swap). |
| Master device region | A region that contains the device name of the master device. The Attach button toggles between Attach and Remove. Other information in the region includes: Type - The type of device used as the master. Status - Shows the description of the Master's status. See "Checking the Status of Trans Metadevices" on page 165 for a description of the values that can appear here. Size - Displays the size of the master device. Info - Displays the information form for the master device. |
| Log device region | A region that contains the device name where the log device is located. The Remove button toggles between Attach and Remove. Other information in the region includes: Type - The type of device used as the log. Status - Shows the description of the log's status. See "Checking the Status of Trans Metadevices" on page 165 for a description of the values that can appear here.
Size - Displays the size of the log device. Info - Displays the information form for the log device.
|
Checking the Status of Trans Metadevices
- There are three ways to check the status of Trans metadevices using DiskSuite Tool. The methods are:
-
- Move the Trans metadevice object from the device list and check the Status field on the object.
- Bring up the Trans Information window and check the Status field.
- Bring up the Problem List window, which is available using the Browse menu on the menu bar of the Metadevice Editor window. If a problem exists, a detailed description of the problem is given.
- The Status fields of the Trans metadevice use the status keywords explained in Table 6-2.
-
Table 6-2
| Keyword | Meaning |
| OK | The Trans metadevice has no errors and is functioning correctly. |
| Detach Log (in progress) | The Trans metadevice log will be detached when the Trans metadevice is unmounted or at the next reboot of the system. |
| Detach Log (scheduled) | The Trans metadevice log will be detached the next time you click on the Commit button. |
| Attention | There is a problem with the Trans metadevice, but there is no immediate danger of losing data. |
| Urgent | There is a problem with the Trans metadevice and you are only one failure away from losing data. This state can only exist if the Trans metadevice contains a RAID or mirror. |
| Critical | Data has potentially been corrupted. |
Recovering From Device Errors and File System Panics
- Any device errors or file system panics you encounter must be dealt with using DiskSuite and UNIX command-line utilities. For detailed information on these commands, refer to Chapter 6 of the Solstice DiskSuite 4.0 Administration Guide.
|
|