Linux Filesystem Administration

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

What is a device file?

  • A directory containing user configuration files.
  • A program for managing system processes.
  • A symbolic link to a kernel module.
  • A file representing a system device. (correct)

Which directory commonly contains device files in Linux?

  • /etc
  • /tmp
  • /var
  • /dev (correct)

What is the key distinction between character devices and block devices?

  • Character devices transfer data character-by-character, while block devices transfer chunks of data. (correct)
  • Character devices are used for storage, while block devices are used for networking.
  • Character devices are faster than block devices.
  • Character devices require physical memory, while block devices do not.

Which of the following is typically a block device?

<p>A hard disk (B)</p>
Signup and view all the answers

What does the 'major number' in a device file signify?

<p>The device's driver in the Linux kernel (B)</p>
Signup and view all the answers

What does the 'minor number' in a device file represent?

<p>The particular device. (C)</p>
Signup and view all the answers

Which command is used to re-create a corrupted device file?

<p>mknod (C)</p>
Signup and view all the answers

Where can you view a list of devices currently used on the system and their major numbers?

<p>/proc/devices (B)</p>
Signup and view all the answers

What is the primary purpose of a filesystem?

<p>To manage the storage and retrieval of data on physical storage media. (A)</p>
Signup and view all the answers

Which of the following is a common component of all filesystems?

<p>Superblock (A)</p>
Signup and view all the answers

What must storage media contain before it can be used?

<p>A filesystem (D)</p>
Signup and view all the answers

What is a 'mount point'?

<p>A directory to which a device is attached. (C)</p>
Signup and view all the answers

What does 'mounting' a device do?

<p>It makes a device accessible to users via the logical directory tree. (C)</p>
Signup and view all the answers

What happens to the contents of a mount point when a device is mounted?

<p>The contents of the mount point are temporarily covered up by the mounted device. (B)</p>
Signup and view all the answers

Why is it recommended to create empty directories specifically for mounting devices?

<p>To prevent making files inaccessible. (D)</p>
Signup and view all the answers

Which filesystem is mounted to the / directory when a Linux system first starts?

<p>The root filesystem (C)</p>
Signup and view all the answers

Which command is used to mount devices to mount point directories?

<p>mount (C)</p>
Signup and view all the answers

Which command is used to unmount devices from mount point directories?

<p>umount (D)</p>
Signup and view all the answers

What is the most common type of removable media?

<p>USB flash memory drives (B)</p>
Signup and view all the answers

How are USB flash memory drives typically recognized by operating systems?

<p>SCSI drives (B)</p>
Signup and view all the answers

What command is used to create a new filesystem on a USB flash memory drive?

<p>mkfs (A)</p>
Signup and view all the answers

Which option is used with the mkfs command to specify the filesystem type?

<p>-t (D)</p>
Signup and view all the answers

What command can be used to list currently mounted filesystems?

<p>mount (B)</p>
Signup and view all the answers

Which command provides a more user-friendly display of mounted filesystems?

<p>df (A)</p>
Signup and view all the answers

Which command can check whether a directory is being used by any users?

<p>fuser (B)</p>
Signup and view all the answers

Which types of filesystem are typically used by CDs and DVDs?

<p>ISO 9660 and UDF (B)</p>
Signup and view all the answers

How should CDs and DVDs be mounted when accessed using Linux?

<p>With the -r (read-only) option (D)</p>
Signup and view all the answers

What must be done before a CD or DVD can be physically ejected from the drive?

<p>It must be properly unmounted. (B)</p>
Signup and view all the answers

What is the name for image files that can be created to contain other files, often used for CDs/DVDs?

<p>ISO images (A)</p>
Signup and view all the answers

Which command is used to create an ISO image from a directory of files?

<p>mkisofs (B)</p>
Signup and view all the answers

What are SATA and SCSI?

<p>Types of hard disks. (A)</p>
Signup and view all the answers

