Tutorials to .com

Tutorials to .com » Os » Solaris » Solaris 10 UFS File System-wide Management Strategy (Part I)

Solaris 10 UFS File System-wide Management Strategy (Part I)

Print View , by: iSee ,Total views: 26 ,Word Count: 3690 ,Date: Wed, 6 May 2009 Time: 8:23 PM

A, solaris 10 File system Introduction

1. Solaris 10 file system three

UFS file system is almost all the basic Unix system file system, Solaris of course, is no exception. In addition to Solaris 10 to support the three types of file system, they are:

(1) Web-based file system; Web-based file system is the Network File System, or NFS file system. Network File System (NFS) version 3 to upgrade to 4.

(2) Virtual File System (also known as pseudo-file system). Most of the virtual file system is based on the memory file system, but also some of the file system is based on the hard disk, including:

TMPFS file system: the use of local memory read and write to the file system. In Solaris the default application for the / tmp directory

LOFS file system: file system cycle (lofs) to create a new virtual file system of the original, and then use another path name to access the document

PROCFS file system: the process of file system (procfs) resides in memory performance for the / proc directory. In this directory the process of its list of activities, ps command will be used, such as / proc directory of information, the debugger or other tools may also be called through the file system to access the address of these processes and space

CacheFS file system: to improve the remote file system (NFS) and CD-ROM read speed, the read data cache file system in CacheFS

SWAPFS file system: mkfile and swap with the establishment of additional exchange of command area, the system used in the core file system

(3) disk-based file system; include:

UFS file system: BSD fast file system based on the traditional UNIX file system is the default Solaris file system. UFS logging is enabled by default function. Solaris in the early version, UFS logging can only be opened manually. Solaris 10 running 64-bit Solaris kernel system supports multi-TB UFS file system. Ago, UFS file system in the 64-bit systems and 32-bit systems the size is limited to about 1 TB (Tbyte). Now, all UFS file system commands and common procedures have been updated to support multi-TB UFS file system.

HSFS File System: CD-ROM for read-only file system

PCFS File System: PC file system, you can read and write DOS disk type data, such as FAT32

UDF File System: DVD file system

2 solaris 10 UFS File System Structure

Solaris 10 typical UFS file system type file system, but it also allows the / etc / default / fs defined in other file types. Solaris 10 on in, UFS file system resides on the hard disk, which has the original equipment at the same time the hard disk interface and block device interface, the two interfaces are located at / dev / rdsk directory and / dev / dsk directory. Solaris 10 file system created in each district / dev / dsk and / dev / rdsk in the corresponding items of their own. A UFS file system components include the following sections.

Guide block (boot block): the file system can be guided, the guide contains a guide block of data.

Super blocks (super block): super block contains information about the location of i-node, file system size, block number, as well as status information.

i-node (inode): file storage file system details.

Data blocks (data block): the actual storage of documents.

3 solaris 10 UFS file system features

Expansion of the basic types (EFT): the provision of 32-bit user ID (user ID, UID), group ID (group ID, GID) and equipment number.

Large file system: the maximum size of 16 TB for the file system, allowing the size of the document is about 1TB. Can have the EFI disk label of disk to create multi-TB UFS file system.

Logging: UFS logging will be composed of a complete UFS operation to change a number of meta-data services into a package. Services set recorded in the log disk, and then will be applied to the actual UFS file system metadata.

Multi-TB file system through a multi-TB file system, you can create the largest free space is about 16 TB of UFS file system, which will be about 1% less costs.

Status symbol shows the status of the file system: clean, stable, active, logging, or unknown. These signs can avoid unnecessary file system checks. If the file system for the state of "clean", "stable" or "logging", not to run file system checks.

4 Solaris UFS file system hierarchy

From the root directory (/), the downward extension of a number of directories. In the Solaris installation process, you can install a set of default directories, and agreed to the use of a group of similar file types together. The following table summarizes the default Solaris file system. Default Solaris file system

File system or directory File System Type Description
(/) UFS Top-level hierarchical document tree. Root (/) directory contains critical system directories and files, such as the kernel, device drivers and the process used to guide the system. Root (/) directory also contains the mount point directory, can be in these directories will be the local file system and Remote file system attached to the document tree.
/ var UFS Possible with the life cycle of the local system and to change or the growth of system files and directories. These system files and directories, including system logs, vi and ex backup files, and uucp files.
/ opt NFS, UFS The optional third-party software mount point. In some systems, / opt directory may be local films on the disk UFS file system.
/ usr UFS Can be shared with other users of the system files and directories. Only in certain types of file systems running on (for example, SPARC executable files) included in the / usr file system. In all types of systems used files (such as manual pages) included in the / usr / share directory.
/ export / home or / home NFS, UFS Users starting directory (used to store user files) the mount point. By default, / home directory is automatically mounted file system. Independent system, / home directory may be local films on the disk UFS file system.

