Sei sulla pagina 1di 29

Managing the Solaris OE File System

AITA\SWBU\SOLARIS\08

Solaris OE File Systems


Disk-based file systems Distributed file systems Pseudo file systems

AITA\SWBU\SOLARIS\08

Disk-based file systems ufs The UNIX file system in the Solaris OE is based on the Berkeley fast file system. hsfs The High Sierra file system is a special-purpose file system developed for use on CD-ROM media.

AITA\SWBU\SOLARIS\08

pcfs The PC file system is a UNIX implementation of the DOS FAT file system. The pcfs allows the Solaris OE to access PC-DOS formatted file systems. udfs The Universal Disk Format file system is used for optical storage targeted at DVD and CD-ROM media.

AITA\SWBU\SOLARIS\08

Distributed File Systems


NFS The network file system allows users to share files among many types of systems on the network.

AITA\SWBU\SOLARIS\08

Psuedo File Systems tmps The temporary file system stores files in memory, which avoids the overhead of writing to a disk-based file system. The tmpfs file system is created and destroyed every time the system is rebooted. swapfs The swap file system is used by the kernel to manage swap space on disks.
AITA\SWBU\SOLARIS\08 6

fdfs The file descriptor file system provides explicit names for opening file by using file descriptors (eg:- /dev/fd/0, /dev/fd/1) in the /dev/fd directory.

AITA\SWBU\SOLARIS\08

procfs The process file system contains a list of active processes in the /proc directory. The processes are listed by process number. mntfs The mount file system provides read-only information from the kernel about locally mounted file systems.

AITA\SWBU\SOLARIS\08

Viewing the Solaris OE ufs File System


Disk Label (VTOC) The VTOC contains the partition table for the disk. The VTOC resides in the first disk sectr (512 bytes blocks). Only the first disk slice contains a VTOC.

AITA\SWBU\SOLARIS\08

Boot Block The bootstrap program (bootblk) resides in the 15 disk sectors that follow the VTOC. Only the / (root) file system has an active boot block

AITA\SWBU\SOLARIS\08

10

Primary Superblock The superblock resides in the next 16 sectors that follow that boot block. The superblock contains the following information: The number of data blocks The number of cylinder groups The size of a data block and fragment A description of the hardware, derived from the label The name of the mount point File system state flag: clean, stable, active, logging or unknown

AITA\SWBU\SOLARIS\08

11

Backup Superblocks
When the file system is created, each cylinder group replicates the superblock beginning at Sector 32. The replication protects the critical data in the superblock against catastrophic loss.

AITA\SWBU\SOLARIS\08

12

Cylinder Groups
Each file system is divided into cylinder groups with a minimum default size of 16 cylinders per group. Cylinder groups improve disk access

AITA\SWBU\SOLARIS\08

13

Cylinder Group Blocks


Cylinder group block is a table in each cylinder group that describes the cylinder group: The number of inodes The number of data blocks in the cylinder group The number of directories Free blocks, free inodes, and free fragments in the cylinder group The free block map The used inode map

AITA\SWBU\SOLARIS\08

14

The ufs inode


An inode contains the following information about a file: The type of file and the access modes The UID & GID of the files owner and group The size of the file The link count The time the flag was last accessed and modified and the inode changes The total number of data blocks used by or allocated to the file Two types of pointers: direct pointers and indirect pointers
AITA\SWBU\SOLARIS\08 15

Solaris ufs File System Structure


Disk label bootblk Primary superblock First Cylinder Group Backup superblock Cylinder Group Block Inode Table Data blocks Second Cylinder Group Backup superblock Cylinder Group Block Inode Table Data blocks
AITA\SWBU\SOLARIS\08 16

Direct Pointers Inside the inode there are 12 direct pointers, which contain addresses for the files first 12 data blocks. The 12 direct pointers can each reference 8-Kbyte data blocks for a file that is upto 96Kbytes

AITA\SWBU\SOLARIS\08

17

Indirect Pointers
Single indirect pointer Refers to a file system block that contains pointers to data blocks. This file system block contains 2048 additional addresses of 8=Kbyte data blocks, which can point to an additional 16 Mbytes of data

AITA\SWBU\SOLARIS\08

18

Double indirect pointer Refers to file system block that contains single indirect pointers. Each indirect pointer refers to a file system block that contains the data block pointer. Double indirect pointers point to an additional 32Gbytes of data

AITA\SWBU\SOLARIS\08

19

Triple indirect pointer


Can reference up to an additional 64 Tbytes of data. However, the maximum size of a ufs file system is limited to 1 Tbyte due to the maximum address space of 32-bits for the device drivers

AITA\SWBU\SOLARIS\08

20

AITA\SWBU\SOLARIS\08

21

Data Blocks
The remaining space allocated to the ufs file system holds data blocks. Data blocks are allocated, by default, in 8-Kbyte logical block sizes. The blocks are further divided into 1-Kbyte fragments.

AITA\SWBU\SOLARIS\08

22

Creating a New ufs File System


Using the newfs command As a root user to create a new ufs file system: # newfs /dev/rdsk/c1t0d0s0 The newfs command asks for confirmation before continuing

AITA\SWBU\SOLARIS\08

23

minfree value
To display the minfree value for the filesystem: #fstyp -v /dev/rdsk/c0t0d0s0 To change the minfree value: #tunefs -m 1 /dev/rdsk/c1t0d0s0 Changes the minfree value from the default 10% to 1%

AITA\SWBU\SOLARIS\08

24

Checking the File System by using the fsck command


Data Inconsistencies checked by the fsck command Superblock Consistency Cylinder Group Block Consistency Inode Consistency Data Block Consistency The lost+found directory - fsck puts the files and directories that are allocated but unreferenced in this directory

AITA\SWBU\SOLARIS\08

25

Noninteractive Mode During a normal system boot, fsck command operates in noninteractive mode, which is often referred to as preen, or silent mode. Addresses only minor inconsistencies. Interactive Mode Lists each problem it encounters, followed by a suggested corrective action in the form of a question that requires a yes or no response.

AITA\SWBU\SOLARIS\08

26

fsck usage #fsck /dev/rdsk/c0t0d0s7 #fsck /export/home #fsck -o f,p /dev/rdsk/c0t0d0s5 - checks and repairs the file system with the force (f) and preen (p) options

AITA\SWBU\SOLARIS\08

27

Using Backup Superblocks

To display the alternative superblocks:


#newfs -N /dev/rdsk/c0t0d0s7

To use a backup superblock:


#fsck -o b=32 /dev/rdsk/c0t0d0s7

AITA\SWBU\SOLARIS\08

28

Monitoring File System Use


df - Displays the number of free disk blocks df -options mount_point du - Summarizes disk use du -options directory quot - Summarizes file system ownership quot -options filesystem

AITA\SWBU\SOLARIS\08

29

Potrebbero piacerti anche