Linux+ Guide to Linux Certification, Second Edition

  • Published on
    18-Jan-2016

  • View
    34

  • Download
    0

Embed Size (px)

DESCRIPTION

Linux+ Guide to Linux Certification, Second Edition. Chapter 6 Linux Filesystem Administration. Objectives. Identify the structure and types of device files in the /dev directory Understand common filesystem types and their features - PowerPoint PPT Presentation

Transcript

  • Linux+ Guide to Linux Certification, Second EditionChapter 6Linux Filesystem Administration

    Linux+ Guide to Linux Certification, 2e

  • 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 treeCreate hard disk partitions

    Linux+ Guide to Linux Certification, 2e

  • Objectives (continued)Mount 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

    Linux+ Guide to Linux Certification, 2e

  • The /dev DirectoryDevice file: File representing a system deviceTypically found in /dev directoryCharacter devices: Transfer data to and from system character by characterBlock devices: Transfer chunks or blocks of data using physical memory as a bufferFast data transferCD-ROM, HDD, floppy disks

    Linux+ Guide to Linux Certification, 2e

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

    Linux+ Guide to Linux Certification, 2e

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

    Linux+ Guide to Linux Certification, 2e

  • The /dev Directory (continued)Major number: Points to the devices driver in the Linux kernelMinor number: Indicates the particular deviceDevice file type (block or character), major number, and minor number make up a device files unique characteristicsmknod command: Can be used to re-create a corrupted device fileMust know file type, major, and minor numbers

    Linux+ Guide to Linux Certification, 2e

  • FilesystemsFilesystem: Organization imposed on physical storage mediaFormatting: Creating a filesystem on a device

    Linux+ Guide to Linux Certification, 2e

  • Filesystem TypesTable 6-2: Common Linux filesystems

    Linux+ Guide to Linux Certification, 2e

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

    Linux+ Guide to Linux Certification, 2e

  • MountingMounting: Making a device accessible to users via the logical directory treeMount point: Directory to which a device is attachedAny existing directory can be a mount pointRoot filesystem: When Linux filesystem first turned on, a filesystem on the hard drive is mounted to the / directoryContains most OS files

    Linux+ Guide to Linux Certification, 2e

  • Mounting (continued)Figure 6-1: The directory structure prior to mounting

    Linux+ Guide to Linux Certification, 2e

  • Mounting (continued)Figure 6-2: The directory structure after mounting a floppy device

    Linux+ Guide to Linux Certification, 2e

  • Mounting (continued)mount command: Used to mount devices to mount point directoriesWith no options or arguments, lists currently mounted filesystemsumount command: Used to unmount devices from mount point directories

    Linux+ Guide to Linux Certification, 2e

  • Working with Floppy DisksFloppy disks must be prepared before use Formatted with a filesystemmkfs (make filesystem) command: Used to format a disk device with a filesystemt option: Specifies filesystem typeDefault is ext2 filesystemTo mount or unmount floppies, must ensure that no user is currently using the mount point directoryfuser command: With the u option, lists users using a directory

    Linux+ Guide to Linux Certification, 2e

  • Working with Floppy Disks (continued)Table 6-3: Commands used to create filesystems

    Linux+ Guide to Linux Certification, 2e

  • Working with Floppy Disks (continued)/etc/fstab file: Used to mount devices at boot timeAlso consulted when users do not specify enough mount command argumentsSix fields: Device to mount, mount point, type, mount options, dump#, fsck#

    Linux+ Guide to Linux Certification, 2e

  • Working with Floppy Disks (continued)Table 6-4: Useful commands when mounting and unmounting filesystems

    Linux+ Guide to Linux Certification, 2e

  • Working with Floppy Disks (continued)Figure 6-3: Mounting a floppy device using a GUI environment

    Linux+ Guide to Linux Certification, 2e

  • Working with Floppy Disks (continued)Figure 6-4: Accessing filesystem devices in the KDE desktop

    Linux+ Guide to Linux Certification, 2e

  • Working with CD-ROMsMost Linux systems have ATAPI-compliant IDE CD-ROM driveActs as a normal IDE hard diskMust configure in one of the following:Primary master (/dev/hda)Primary slave (/dev/hdb)Secondary master (/dev/hdc)Secondary slave (/dev/hdd)

    Linux+ Guide to Linux Certification, 2e

  • Working with CD-ROMs (continued)Typically use iso9660 filesystem type and are not writableMount with r (read-only) optionCannot be ejected until properly unmounted

    Linux+ Guide to Linux Certification, 2e

  • Working with Hard DisksIDE HDDs must be configured in one of the following:Primary master (/dev/hda)Primary slave (/dev/hdb)Secondary master (/dev/hdc)Secondary slave (/dev/hdd)Different device file for each

    Linux+ Guide to Linux Certification, 2e

  • Working with Hard Disks (continued)SCSI hard disks well-suited to Linux serversFaster access speedMultiple hard drives can be attached to a controllerAssociated with different device filesFirst SCSI HDD (/dev/sda)Second SCSI HDD (/dev/sdb)Third SCSI HDD (/dev/sdc)And so on

    Linux+ Guide to Linux Certification, 2e

  • Hard Disk PartitioningAs disk size increases, organization becomes more difficult and chance of error increasesPartition: A physical division of an HDD; can have own filesystemGood practice to use more than two partitions Segregate different types of dataAllow for use of multiple filesystem types on one HDDReduce chance that filesystem corruption will render a system unusableSpeeds up access to stored data; keep filesystems small

    Linux+ Guide to Linux Certification, 2e

  • Hard Disk Partitioning (continued)Track: Areas on a hard disk that form a concentric circle of sectorsSector: Smallest unit of data storage on a hard diskBlock: Combination of sectors; commonly used by filesystem commandsCylinder: Series consisting of the same concentric track on all of the metal platters inside a HDDPartition definitions stored in first readable sector of the hard diskMaster Boot Record (MBR) or master boot block (MBB)

    Linux+ Guide to Linux Certification, 2e

  • Hard Disk Partitioning (continued)Figure 6-5: The physical areas of a hard disk

    Linux+ Guide to Linux Certification, 2e

  • Hard Disk Partitioning (continued)Table 6-5: Common hard disk partition device files for /dev/hda and /dev/sda

    Linux+ Guide to Linux Certification, 2e

  • Hard Disk Partitioning (continued)Table 6-5 (continued): Common hard disk partition device files for /dev/hda and /dev/sda

    Linux+ Guide to Linux Certification, 2e

  • Hard Disk Partitioning (continued)Figure 6-6: A sample Linux partitioning strategy

    Linux+ Guide to Linux Certification, 2e

  • Hard Disk Partitioning (continued)Figure 6-7: A sample dual-boot Linux partitioning strategy

    Linux+ Guide to Linux Certification, 2e

  • Working with Hard Disk Partitionsfdisk command: Create partitions after installationSpecify hard disk partition as an argumenttune2fs command: Create a journal file on the filesystemConvert ext2 to ext3Edit /etc/fstab file to allow system to mount new filesystems automatically at boot time

    Linux+ Guide to Linux Certification, 2e

  • Monitoring FilesystemsCheck mounted filesystems periodicallyErrorsDisk Space usageInode usage

    Linux+ Guide to Linux Certification, 2e

  • Disk UsageUsing more filesystems typically results in less hard disk space per filesystemErrors when filesystems fill up with datae.g., free space on / filesystem falls below 10%df (disk free space) command: Monitor free space used by mounted filesystemsh option: More user friendly

    Linux+ Guide to Linux Certification, 2e

  • Disk Usage (continued)du (directory usage) command: View size of a directory and contents in Kilobytess option: Summarizes outputdumpe2fs command: View total number of inodes and free inodes for ext2 or ext3 filesystemUse h option

    Linux+ Guide to Linux Certification, 2e

  • Checking Filesystems for ErrorsFilesystem corruption: Errors in filesystem structure preventing retrieval of dataCommonly occurs due to improper system shutdownSyncing: Process of writing data stored in RAM to the HDDBad blocks: Unusable areas of a disk Cannot hold a magnetic charge

    Linux+ Guide to Linux Certification, 2e

  • Checking Filesystems for Errors (continued)fsck (filesystem check) command: Check a filesystem for errorsFilesystem must be unmountedf option used to perform full checke2fsck command: Check ext2 and ext3 filesystemsReiserfsck: Check reiserfs filesystems

    Linux+ Guide to Linux Certification, 2e

  • Checking Filesystems for Errors (continued)Table 6-6: Common options to the fsck command

    Linux+ Guide to Linux Certification, 2e

  • Hard Disk QuotasIf several users on a system, must be enough hard disk space for each users filesHard disk quotas: User limits on filesystem usageRestrict number of files/directories or total disk space usageSoft limit: User may exceed quota brieflyHard limit: Limit cannot be exceeded

    Linux+ Guide to Linux Certification, 2e

  • Hard Disk Quotas (continued)quotaon and quotaoff commands: Toggle quotas on and offedquota command: Edit user quotasrepquota command: Report user quotasquota command: Allows regular users to view quotas and current usage

    Linux+ Guide to Linux Certification, 2e

Recommended

View more >