The following diagram shows a root (/) file system and sbin, etc subdirectory of the local file system to start.

Solaris 10 UFS File System-wide Management <a href=strategy (Part I)" />

Figure 1 UFS file system diagram

Second, UFS file system

1. UFS file system to establish

Solaris 10 due to the installation process will automatically create a UFS file system, so only occasionally need to create these file systems. If you want to do the following, you need to create (or re-create) UFS File System: Add or replace the disk, change the disk partition of the existing structure, fully restored file system. Can use the newfs command to create UFS file system is the standard method. mkfs command newfs command is the front-end, which actually used to create a new file system. newfs command from the file system will contain the new disk to read the label parameter default values, such as the track of each cylinder number and the number of sectors in each track. The selected option will be passed to the mkfs command to create the file system.

Steps to create a UFS file system:

Disk must be formatted and slicing. If you want to re-create the existing UFS file system, remove the mount of the file system. Need to know the file system will contain the device name of the film.

Become super user or to assume the equivalent role.

Use the command to create UFS file system, the command is as follows:

# Newfs [-N] [-b size] [-i bytes] / dev / rdsk / device-name

-N show the newfs command will be passed to the mkfs command parameters, not the actual creation of the file system. This option is used to test the newfs command is a good way.

-b size of the specified file system block size, each for 4096 or 8192 bytes. Default value is 8192.

-i bytes specified number of bytes for each inode. Default value varies according to disk size.

device-name specified in the file system to create a new disk device name. The system will confirm the request.

Command example: In / dev/rdsk/c0t1d0s4 to create a UFS file system.

# Newfs / dev/rdsk/c0t1d0s4

Figure 2 is the name of Solaris physical disk that

Solaris 10 UFS File System-wide Management Strategy (Part I)

Figure 2 is the name of Solaris physical disk that

Verify that the creation of the UFS file system, please check the new file system. Command as follows:

fsck /dev/rdsk/c0t1d0s4 mount UFS file system using the mount command

To / dev/dsk/c0t3d0s4 mounted to / export / home directory.

# mount/dev/rdsk/c0t1d0s4 /export/home

Alone does not run the mount command without parameters will display the current document has been articulated resources. Figure 3.

Solaris 10 UFS File System-wide Management Strategy (Part I)

Figure 3 shows the current document has been articulated resources

2. The use of / etc / vfstab file management UFS File System

We can use the command mount and umount command to manually manage the file system, can also form through the file system (/ etc / vfstab) to manage. By editing / etc / vfstab file, the system can be activated automatically when installed on a local ufs file system, nfs file system necessary, as well as other file systems. Can use more / etc / vfstab order to view / etc / vfstab document in Figure 4, the file system table is ASSCII file, comment line with # at the beginning, the following / etc / vfstab file shows there is a hard disk system.

Solaris 10 UFS File System-wide Management Strategy (Part I)

See Figure 4 using the command / etc / vfstab file content

/ etc / vfstab file contains seven fields. Here's how to modify / etc / vfstab file, in order to mount (mount) the new file system steps:

(1) into the super-user;

(2) using vi editing commands such as / etc / vfstab file;

(3) by adding the. By a space or Tab key to separate each domain, if not the value of an item, then fill in "-" number;

(4) Save the file;

(5) to check the existence of the installation point directory does not exist is to build a;

(6) Run the command mountall.

The following example shows the / dev/dsk/c0t3d0s7 panel ufs file system as installed / test1 directory, the installation of any options (read / write) as the default value, fsck device is / dev/rdsk/c0t3d0s7 characters equipment, fsck pass value of 2, indicating that the file system does not detect the use of the order of the way:

The following example illustrates how the film disk / dev/dsk/c0t3d0s7 mounted as a UFS file system mount point to / files1. Original character device / dev/rdsk/c0t3d0s7 be designated as a device to fsck. fsck pass value of 2 means that will check the file system, but not by the order of inspection.

#device      device       mount  FS    fsck  mount  mount
#to mount     to fsck      point  type   pass  at boot options
/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /files1 ufs   2   yes    -
#device      device       mount  FS    fsck  mount  mount
#to mount     to fsck      point  type   pass  at boot options
/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /files1 ufs   2   yes    -

Third, organize repair UFS file system

1 when it is necessary to repair

UFS file system relies on a set of internal tables have been used to track the inode and the block can be used. When these internal tables with the data on disk is not properly synchronized, it will lead to inconsistency, thus the need to repair the file system.

As a result of the following circumstances leading to the abrupt termination of the operating system, file system may be inconsistent:

power failure

Accident shut down the system power supply

The right not to shut down the system shut down process

Software errors appear in the kernel