Which of the following are types of hard disks?

<p>PATA, SATA, and SCSI/SAS (D)</p>
Signup and view all the answers

What are the advantages of SATA and SCSI hard disks in Linux servers?

<p>Faster access speed (A)</p>
Signup and view all the answers

What is the primary advantage of SSDs over traditional hard disks?

<p>Much faster NAND flash storage (A)</p>
Signup and view all the answers

What is a 'partition'?

<p>A physical division of a hard disk. (B)</p>
Signup and view all the answers

How many partitions does Linux require at a minimum?

<p>2 (D)</p>
Signup and view all the answers

What is stored in the first readable sector of a hard disk?

<p>Partition definitions (D)</p>
Signup and view all the answers

What is the MBR (Master Boot Record)?

<p>The first sector of a hard drive that contains partition information. (D)</p>
Signup and view all the answers

Which command is used to create partitions after installation (command line)?

<p>fdisk (C)</p>
Signup and view all the answers

Which command is used to create partitions after installation (interactive)?

<p>cfdisk (B)</p>
Signup and view all the answers

What must be done after using the fdisk and cfdisk to create partitions?

<p>Reboot the computer (B)</p>
Signup and view all the answers

Which command prepares the swap partition?

<p>mkswap (A)</p>
Signup and view all the answers

Which command activates the swap partition?

<p>swapon (D)</p>
Signup and view all the answers

What benefit is gained by creating more than the minimum required partitions in Linux?

<p>It allows for the segregation of different types of data, use of multiple filesystem types, and reduces the risk of system failure due to filesystem corruption. (A)</p>
Signup and view all the answers

What is the significance of the 'major number' in the context of Linux device files?

<p>It points to the specific device's driver in the Linux kernel. (A)</p>
Signup and view all the answers

Which characteristic distinguishes block devices from character devices in Linux?

<p>Block devices transfer data in chunks using physical memory as a buffer, while character devices transfer data character-by-character. (A)</p>
Signup and view all the answers

When a device is 'mounted' to a mount point directory, what happens to the original content of that directory?

<p>The mounted device temporarily covers up the contents of the mount point. (B)</p>
Signup and view all the answers

Under what circumstances might several different devices share the same major number?

<p>If they are of similar type (e.g., multiple hard drives). (B)</p>
Signup and view all the answers

What is the function of the fuser command in the context of mounting filesystems?

<p>It identifies which users are currently using a specified directory. (A)</p>
Signup and view all the answers

Which of the following commands is used to create an ISO image from a directory of files?

<p>mkisofs (A)</p>
Signup and view all the answers

If a hard disk uses GPT (GUID Partition Table) instead of MBR (Master Boot Record), how should partitions be created and modified?

<p>Use gdisk or parted commands. (A)</p>
Signup and view all the answers

What is the purpose of the 'inode table' in a filesystem?

<p>Contains metadata about files, such as permissions, size, and timestamps. (D)</p>
Signup and view all the answers

How are USB flash memory drives typically recognized by Linux operating systems?

<p>As SCSI drives (A)</p>
Signup and view all the answers

After creating partitions using fdisk or cfdisk, what important step must be taken?

<p>Reboot the computer to ensure proper reloading into memory. (C)</p>
Signup and view all the answers

What is a characteristic of the ISO 9660 filesystem?

<p>It's commonly used on CDs and DVDs and is typically read-only when accessed using Linux. (D)</p>
Signup and view all the answers

What is the function of the dumpe2fs command?

<p>It views the total number of inodes and free inodes for ext2, ext3, or ext4 filesystems. (C)</p>
Signup and view all the answers

What is the key advantage of SSDs over traditional hard disks?

<p>Faster data access times due to the use of NAND flash storage (C)</p>
Signup and view all the answers

In Linux, what does the term 'superblock' refer to within the context of filesystems?

<p>A critical block of data containing information about the layout and parameters of a filesystem. (D)</p>
Signup and view all the answers

