Chapter 11 Flashcards
Handling Storage
Describe how Linux works with storage devices.
Linux creates raw device files in the /dev folder for each storage device you connect to the system. Linux also assigns a raw device file for each partition contained in the storage device.
Explain how to prepare a partition to be used in the Linux virtual directory.
To use a storage device partition in the virtual directory, it must be formatted with a filesystem that Linux recognizes. Use the mkfs command to format the partition. Linux recognizes several different filesystem types, including ext3, ext4, btrfs, xfs, and zfs.
Describe how Linux can implement a fault-tolerance storage configuration.
Linux supports two types of fault-tolerance storage methods. The multipath method uses the mdadm utility to create two paths to the same storage device. If both paths are active, Linux aggregates the path speed to increase performance to the storage device. If one path fails, Linux automatically routes traffic through the active path. Linux can also use standard RAID technology to support RAID levels 0, 1, 10, 4, 5, or 6 for fault tolerance and high-performance storage.
Describe how Linux uses virtual storage devices.
Linux uses the logical volume manager (LVM) to create a virtual storage device from one or more physical devices. The pvcreate command defines a volume from a physical partition, and the vgcreate command creates a volume group from one or more virtual volumes. The lvcreate command then creates a logical volume in the /dev/mapper folder from one or more partitions in the volume group. This method allows you to add or remove drives in a filesystem to grow or shrink the filesystem area as needed.
List some of the filesystem tools available in Linux.
The df tool allows you to analyze the available and used space in drive partitions, whereas the du tool allows you to analyze space in the virtual directory structure. The e2fsprogs package provides a wealth of tools for tuning ext filesystems, such as debugfs, dumpe2fs, tune2fs, and blkid. Linux also provides the xfs_admin and xfs_info tools for working with xfs filesystems. The fsck tool is available for repairing corrupted filesystems and can repair most cases of file corruption.
Which type of storage device uses integrated circuits to store data with no moving parts?
SSD SATA SCSI HDD PATA
A. The solid-state drive (SSD) storage device uses an integrated circuit to store data, so option A is correct. SATA, SCSI, and PATA are drive connection types and not storage device types, so options B, C, and E are all incorrect. The hard disk drive (HDD) storage devices use disk platters and a read/write head to store data, not an integrated circuit, so option D is incorrect.
What raw device file would Linux create for the second SCSI drive connected to the system?
/dev/hdb /dev/sdb /dev/sdb1 /dev/hdb1 /dev/sda
B. Linux creates files named sdx in the /dev folder for SCSI devices. For the second SCSI device, Linux would create the file /dev/sdb, so option B is correct. The /dev/hdb file would represent the second HDD drive connected to the system, so option A is incorrect, and /dev/sda would represent the first SCSI device connected to the system, so option E is incorrect. Options C and D both represent partitions and not entire drives, so they are both incorrect.
What program runs in the background to automatically detect and mount new storage devices?
mkfs fsck umount mount udev
E. The udev program runs in the background on Linux systems and detects and mounts storage devices as they’re connected to the system, so option E is correct. The mkfs program creates a filesystem on partitions; it doesn’t mount them, so option A is incorrect. The fsck program repairs filesystems but doesn’t mount them, so option B is incorrect. The umount program unmounts filesystems, not mounts them, so option C is incorrect. The mount program manually mounts filesystems but doesn’t run in the background and automatically detect them, so option D is incorrect.
What folder does the udev program use to create a permanent link to a storage device based on its serial number?
/dev/disk/by-path /dev/sdb /dev/disk/by-id /dev/disk/by-uuid /dev/mapper
C. The udev program creates files in the /dev/disk/by-id folder that are linked to the raw device files for storage devices. These files are identified by manufacturer information, including the serial number assigned to the device, so option C is correct. The /dev/disk/by-path folder links files based on the drive’s connection to the system, so option A is incorrect. The /dev/sdb file represents the raw device file assigned to the device, not a permanent link file, so option B is incorrect. The /dev/disk/by-uuid folder contains permanent link files based on the device UUID value, not the serial number, so option D is incorrect. The /dev/mapper folder contains files for virtual drives for LVM and multipath systems, not permanent links to raw device files, so option E is incorrect.
Which partitioning tool provides a graphical interface?
gdisk gparted fdisk parted fsck
B. The GNU gparted program provides a graphical window for managing device partitions, so option B is correct. The gdisk, fdisk, and parted programs are all command-line partitioning tools, so options A, C, and D are all incorrect. The fsck program is a tool to repair filesystems, not create or modify partitions, so option E is incorrect.
Linux uses ___________ to add the filesystem on a new storage device to the virtual directory for users to access.
Mount points Drive letters /dev files /proc folder /sys folder
A. Linux uses mount points to insert a filesystem on a storage device to the virtual directory, so option A is correct. Unlike Windows, Linux doesn’t assign drive letters to storage devices, so option B is incorrect. The /dev files are used as raw devices for storage devices; they don’t access the filesystem, so option C is incorrect. The /proc and /sys folders are used by the kernel to display and change storage device information, not add the filesystem to the virtual directory, so options D and E are incorrect.
What filesystem is the latest version of the first Linux filesystem?
reiserFS btrfs ext3 ext4 nfs
D. The ext filesystem was the original filesystem used in Linux, and ext4 is the latest version of it, so option D is correct and option C is incorrect. The reiserFS and btrfs filesystems are specialty filesystems created separately from the ext filesystem, so options A and B are also incorrect. The nfs filesystem was created to allow sharing files and folders across networks and wasn’t the original Linux filesystem, so option E is incorrect.
What tool do you use to create a new filesystem on a partition?
fdisk mkfs fsck gdisk parted
B. The mkfs program allows you to create a new filesystem on a partition, so option B is correct. The fdisk, gdisk, and parted programs are used to create or modify partitions but not to work with the filesystem installed on them, so options A, D, and E are all incorrect. The fsck program repairs filesystems but can’t create them, so option C is incorrect.
What tool do you use to manually add a filesystem to the virtual directory?
fsck mount umount fdisk mkfs
B. The mount program allows you to insert the filesystem on a partition into the virtual directory, so option B is correct. The fsck program repairs filesystems but doesn’t insert them into the virtual directory, so option A is incorrect. The umount program removes filesystems from the virtual directory, as opposed to inserting them, so option C is incorrect. The fdisk program partitions devices but doesn’t create filesystems or insert them into the virtual directory, so option D is incorrect. The mkfs program creates filesystems but doesn’t insert them into the virtual directory, so option E is also incorrect.
The ___________ program is a handy tool for repairing corrupted filesystems.
fsck mount umount fdisk mkfs
A. The fsck program repairs corrupted filesystems, so option A is correct. The mount program inserts filesystems into the virtual directory, but it can’t repair them, so option B is incorrect. The umount program removes filesystems from the virtual directory but can’t repair them, so option C is also incorrect. The fdisk program creates and modifies partitions but doesn’t work with filesystems, so option D is incorrect. The mkfs program creates filesystems but doesn’t repair them, so option E is incorrect.