chap03 managing the solaris oe file system
TRANSCRIPT
-
7/30/2019 Chap03 Managing the Solaris OE File System
1/29
1AITA\SWBU\SOLARIS\08
Managing the Solaris OE File System
-
7/30/2019 Chap03 Managing the Solaris OE File System
2/29
2AITA\SWBU\SOLARIS\08
Solaris OE File Systems
Disk-based file systems
Distributed file systems
Pseudo file systems
-
7/30/2019 Chap03 Managing the Solaris OE File System
3/29
3AITA\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.
-
7/30/2019 Chap03 Managing the Solaris OE File System
4/29
4AITA\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.
-
7/30/2019 Chap03 Managing the Solaris OE File System
5/29
5AITA\SWBU\SOLARIS\08
Distributed File Systems
NFS
The network file system allows users to share files among
many types of systems on the network.
-
7/30/2019 Chap03 Managing the Solaris OE File System
6/29
6AITA\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 tomanage swap space on disks.
-
7/30/2019 Chap03 Managing the Solaris OE File System
7/29
7AITA\SWBU\SOLARIS\08
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.
-
7/30/2019 Chap03 Managing the Solaris OE File System
8/29
8AITA\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.
-
7/30/2019 Chap03 Managing the Solaris OE File System
9/29
9AITA\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.
-
7/30/2019 Chap03 Managing the Solaris OE File System
10/29
10AITA\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
-
7/30/2019 Chap03 Managing the Solaris OE File System
11/29
11AITA\SWBU\SOLARIS\08
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
-
7/30/2019 Chap03 Managing the Solaris OE File System
12/29
12AITA\SWBU\SOLARIS\08
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 superblockagainst catastrophic loss.
-
7/30/2019 Chap03 Managing the Solaris OE File System
13/29
13AITA\SWBU\SOLARIS\08
Cylinder Groups
Each file system is divided into cylinder groups with aminimum default size of 16 cylinders per group.
Cylinder groups improve disk access
-
7/30/2019 Chap03 Managing the Solaris OE File System
14/29
14AITA\SWBU\SOLARIS\08
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
-
7/30/2019 Chap03 Managing the Solaris OE File System
15/29
15AITA\SWBU\SOLARIS\08
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
-
7/30/2019 Chap03 Managing the Solaris OE File System
16/29
16AITA\SWBU\SOLARIS\08
Solaris ufs File System Structure
Disk label
bootblk
Primary superblock
First Cylinder Group
Backup superblock
Cylinder Group Block
Inode TableData blocks
Second Cylinder Group
Backup superblock
Cylinder Group BlockInode Table
Data blocks
-
7/30/2019 Chap03 Managing the Solaris OE File System
17/29
17AITA\SWBU\SOLARIS\08
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
-
7/30/2019 Chap03 Managing the Solaris OE File System
18/29
18AITA\SWBU\SOLARIS\08
Indirect Pointers
Single indirect pointer
Refers to a file system block that contains pointers to datablocks.
This file system block contains 2048 additional addresses of
8=Kbyte data blocks, which can point to an additional 16
Mbytes of data
-
7/30/2019 Chap03 Managing the Solaris OE File System
19/29
19AITA\SWBU\SOLARIS\08
Double indirect pointer
Refers to file system block that contains single indirectpointers.
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
-
7/30/2019 Chap03 Managing the Solaris OE File System
20/29
20AITA\SWBU\SOLARIS\08
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 thedevice drivers
-
7/30/2019 Chap03 Managing the Solaris OE File System
21/29
21AITA\SWBU\SOLARIS\08
-
7/30/2019 Chap03 Managing the Solaris OE File System
22/29
22AITA\SWBU\SOLARIS\08
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.
-
7/30/2019 Chap03 Managing the Solaris OE File System
23/29
23AITA\SWBU\SOLARIS\08
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 beforecontinuing
-
7/30/2019 Chap03 Managing the Solaris OE File System
24/29
24AITA\SWBU\SOLARIS\08
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%
-
7/30/2019 Chap03 Managing the Solaris OE File System
25/29
25AITA\SWBU\SOLARIS\08
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 directoriesthat are allocated but unreferenced in this directory
-
7/30/2019 Chap03 Managing the Solaris OE File System
26/29
26AITA\SWBU\SOLARIS\08
Noninteractive Mode
During a normal system boot, fsck command operates innoninteractive mode, which is often referred to as preen, orsilent mode.
Addresses only minor inconsistencies.
Interactive Mode
Lists each problem it encounters, followed by a suggestedcorrective action in the form of a question that requires a yesor no response.
-
7/30/2019 Chap03 Managing the Solaris OE File System
27/29
27AITA\SWBU\SOLARIS\08
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
-
7/30/2019 Chap03 Managing the Solaris OE File System
28/29
28AITA\SWBU\SOLARIS\08
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
-
7/30/2019 Chap03 Managing the Solaris OE File System
29/29
29AITA\SWBU\SOLARIS\08
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