What is the purpose of the pvcreate command in the context of LVM?

<p>It creates Physical Volumes (PVs). (A)</p>
Signup and view all the answers

Which of the following is a reason for checking mounted filesystems periodically?

<p>To check for errors, disk space usage, and inode usage. (C)</p>
Signup and view all the answers

When using the mkfs command to create a new filesystem on a partition, which option is utilized to specify the filesystem type?

<p>-t (D)</p>
Signup and view all the answers

In the context of disk quotas, what is a 'soft limit'?

<p>A temporary limit that a user may exceed for a specific period. (A)</p>
Signup and view all the answers

How are most removable media devices, such as USB drives, recognized by the Linux system in a GUI environment?

<p>They are automatically mounted to a directory. (A)</p>
Signup and view all the answers

Which command would you use to view the size of a directory and its contents in kilobytes?

<p>du (B)</p>
Signup and view all the answers

What is the role of the /etc/fstab file?

<p>It specifies which filesystems to mount automatically at boot time. (C)</p>
Signup and view all the answers

Why is it advisable to create empty directories specifically for mounting filesystems?

<p>To prevent making existing files inaccessible when a device is mounted. (C)</p>
Signup and view all the answers

What is the purpose of the tune2fs command?

<p>To change filesystem parameters, such as setting the interval for forcing a full filesystem check. (D)</p>
Signup and view all the answers

In the context of LVM, what is a Physical Extent (PE)?

<p>A block size for saving data, corresponding to a segment of a physical volume. (C)</p>
Signup and view all the answers

In Linux, what is the purpose of 'syncing' in the context of filesystem integrity?

<p>Saving data to the hard disk to ensure data consistency. (C)</p>
Signup and view all the answers

What is the purpose of the command vgextend?

<p>Add a new PV to an existing VG (D)</p>
Signup and view all the answers

Where are partition definitions typically stored on a hard disk?

<p>In the first readable sector of the hard disk, known as the Master Boot Record (MBR). (A)</p>
Signup and view all the answers

When working with CDs and DVDs in Linux, how should they typically be mounted?

<p>Using the <code>-r</code> (read-only) option, as they are often read-only media. (B)</p>
Signup and view all the answers

In Linux, which command is used for checking a filesystem for errors?

<p>fsck (B)</p>
Signup and view all the answers

Which of the following commands allows regular users to view their own disk quotas and current usage?

<p>quota (C)</p>
Signup and view all the answers

Which command is used to prepare a swap partition?

<p>mkswap (B)</p>
Signup and view all the answers

Which command is used to display detailed information about each Physical Volume (PV)?

<p>pvdisplay (D)</p>
Signup and view all the answers

What is the device file path for the primary master PATA drive configuration?

<p>/dev/hda (C)</p>
Signup and view all the answers

Within the /dev directory, how are device files identified?

<p>Via their associated major and minor numbers. (B)</p>
Signup and view all the answers

What is the role of Logical Volume Manager (LVM)?

<p>To create logical volumes, which can contain filesystems and be mounted to directories. (C)</p>
Signup and view all the answers

What should be done after creating GPT partitions that should contain a filesystem?

<p>Format those partitions with a filesystem (using mkfs), mount them to the directory tree, and update <code>/etc/fstab</code>. (A)</p>
Signup and view all the answers

Which command is used to unmount a mounted device?

<p>umount (B)</p>
Signup and view all the answers

A Linux system is experiencing filesystem corruption. What is a common cause of the isssue?

<p>Commonly occurs due to improper system shutdown (C)</p>
Signup and view all the answers

Which command would you use to extend the size of an LV (Logical Volume)?

<p>lvextend (A)</p>
Signup and view all the answers

A user reports slow data access times on their Linux system. Which storage technology is most likely to improve performance?

<p>SSD (C)</p>
Signup and view all the answers

Flashcards

Device file

A file representing a system device.

