290 likes | 437 Views
Managing the Solaris OE File System. Solaris OE File Systems. Disk-based file systems Distributed file systems Pseudo file systems. Disk-based file systems. “ufs” The UNIX file system in the Solaris OE is based on the Berkeley fast file system. “hsfs”
E N D
Solaris OE File Systems • Disk-based file systems • Distributed file systems • Pseudo file systems
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.
“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. • “udf” • The Universal Disk Format file system is used for optical storage targeted at DVD and CD-ROM media.
Distributed File Systems • NFS • The network file system allows users to share files among many types of systems on the network.
Psuedo File Systems • “tmpfs” • 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.
“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.
“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.
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.
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
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
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.
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
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
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 file’s 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
Direct Pointers • Inside the inode there are 12 direct pointers, which contain addresses for the file’s first 12 data blocks. • The 12 direct pointers can each reference 8-Kbyte data blocks for a file that is upto 96Kbytes
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
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
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
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.
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
“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%
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
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.
“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
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”
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”