Despite inconsistencies in the file system issues seriously, but not common. Guidance system, will automatically execute the file system consistency check (using the fsck command). Typically, the file system check will fix it problems. Detection of the file system is the fsck (file system check) program to achieve. fsck command will have been allocated but did not specify the source files and directories in lost + found directory, if the directory does not exist, fsck from the establishment. Lost + found if there is not enough space, fsck will automatically increase its space. The following conditions generally require testing at the time of the file system:

File system can not be installed;

Are using the file system problems;

Are using a file system inconsistency, the console window will prompt out the error message is very smart, serious and even paralysis can occur.

fsck command syntax and options

command fsck file system check and repair the problem of inconsistency. If you are running without any option of fsck command, the command will be carrying out repair to interactively request before to confirm. There are four options for this command.

Commands and options Description
fsck-m Check whether the file system can be mounted
fsck-y Accept all the repair
fsck-n Reject all repair
fsck-op Finishing non-interactive file system, to resolve all the expected (innocuous) inconsistencies, but when faced with serious problems from the
2 steps to repair the file system:

(1) into the super-user;

(2) Demolition (umount) the file system in question;

(3) type the command fsck to repair.

3 how to sort out UFS File System

After the abnormal shutdown, you can run fsck-op command to tidy up the file system. In this mode, fsck command does not view the "clean" sign, but to perform a full inspection. These operations is the fsck command interactively when run by a subset of the implementation of the operation.

(1) to become super-user or to assume the equivalent role.

(2) the abolition of UFS file system mounted.

# umount /mount-point

(3)!! Finishing options with UFS file system check.

# fsck -op /dev/rdsk/device-name rdsk # fsck -op /dev/rdsk/device-name The following example describes how to organize / export / home file system.

# fsck -op /export/home four, UFS file system set up disk quotas

Resources to carry out the necessary disk space management is solaris system administrator in the Region. In particular, when the system disk space is limited, and when a large number of users, system administrators must find a way to either increase the number of disks, or limit the user's use of space. Without increasing the budget for the new circumstances, the limited user space is the only feasible option. Quota restrictions on disk space in two measures: a hard limit and soft limit. System hardware is strictly restricted users can use the space, does not allow the excess. Soft limit is exceeded the limit allows the user to a certain limit. When the soft limit exceeded, Quota start running, in the time period (the default for a week, in the / usr / include / sys / fs / ufs_quota.h document set), the user to limit the release of the space below zero reset time. If not due to release the space, the system will no longer allow the user to use more space. Quota restrictions on disk space, there are two methods that were carried out on the inode and block restricted. To users because the system provides two resources: inode and block, respectively, used to store files and data.

Quota set up steps:

(1)!! Use gedit or vi to edit / etc / vfstab file, in the Quota of the UFS need to add attributes rq signs. Figure 5

Solaris 10 UFS File System-wide Management Strategy (Part I)

Figure 5 Edit / etc / vfstab file

(2) in the root file system quotas established under the name of the file, which the owner should be root, other users can not write it.

# cd /export/home
#touch quotas
# chmod 600 quotas

(3) the use of edquota order in the UFS root to create a temporary file, the contents of this document, including the use of user quota.

(4) quotacheck order to limit the use of the consistency check.

# Quotacheck-va in Figure 6

Solaris 10 UFS File System-wide Management Strategy (Part I)

Figure 6 to limit the use of quotacheck order to check the consistency

(5) quotaon command to start edquota services.

#quotaon /export/home #quotaon /export/home

(6) change, and delete settings Quota

Following a brief presentation of some change, and delete command Quota set.

Change the time limits set: # edquota-t

Limit the user to change the limit settings: # edquota username

Check the user quota settings are correct: # edquota-v [username]

Close quota Service: # quotaoff [quota root directory]

5, UFS disk space management commands

Command to view disk space management disk space the size of an administrator often needs to be done. Solaris operating system provides many commands to reflect the size of disk space systems, we can see see the importance of the size of system space. The following table shows the disk space information and examples of the command summary.

Command name Functional Description Simple examples
df Report free disk blocks and the number of documents Show file size and disk space: $ df

To show the form of 1024K size of disk space: $ df-h

Form in order to block file size and disk space: $ df-t

du Space the size of subdirectories Show directory size is the number of KB:

$ Du-h / usr / share /

Show that the number of directory block size is a few:

$ Du-s / var / adm / var /

find Specified directory to find the specified file size Locate and delete the core file:

# Find.-Name core-exec rm ();

Note: core file system software failure information log file. core documents will automatically become larger significance for the ordinary user does not have.

ls Displays the current directory files and the size of Details are listed in the document: $ ls-l

Listed in chronological order within the file directory: $ ls-tl / var

Description:-t parameter is requested to sort the output by time, time above in the most up-to-date.

Summary: a brief introduction by the end of my solaris 10 UFS file system's basic management, will introduce the author behind the UFS file system backup and recovery.

Solaris Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.