190 likes | 345 Views
Objectives. Manage and install new file systems. Understanding the File System. During installation Partitions created ext3 or similar file system. Reviewing File System Types. File system Collection of data structured in certain way so that it can be efficiently accessed Superblock
E N D
Objectives • Manage and install new file systems
Understanding the File System • During installation • Partitions created • ext3 or similar file system
Reviewing File System Types • File system • Collection of data structured in certain way so that it can be efficiently accessed • Superblock • Collection of information about file system as a whole • Found in ext2 and ext3
Reviewing File System Types • ext2 and ext3 file systems • Do not place files one after another filling up each area of hard disk in order • Permit file to grow in size without being as likely to be broken into pieces • Never need to defragment • ext3 • Journaling file system
Reviewing File System Types • Other journaling file systems • ReiserFS • Journaling File System (JFS) • Virtual file system model • Used by kernel • Separates file system type from operation program wants to perform • Linux can support any new file system type for which driver is available
Reviewing File System Types • Each file system must be mounted • Mount command • Without any parameters • List of currently mounted file systems
Checking File System Status • Root file system becomes full • Linux kernel can crash • df command displays space usage information for each file system that is currently mounted • If file system becomes full, must free space in directories where file system is mounted
Checking File System Status • Immediately free space • Look for large or numerous files in /tmp directory that can be deleted • Look for large or numerous files in /var subdirectories • Move system log file (/var/log/messages) to another file system that isn’t as full • See if any user subdirectories are using unusually large amounts of disk space • Delete unused archive files
Checking File System Status • du utility lists size of directory and all its subdirectories • du –max-depth=1 • Various graphical tools and system administration scripts to check status of file systems • Hardware Browser • KDiskFree - kdf
Checking File Systems • fsck utility • Checks integrity of file systems • Usually pronounced fizz-check • Can also repair minor file system problems • Must be run on file system that is not mounted • Example: fsck /dev/hda1
Creating New File Systems • Adding file system means • Adding hard disk device to your system • Making hard disk available to Linux by: • Formatting • Mounting
Using the fdisk Utility • Modifications to partition table only effective when you write changes to disk with w command to exit fdisk • Example: fdisk /dev/sdb
Formatting File Systems • mke2fs command • Formats partition • Erasing all information on it • Organizes space for data to be recorded • Partition can be used by Linux • Use -j option to add journaling • For ext3 • Example: mke2fs -j /dev/sdb2
Managing Swap Space • mkswap command • Format partition set up using fdisk as swap space • Example: mkswap /dev/hda2 • swapon command activates swap space
Formatting File Systems • fdformat command • Format 3.5-inch disks • gfloppy • Graphical removable disk formatter • tune2fs utility • Examine superblock of file system • Make minor changes to file system parameters
Mounting New File Systems • mount command • To access file system • Indicate: • Device on which file system is stored • Directory where file system should be made accessible in directory structure • Example: mount -t ext3 /dev/sdb2 /archive
Automating File System Mounting • /etc/fstab configuration file • Key to automounting file systems • Contains one line for each file system to automount • Add options when executing mount command • Example: mount -t ext3 -o defaults /dev/sdb2 /archive