Linux+ Guide to Linux Certification Chapter Six Linux Filesystem Administration.

  • Published on

  • View

  • Download

Embed Size (px)


  • ObjectivesIdentify the structure and types of device files in the /dev directoryUnderstand common filesystem types and their featuresMount and unmount floppy disks to and from the Linux directory treeMount and unmount CD-ROMs to and from the Linux directory tree

  • ObjectivesCreate hard disk partitionsMount and unmount hard disk partitions to and from the Linux directory treeMonitor free space on mounted filesystemsCheck filesystems for errorsUse hard disk quotas to limit user space usage

  • The /dev DirectoryDevice fileFile used by Linux commands that represent a specific device on the systemThese files are typically found in the /dev directoryCharacter devicesTransfer data to and from the system one data bit at a time

  • The /dev DirectoryBlock devicesStorage devices that transfer to and from the system in chunks of many bits by caching the information in RAMAre represented by block device filesCan transfer information must faster than character devices

  • The /dev DirectoryTable 6-1: Common device files

  • The /dev DirectoryTable 6-1 (continued): Common device files

  • The /dev DirectoryMajor numberUsed by the kernel to identify what device driver to call to interact properly with a given category of hardwareMinor numberUsed by the kernel to identify which specific hardware device, within a given category, to use a driver to communicate with

  • FilesystemsFilesystemThe organization imposed on a physical storage medium that is used to manage the storage and retrieval of dataFormattingThe process where a filesystem is placed on a disk drive

  • Filesystem TypesTable 6-2: Common Linux filesystems

  • Filesystem TypesTable 6-2 (continued): Common Linux filesystems

  • MountingMountingProcess used to associate a device with a directory in the logical directory tree such that users may store data on that deviceTerm originated in the 1960s, when information was stored on large tape reels that had to be mounted on computers to make the data availableMount pointDirectory in a file structure to which something is mounted

  • MountingFigure 6-1: The directory structure prior to mounting

  • MountingFigure 6-2: The directory structure after mounting a floppy device

  • MountingWhen the Linux filesystem is first turned on, a filesystem present on the hard drive is mounted to the / directoryRoot filesystemFilesystem that contains the most files that up the operating systemShould have enough free space to prevent errors and slow performance

  • Working with Floppy DisksWhen transferring small amounts of information from computer to computer, it is commonplace to use floppy disk removable media to store the filesHowever, floppy disks must be prepared before they are used in LinuxRecall that each disk device must be formatted with a filesystem prior to being used to store files

  • Working with Floppy DisksTable 6-3: Commands used to create filesystems

  • Working with Floppy DisksTable 6-4: Commands useful when mounting and unmounting filesystems

  • Working with Floppy DisksFigure 6-3: Mounting a floppy device using a GUI environment

  • Working with Floppy DisksFigure 6-4: Viewing the contents of a floppy device in a GUI environment

  • Working with Floppy DisksFigure 6-5: Unmounting a floppy device in a GUI environment

  • Working with CD-ROMsLinux systems have an ATAPI compliant IDE CD-ROM drive that attaches to the mainboard via an IDE ribbon cableThese CD-ROMs act as a normal IDE hard disk, and must be configured on of the four configurations below, as seen with their associated device files:Primary master (/dev/hda)Primary slave (/dev/hdb)Secondary master (/dev/hdc)Secondary slave (/dev/hdd)

  • Working with Floppy DisksFigure 6-6: Viewing the contents of a CD-ROM in a GUI environment

  • Working with Floppy DisksFigure 6-7: Unmounting a CD-ROM device in a GUI environment

  • Working with Hard DisksIDE hard disk drives attach to the mainboard with an IDE cable and must be configured on one of four configurations, each of which has a different device file:Primary master (/dev/hda)Primary slave (/dev/hdb)Secondary master (/dev/hdc)Secondary slave (/dev/hdd)

  • Working with Hard DisksSCSI hard disks are well-suited to Linux servers that require a great deal of storage space for programs and user filesDifferent device files associated with SCSI hard disks:First SCSI hard disk drive (/dev/sda)Second SCSI hard disk drive (/dev/sdb)Third SCSI hard disk drive (/dev/sdc)

  • Working with Hard DisksDifferent device files associated with SCSI hard disks (continued):Fourth SCSI hard disk drive (/dev/sdd)Fifth SCSI hard disk drive (/dev/sde)Sixth SCSI hard disk drive (/dev/sdf)And so on

  • Hard Disk PartitioningRecall that hard disks have the largest storage capacity of any device used to store information on a regular basisThis poses some problems, because as the size of a disk increases, organization becomes more difficult and the chance of error increasesPartitionA physical division of a hard disk drive

  • Hard Disk PartitioningIt is good practice to use more than just two partitions on Linux system as this division can be useful to:Segregate different types of dataAllow for the use of more than one type of filesystem on one hard disk driveReduce the chance the filesystem corruption will render a system unusableSpeed up access to stored data by keeping filesystems as small as possible

  • Hard Disk PartitioningTracksArea on a hard disk that form a concentric circle of sectorsSectorSmallest unit of data storage on a hard diskBlockUnit of data commonly used by filesystem commands

  • Hard Disk PartitioningCylinderSeries of tracks on a hard disk that are written to simultaneously by the magnetic heads in a hard disk driveFigure 6-8: The physical areas of a hard disk

  • Hard Disk PartitioningTable 6-5: Common hard disk partition device files for /dev/had and /dev/sda

  • Hard Disk PartitioningFigure 6-9: A sample Linux partitioning strategy

  • Hard Disk PartitioningFigure 6-10: A sample dual-boot Linux partitioning strategy

  • Working with Hard Disk PartitionsDisk Druid is an easy-to-use partitioning tool used with Red Hat Linux, specifically designed for installation onlyTo create partitions after installations, you use the fdisk commandTo use the fdisk command, you simply specify the hard disk partition as an argument

  • Disk UsageThere may be several filesystems mounted to the directory treeThe more filesystems that are used, the less likely it is that a corrupted filesystem may interfere with normal system operationsConversely, using more filesystems typically results in less hard disk space per filesystem and may result in system errors if certain filesystems fill up with dataThe easiest method for monitoring free space by mounted filesystem is to use the df (disk free space) command

  • Checking Filesystems for ErrorsFilesystem corruptionErrors in a filesystem structure that prevent the retrieval of stored dataSyncingProcess of writing data to the hard disk drive that was stored in RAMBad blocksThose areas of a storage medium used by filesystem commands

  • Checking Filesystems for ErrorsTable 6-6: Common options to the fsck command

  • Hard Disk QuotasSoft limitsLimit imposed that can be exceeded for a certain period of timeHard limitLimit imposed that cannot be exceeded

  • Chapter SummaryDisk devices are represented by device files that reside in the /dev directoryEach disk drive must contain a filesystem, which is then mounted to the Linux directory tree for usage using the mount commandHard disks must be partitioned into distinct sections before filesystems are created on those partitions

  • Chapter SummaryThere are many different filesystems available to LinuxIt is important to monitor disk usage using the df, du, and dumpe2fs commands to avoid running out of storage spaceIf hard disk space is limited, you can use hard disk quotas to limit the space that each user has on filesystems


View more >