Podcast
Questions and Answers
What is a device file?
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?
Which directory commonly contains device files in Linux?
- /etc
- /tmp
- /var
- /dev (correct)
What is the key distinction between character devices and block devices?
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?
Which of the following is typically a block device?
What does the 'major number' in a device file signify?
What does the 'major number' in a device file signify?
What does the 'minor number' in a device file represent?
What does the 'minor number' in a device file represent?
Which command is used to re-create a corrupted device file?
Which command is used to re-create a corrupted device file?
Where can you view a list of devices currently used on the system and their major numbers?
Where can you view a list of devices currently used on the system and their major numbers?
What is the primary purpose of a filesystem?
What is the primary purpose of a filesystem?
Which of the following is a common component of all filesystems?
Which of the following is a common component of all filesystems?
What must storage media contain before it can be used?
What must storage media contain before it can be used?
What is a 'mount point'?
What is a 'mount point'?
What does 'mounting' a device do?
What does 'mounting' a device do?
What happens to the contents of a mount point when a device is mounted?
What happens to the contents of a mount point when a device is mounted?
Why is it recommended to create empty directories specifically for mounting devices?
Why is it recommended to create empty directories specifically for mounting devices?
Which filesystem is mounted to the / directory when a Linux system first starts?
Which filesystem is mounted to the / directory when a Linux system first starts?
Which command is used to mount devices to mount point directories?
Which command is used to mount devices to mount point directories?
Which command is used to unmount devices from mount point directories?
Which command is used to unmount devices from mount point directories?
What is the most common type of removable media?
What is the most common type of removable media?
How are USB flash memory drives typically recognized by operating systems?
How are USB flash memory drives typically recognized by operating systems?
What command is used to create a new filesystem on a USB flash memory drive?
What command is used to create a new filesystem on a USB flash memory drive?
Which option is used with the mkfs
command to specify the filesystem type?
Which option is used with the mkfs
command to specify the filesystem type?
What command can be used to list currently mounted filesystems?
What command can be used to list currently mounted filesystems?
Which command provides a more user-friendly display of mounted filesystems?
Which command provides a more user-friendly display of mounted filesystems?
Which command can check whether a directory is being used by any users?
Which command can check whether a directory is being used by any users?
Which types of filesystem are typically used by CDs and DVDs?
Which types of filesystem are typically used by CDs and DVDs?
How should CDs and DVDs be mounted when accessed using Linux?
How should CDs and DVDs be mounted when accessed using Linux?
What must be done before a CD or DVD can be physically ejected from the drive?
What must be done before a CD or DVD can be physically ejected from the drive?
What is the name for image files that can be created to contain other files, often used for CDs/DVDs?
What is the name for image files that can be created to contain other files, often used for CDs/DVDs?
Which command is used to create an ISO image from a directory of files?
Which command is used to create an ISO image from a directory of files?
What are SATA and SCSI?
What are SATA and SCSI?
Which of the following are types of hard disks?
Which of the following are types of hard disks?
What are the advantages of SATA and SCSI hard disks in Linux servers?
What are the advantages of SATA and SCSI hard disks in Linux servers?
What is the primary advantage of SSDs over traditional hard disks?
What is the primary advantage of SSDs over traditional hard disks?
What is a 'partition'?
What is a 'partition'?
How many partitions does Linux require at a minimum?
How many partitions does Linux require at a minimum?
What is stored in the first readable sector of a hard disk?
What is stored in the first readable sector of a hard disk?
What is the MBR (Master Boot Record)?
What is the MBR (Master Boot Record)?
Which command is used to create partitions after installation (command line)?
Which command is used to create partitions after installation (command line)?
Which command is used to create partitions after installation (interactive)?
Which command is used to create partitions after installation (interactive)?
What must be done after using the fdisk
and cfdisk
to create partitions?
What must be done after using the fdisk
and cfdisk
to create partitions?
Which command prepares the swap partition?
Which command prepares the swap partition?
Which command activates the swap partition?
Which command activates the swap partition?
What benefit is gained by creating more than the minimum required partitions in Linux?
What benefit is gained by creating more than the minimum required partitions in Linux?
What is the significance of the 'major number' in the context of Linux device files?
What is the significance of the 'major number' in the context of Linux device files?
Which characteristic distinguishes block devices from character devices in Linux?
Which characteristic distinguishes block devices from character devices in Linux?
When a device is 'mounted' to a mount point directory, what happens to the original content of that directory?
When a device is 'mounted' to a mount point directory, what happens to the original content of that directory?
Under what circumstances might several different devices share the same major number?
Under what circumstances might several different devices share the same major number?
What is the function of the fuser
command in the context of mounting filesystems?
What is the function of the fuser
command in the context of mounting filesystems?
Which of the following commands is used to create an ISO image from a directory of files?
Which of the following commands is used to create an ISO image from a directory of files?
If a hard disk uses GPT (GUID Partition Table) instead of MBR (Master Boot Record), how should partitions be created and modified?
If a hard disk uses GPT (GUID Partition Table) instead of MBR (Master Boot Record), how should partitions be created and modified?
What is the purpose of the 'inode table' in a filesystem?
What is the purpose of the 'inode table' in a filesystem?
How are USB flash memory drives typically recognized by Linux operating systems?
How are USB flash memory drives typically recognized by Linux operating systems?
After creating partitions using fdisk
or cfdisk
, what important step must be taken?
After creating partitions using fdisk
or cfdisk
, what important step must be taken?
What is a characteristic of the ISO 9660 filesystem?
What is a characteristic of the ISO 9660 filesystem?
What is the function of the dumpe2fs
command?
What is the function of the dumpe2fs
command?
What is the key advantage of SSDs over traditional hard disks?
What is the key advantage of SSDs over traditional hard disks?
In Linux, what does the term 'superblock' refer to within the context of filesystems?
In Linux, what does the term 'superblock' refer to within the context of filesystems?
What is the purpose of the pvcreate
command in the context of LVM?
What is the purpose of the pvcreate
command in the context of LVM?
Which of the following is a reason for checking mounted filesystems periodically?
Which of the following is a reason for checking mounted filesystems periodically?
When using the mkfs
command to create a new filesystem on a partition, which option is utilized to specify the filesystem type?
When using the mkfs
command to create a new filesystem on a partition, which option is utilized to specify the filesystem type?
In the context of disk quotas, what is a 'soft limit'?
In the context of disk quotas, what is a 'soft limit'?
How are most removable media devices, such as USB drives, recognized by the Linux system in a GUI environment?
How are most removable media devices, such as USB drives, recognized by the Linux system in a GUI environment?
Which command would you use to view the size of a directory and its contents in kilobytes?
Which command would you use to view the size of a directory and its contents in kilobytes?
What is the role of the /etc/fstab
file?
What is the role of the /etc/fstab
file?
Why is it advisable to create empty directories specifically for mounting filesystems?
Why is it advisable to create empty directories specifically for mounting filesystems?
What is the purpose of the tune2fs
command?
What is the purpose of the tune2fs
command?
In the context of LVM, what is a Physical Extent (PE)?
In the context of LVM, what is a Physical Extent (PE)?
In Linux, what is the purpose of 'syncing' in the context of filesystem integrity?
In Linux, what is the purpose of 'syncing' in the context of filesystem integrity?
What is the purpose of the command vgextend
?
What is the purpose of the command vgextend
?
Where are partition definitions typically stored on a hard disk?
Where are partition definitions typically stored on a hard disk?
When working with CDs and DVDs in Linux, how should they typically be mounted?
When working with CDs and DVDs in Linux, how should they typically be mounted?
In Linux, which command is used for checking a filesystem for errors?
In Linux, which command is used for checking a filesystem for errors?
Which of the following commands allows regular users to view their own disk quotas and current usage?
Which of the following commands allows regular users to view their own disk quotas and current usage?
Which command is used to prepare a swap partition?
Which command is used to prepare a swap partition?
Which command is used to display detailed information about each Physical Volume (PV)?
Which command is used to display detailed information about each Physical Volume (PV)?
What is the device file path for the primary master PATA drive configuration?
What is the device file path for the primary master PATA drive configuration?
Within the /dev
directory, how are device files identified?
Within the /dev
directory, how are device files identified?
What is the role of Logical Volume Manager (LVM)?
What is the role of Logical Volume Manager (LVM)?
What should be done after creating GPT partitions that should contain a filesystem?
What should be done after creating GPT partitions that should contain a filesystem?
Which command is used to unmount a mounted device?
Which command is used to unmount a mounted device?
A Linux system is experiencing filesystem corruption. What is a common cause of the isssue?
A Linux system is experiencing filesystem corruption. What is a common cause of the isssue?
Which command would you use to extend the size of an LV (Logical Volume)?
Which command would you use to extend the size of an LV (Logical Volume)?
A user reports slow data access times on their Linux system. Which storage technology is most likely to improve performance?
A user reports slow data access times on their Linux system. Which storage technology is most likely to improve performance?
Flashcards
Device file
Device file
A file representing a system device.
Character devices
Character devices
Transfers data character-by-character to and from the device.
Block devices
Block devices
Transfer chunks/blocks of data using physical memory.
Major number
Major number
Signup and view all the flashcards
Minor number
Minor number
Signup and view all the flashcards
mknod command
mknod command
Signup and view all the flashcards
Filesystem
Filesystem
Signup and view all the flashcards
Filesystem components
Filesystem components
Signup and view all the flashcards
Mounting (filesystem)
Mounting (filesystem)
Signup and view all the flashcards
Mount point
Mount point
Signup and view all the flashcards
Root filesystem
Root filesystem
Signup and view all the flashcards
mount command
mount command
Signup and view all the flashcards
umount command
umount command
Signup and view all the flashcards
mkfs command
mkfs command
Signup and view all the flashcards
fuser command
fuser command
Signup and view all the flashcards
CDs and DVDs
CDs and DVDs
Signup and view all the flashcards
mkisofs command
mkisofs command
Signup and view all the flashcards
Partition
Partition
Signup and view all the flashcards
Track
Track
Signup and view all the flashcards
Sector
Sector
Signup and view all the flashcards
Block
Block
Signup and view all the flashcards
Cylinder
Cylinder
Signup and view all the flashcards
Master Boot Record (MBR)
Master Boot Record (MBR)
Signup and view all the flashcards
fdisk command
fdisk command
Signup and view all the flashcards
cfdisk command
cfdisk command
Signup and view all the flashcards
mkswap command
mkswap command
Signup and view all the flashcards
swapon command
swapon command
Signup and view all the flashcards
swapoff command
swapoff command
Signup and view all the flashcards
gdisk (GPT fdisk) command
gdisk (GPT fdisk) command
Signup and view all the flashcards
Logical Volume Manager (LVM)
Logical Volume Manager (LVM)
Signup and view all the flashcards
pvcreate command
pvcreate command
Signup and view all the flashcards
pvdisplay command
pvdisplay command
Signup and view all the flashcards
vgcreate command
vgcreate command
Signup and view all the flashcards
Physical extent (PE) size
Physical extent (PE) size
Signup and view all the flashcards
vgdisplay command
vgdisplay command
Signup and view all the flashcards
lvcreate command
lvcreate command
Signup and view all the flashcards
lvdisplay command
lvdisplay command
Signup and view all the flashcards
vgextend command
vgextend command
Signup and view all the flashcards
lvextend command
lvextend command
Signup and view all the flashcards
df (disk free space) command
df (disk free space) command
Signup and view all the flashcards
Device file specification
Device file specification
Signup and view all the flashcards
Mounting Considerations
Mounting Considerations
Signup and view all the flashcards
USB Flash Drives
USB Flash Drives
Signup and view all the flashcards
/proc/devices files
/proc/devices files
Signup and view all the flashcards
/etc/fstab file
/etc/fstab file
Signup and view all the flashcards
du (directory usage) command
du (directory usage) command
Signup and view all the flashcards
Syncing
Syncing
Signup and view all the flashcards
quota command
quota command
Signup and view all the flashcards
quotaon and quotaoff commands
quotaon and quotaoff commands
Signup and view all the flashcards
Filesystem corruption
Filesystem corruption
Signup and view all the flashcards
Parted command
Parted command
Signup and view all the flashcards
Mounting USB Drives
Mounting USB Drives
Signup and view all the flashcards
edquota command
edquota command
Signup and view all the flashcards
e2fsck command
e2fsck command
Signup and view all the flashcards
Device file: Major number
Device file: Major number
Signup and view all the flashcards
Disk Free Space
Disk Free Space
Signup and view all the flashcards
tune2fs command
tune2fs command
Signup and view all the flashcards
Monitoring Filesystems
Monitoring Filesystems
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.