Character devices

Transfers data character-by-character to and from the device.

Block devices

Transfer chunks/blocks of data using physical memory.

Major number

Points to the device's driver in the Linux kernel.

Signup and view all the flashcards

Minor number

Indicates the particular device.

Signup and view all the flashcards

mknod command

Re-creates a corrupted device file.

Signup and view all the flashcards

Filesystem

Organization and management imposed on physical storage media.

Signup and view all the flashcards

Filesystem components

Superblock, Inode table, and Data blocks.

Signup and view all the flashcards

Mounting (filesystem)

Making a device accessible to users via the logical directory tree.

Signup and view all the flashcards

Mount point

Directory to which a device is attached.

Signup and view all the flashcards

Root filesystem

Filesystem on the hard drive mounted to the / directory at boot.

Signup and view all the flashcards

mount command

Mounts devices to mount point directories.

Signup and view all the flashcards

umount command

Unmounts devices from mount point directories.

Signup and view all the flashcards

mkfs command

Creates a new filesystem on a USB flash drive

Signup and view all the flashcards

fuser command

Command to check directory use.

Signup and view all the flashcards

CDs and DVDs

Use ISO 9660 or UDF filesystem type and are read-only when accessed using Linux

Signup and view all the flashcards

mkisofs command

Creates ISO image from a directory of files

Signup and view all the flashcards

Partition

Physical division of a hard disk.

Signup and view all the flashcards

Track

Area on a hard disk that forms a concentric circle

Signup and view all the flashcards

Sector

Portion of a track containing information

Signup and view all the flashcards

Block

Combination of sectors

Signup and view all the flashcards

Cylinder

Series consisting of the same concentric track on all of the metal platters inside a hard disk drive

Signup and view all the flashcards

Master Boot Record (MBR)

Stores partition definitions in first readable sector of hard disk.

Signup and view all the flashcards

fdisk command

Creates partitions after installation.

Signup and view all the flashcards

cfdisk command

Interactive graphical utility for creating, manipulating and deleting partitions

Signup and view all the flashcards

mkswap command

Prepares the swap partition.

Signup and view all the flashcards

swapon command

Activates the swap partition.

Signup and view all the flashcards

swapoff command

Deactivates the swap partition.

Signup and view all the flashcards

gdisk (GPT fdisk) command

Create and work with partitions on gpt hard disk.

Signup and view all the flashcards

Logical Volume Manager (LVM)

Creates logical volumes

Signup and view all the flashcards

pvcreate command

Create PVs

Signup and view all the flashcards

pvdisplay command

Display detailed information about each PV

Signup and view all the flashcards

vgcreate command

Create a VG that uses the space in PVs.

Signup and view all the flashcards

Physical extent (PE) size

Block size for saving data

Signup and view all the flashcards

vgdisplay command

Display detailed information about each VG

Signup and view all the flashcards

lvcreate command

Create LVs from available space in a VG

Signup and view all the flashcards

lvdisplay command

Display information about each LV

Signup and view all the flashcards

vgextend command

Add a new PV to an existing VG

Signup and view all the flashcards

lvextend command

Increase the size of an LV

Signup and view all the flashcards

df (disk free space) command

Command to check free space.

Signup and view all the flashcards

Device file specification

Specifies how to transfer data to and from a device.

Signup and view all the flashcards

Mounting Considerations

To prevent making files inaccessible by mounting a device, create empty directories specifically for mounting devices

Signup and view all the flashcards

USB Flash Drives

Most common type of removable media, recognized as SCSI drives by operating systems.

Signup and view all the flashcards

/proc/devices files

To see a list of devices currently used on the system and their major numbers, view the contents of the /proc/devices files

Signup and view all the flashcards

/etc/fstab file

After creating GPT partitions that should contain a filesystem, update the /etc/fstab file to mount them automatically.

Signup and view all the flashcards

du (directory usage) command

To view size of a directory and contents in kilobytes.

