Chapter 11
Configuring disks.
Hard disk mechanics:
Platters
Tracks
Sectors
Setup during Low level format
we rarely do low level formats outside of the factory now.
Partitioning divdes disk up
into partitions (slices)
Usually one partiton -> one slice.
Creating partitions is done with the 'format' command.
High-level format
Puts the structures down used by the file system.
Splits partition into cylinder groups
Tries to keep one file within a cylinder group.
Tries to distribute files evenly between cylinder groups.
(minmze fragramentation)
4 types of blocks:
Boot Block... (used for system booting)
Suberblock Stores description of the filesystem
Inode Stores description of file
Data Block Stores the actual data of a file. (also used for
indirect blocks)
Restoring a bad superblock.
Losing the superblock is BAD.
it tells you where everything
else for the filesystem is.
When the system does a high-level format, it creates spare copies
of the superblock.
There is ALWAYS a spare
superblock at block 32. Others spread
across the partition... Printed wien doing a newfs.
newfs -N will do a dummy run
and print out where the superbloc
copies would normally be.
Inode:
contains:
File type
mode
# links (names)
uid
gid
15 block pointers
atime (access time)
mtime (mod time)
ctime (last catalog change)
Disk Types
IDE Integrated
Disk Electronics.
SCSI Small
Computer System Interface
SCSI is more expensive, but the disk controllers do more... Can
often be faster for many multi-user and server applications.
Can have up to 8 or 16 devices on one controller (and chain)
IDE cheap. Can only have 2 devices per
controller (and chain)
Disk names:
Cn Controller
Tn Target
Dn Device
Sn
Slice (partition)
Raw Vs Block
Raw does buffering... Best for most file system operations. --
faster.. System can cache and write back.
Block does no bufferring. System does reads & writes when program
says. Good for FSCK, newfs and DataBase apps.
Adding removing devices on the fly
(hot swapping)
devfsadm command.
Options:
-c class (disk, tape, port, audio, pseudo)
-C cleanup (removes dangling links)
-s supress
do a test run.. say what you WOULD do, bot don't change things.
-v verbose
-i driver
instance
load a s0ecific instance of a driver