Signup and view all the flashcards

Syncing

Saving data to the hard disk.

Signup and view all the flashcards

quota command

Command that allows regular users to view their own quotas and current usage

Signup and view all the flashcards

quotaon and quotaoff commands

Turns quotas on and off

Signup and view all the flashcards

Filesystem corruption

Errors in filesystem that are commonly occurs due to improper system shutdown.

Signup and view all the flashcards

Parted command

The parted (GNU Parted) command: create and modify partitions on both MBR and GPT hard disks.

Signup and view all the flashcards

Mounting USB Drives

After a USB flash memory drive has been formatted with a filesystem, it must be mounted on the directory tree before use.

Signup and view all the flashcards

edquota command

Edit user quotas

Signup and view all the flashcards

e2fsck command

The e2fsck command: check an ext2, ext3, or ext4 filesystem.

Signup and view all the flashcards

Device file: Major number

A number in a device file that points to the device's driver in the Linux kernel.

Signup and view all the flashcards

Disk Free Space

Command to monitor free space used by mounted filesystems

Signup and view all the flashcards

tune2fs command

Used to change filesystem parameters. The -i option sets interval to forcing full system

Signup and view all the flashcards

Monitoring Filesystems

It reduces likelihood file cannot be saved due to insufficient disk space

Signup and view all the flashcards

Study Notes

Linux Filesystem Administration

  • Objectives include:
    • Identifying the structure and types of device files in the /dev directory
    • Understanding common filesystem types and their features
    • Mounting and unmounting filesystems
    • Creating and managing filesystems on various storage devices
    • Working with ISO images
    • Using LVM to create and manage logical volumes
    • Monitoring free space
    • Checking for errors
    • Using hard disk quotas to limit user space

The /dev Directory

  • A device file represents a system device
    • There is typically one file per device in /dev
    • Specifies data transfer methods
  • Character devices transfer data character-by-character
  • Block devices transfer data in chunks using physical memory to buffer the transfer
    • Results in faster data transfer
    • Examples: CDs, DVDs, USB flash drives, hard disks, and SSDs
  • Major number: a device file number that points to the device's driver in the Linux kernel
    • Different devices can share the same major number if they are the same general type
  • Minor number: indicates the particular device
  • Characteristics of device files are identified by: the file type (block or character), major number, and minor number
  • The mknod command is used to re-create a corrupted device file, use it with the file type, major, and minor numbers
  • Lists of devices and their major numbers can be viewed in the /proc/devices files

Filesystems

  • Filesystem: an organization and management layer of the physical storage media
    • Used to manage the storage and retrieval of data
  • All filesystems share three common components:
    • Superblock
    • Inode table
    • Data blocks
  • All storage media need to contain a filesystem before usable

Filesystem Types

  • The Linux operating system has access to many filesystems
    • Each with its own strengths and weaknesses
    • Several devices formatted with different filesystems under the same directory tree may be used

Mounting

  • Mounting makes a device accessible to users via the logical directory tree
  • Mount point: the directory to which a device is attached
    • The contents of the mount point will be temporarily be replaced by the mounted device
    • Any existing directory can be a mount point
  • Prevent inaccessible files by creating empty directories specifically for mounting devices
  • Root filesystem: a filesystem on the hard drive mounted to the / directory when the Linux system starts. Contains most OS files
  • The mount command is used to mount devices to mount point directories
  • The umount command unmounts devices from mount point directories

Working with USB Flash Memory Drives

  • Most common type of removable media
    • Used to store small files
    • Recognized as SCSI drives by operating systems
    • Often formatted with the DOS FAT or exFAT filesystem
  • The mkfs (make filesystem) command creates a new filesystem
    • Specify the filesystem type, device file, and use the -t switch
    • Specify a different filesystem after the -t option
  • A USB flash memory drive must be mounted before use
    • To list currently mounted filesystems, use the mount command without options or arguments
    • Alternatively, use the df (disk free space) command
  • To check if the /media/USBdrive directory is being used, use the fuser command
  • The umount command can take the device name to unmount, or the mount point directory as an argument

Working with CDs, DVDs, and ISO Images

  • Most software not downloaded from the internet is packaged on CDs and DVDs
    • Use the mount command to mount, and umount to unmount CD's
    • The device file depends on the technology used by the drive itself
  • PATA Drive Configurations:
    • Primary master (/dev/hda)
    • Primary slave (/dev/hdb)
    • Secondary master (/dev/hdc)
    • Secondary slave (/dev/hdd)
  • SATA or SCSI drives may use different names
  • Fedora Linux creates a file called /dev/cdrom to make CD/DVD identification easier
    • Which is a symbolic link to the correct device file for the first CD or DVD drive
  • CDs and DVDs typically use ISO 9660 or UDF filesystem type and are read-only when accessed using Linux
    • Mount with the -r (read-only) option
    • CDs and DVDs cannot be ejected until properly unmounted
  • The ISO 9660 filesystem type is not limited to CDs and DVDs
    • Image files, called ISO images, can be created and contain other files
  • The mkisofs command creates ISO image from a directory of files

Working with Removable Media Within a GUI Environment

  • Processes automatically mount removable media to a directory
    • Provides immediate access
  • Inserting a USB flash memory drive, CD, or DVD while in a GUI environment
    • The system automatically mounts the device to a directory
  • Many types of removable media devices:
    • External hard drives
    • Digital cameras
    • Media players
    • Smartphones
    • Tablets

Working with Hard Disks and SSDs

  • Types of hard disks:
    • PATA
    • SATA
    • SCSI/SAS
  • PATA Configurations:
    • Primary master (/dev/hda)
    • Primary slave (/dev/hdb)
    • Secondary master (/dev/hdc)
    • Secondary slave (/dev/hdd)
  • SATA and SCSI hard disks are well-suited to Linux servers
    • Faster access speed
    • Multiple hard drives can be attached to a controller
  • Different device files are associated with:
    • First SCSI HDD (/dev/sda)
    • Second SCSI HDD (/dev/sdb)
    • Third SCSI HDD (/dev/sdc)
    • Fourth SCSI hard disk drive (/dev/sdd)
    • Fifth SCSI hard disk drive (/dev/sde)
    • Sixth SCSI hard disk drive (/dev/sdf)
    • And so on...
  • SSDs use much faster NAND flash storage and provide a hard disk compatible interface

Standard Hard Disk Partitioning

  • Partition: physical division of a hard disk
    • Can have its own filesystem
  • Linux requires at least two partitions:
    • Root and swap
  • It is good practice to use more than two partitions
    • Segregate different types of data
    • Allow for use of multiple filesystem types on one hard disk drive
    • Reduce chance that filesystem corruption will render a system unusable
    • Speed up access to stored data
    • Allow for certain operating system features
  • Track: area on a hard disk that forms a concentric circle
  • Sector: portion of a track containing information
  • Block: combination of sectors
  • Cylinder: series consisting of the same concentric track on all of the metal platters inside a hard disk drive
  • Partition definitions are stored in the first readable sector of the hard disk
    • Master Boot Record (MBR) or master boot block (MBB)

Working with Standard Hard Disk Partitions

  • The fdisk command creates partitions after installation
    • Specify hard disk partition as an argument
    • Variety of options for fdisk prompt to achieve different tasks
  • The cfdisk command is an interactive graphical utility for creating, manipulating and deleting partitions
  • Reboot computer after using the fdisk and cfdisk commands to reload into memory properly
  • The mkswap command prepares the swap partition
  • The swapon command activates the swap partition
  • The swapoff command deactivates the swap partition
  • Edit /etc/fstab file to ensure that new swap partition is activated as virtual memory
  • If a hard disk uses a GPT instead of a MBR, then:
    • Use fdisk or cfdisk commands to create and modify partitions before you format them
  • The gdisk (GPT fdisk) command: create and work with partitions on GPT hard disk
  • The parted (GNU Parted) command: create and modify partitions on both MBR and GPT hard disks
  • After creating GPT partitions that should contain a filesystem:
    • Format those partitions with a filesystem using mkfs
    • Mount them to the directory tree with the mount command
    • Update the /etc/fstab file to mount them automatically

Working with the LVM

  • Logical Volume Manager (LVM) creates logical volumes
    • Can contain filesystems and can be mounted to directories
    • More flexible than standard partitions; allows use of free space across multiple hard disks
  • LVM components:
    • Physical volumes (PVs)
    • Volume groups (VGs)
    • Logical volumes (LVs)
  • The pvcreate command creates PVs
  • The pvdisplay command displays detailed information about each PV
  • The vgcreate command creates a VG that use the space in PVs
  • Physical extent (PE) size: block size for saving data
  • The vgdisplay command displays detailed information about each VG
  • The lvcreate command creates LVs from available space in a VG
  • The lvdisplay command displays information about each LV
  • Mount points of LVs are worked with like any other disk partition device file
  • The pvscan, vgscan, and lvscan commands display information about PVs, VGs, and LVs, respectively
  • The vgextend command adds a new PV to an existing VG
  • The lvextend command increases the size of an LV

Monitoring Filesystems

  • Check mounted filesystems periodically for:
    • Errors
    • Disk space usage
    • Inode usage
  • Minimizes problems by reducing the likelihood of insufficient disk space

Disk Usage

  • Using more filesystems typically results in less hard disk space per filesystem
    • Can cause errors when filesystems fill up with data
  • The df (disk free space) command monitors free space
    • Use the -h option for a more user-friendly format
    • To get information about different filesystems, mount them prior to using the command
  • The du (directory usage) command views the size of a directory and its contents in kilobytes
    • Use the -s option to summarise output
    • Use the -h option for a more user-friendly format
  • The dumpe2fs command views the total number of inodes and free inodes for ext2, ext3, or ext4 filesystems
    • Use the -h option

Checking Filesystems for Errors

  • Filesystem corruption: errors in the filesystem
    • Commonly occurs due to improper system shutdown
  • Syncing: saving data to the hard disk
  • Bad blocks: unusable areas of a disk, that cannot hold a magnetic charge
  • The fsck (filesystem check) command checks for errors
    • Filesystem must be unmounted
    • Use the -f option to perform a full check
  • The e2fsck command checks an ext2, ext3, or ext4 filesystem
    • Use the -c option to check for bad blocks
  • The tune2fs command is used to change filesystem parameters
    • The -i option sets the interval to force a full system check

Disk Quotas

  • Used when several users on a system, must be enough hard disk space for each user's files
  • Disk quotas: user limits on filesystem usage
    • Quotas can restrict the number of files/directories a user creates
  • Soft limit: a brief period of time that a user can exceed a quota
    • Default is seven days
  • Hard limit: the boundary a user is unable to exceed
  • The quotaon and quotaoff commands turn quotas on and off
  • The edquota command edits user quotas
  • The repquota command reports user quotas
  • The quota command allows to view their own quotas and current usage

Summary

  • Disk devices are represented by device files in the /dev directory
  • Filesystems must be created to a disk drive to be used by mounting to the linux directory tree with the mount command
  • Hard disks must be partitioned into distinct sections before the creation of filesystems on those partitions
  • Many different filesystems are available to Linux
  • LVM can be used for creating logical volumes from multiple partitions
  • Most removable devices are recognised as SCSI disks
  • Automounting performed in GUI enviroments
  • Monitoring disk usage with df du, and dumpe2fs commands essential to monitor disk space
  • Hard disk quotas can used to limit maximum space usage for different user accounts

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Use Quizgecko on...
Browser
Browser