ch5.2 Storage - Management, Directory Structure Flashcards
/etc/mtab file
reports the status of currently mounted file systems but /proc/mounts is similar but usually more accurate and more up-to-date
/proc/partitions file
part of the virtual file system and contains info on each partition attached to the system
format of /proc/partitions file
columns named major, minor, #blocks, and name
lsblk
Bash command that displays info about block storage devices currently available on the system
lsblk syntax and options
-a
-r
-f
-l
-m
lsblk [options] [device name]
-a list empty devices
-r list devices excluding provided ouput devices
-f display additional information
-l display results in list format
-m display device permission information
blkid
prints each block device in a flat format and includes some additional information
probably not as useful as lsblk -f
blkid syntax
blkid [options] [device name]
most useful tools to manage an ext style file system
e2fsck
resize2fs
tune2fs
dumpe2fs
fsck
Bash command to check the correctness and validity of a file system
Most systems run this command at boot so that any errors can be detected and corrected before the system can be used
A file system must be unmounted before it can be scanned by this command
fsck syntax and options
-r
fsck [options] [device/file system name]
-r repair file system
resize2fs description
Bash command to resize ext2, ext3, or ext4 file systems
resize2fs syntax
resize2fs [options] [device/file system name] [desired size]
tune2fs
Bash command to confirm and adjust various tunable parameters of the ext2/ext3 file systems
can also add a journal to an existing ext2 or ext3 file system
tune2fs syntax and options
-j
-i
-c
-C
-r
-e
-l
-U
tune2fs [options] [device/file system name]
-j used as an ext3 journal to the existing file
-i [d|m|w] specify the maximum time interval
-c specify the maximum number of mounts
-C specify the number of possible mounts
-r specify the number of reserved file system blocks
-e specify the behavior of the kernel code
-l list the contents within the superblock
-U set the specified UUID
Superblock
a record of the characteristics of a filesystem including it’s size, type, and status
dumpe2fs
Bash command that prints the superblock and block group information for the selected device using an ext2, ext3, or ext4 file system
dumpe2fs syntax and options
-x
-b
-f
-i
dumpe2fs [options] [device/file system name]
-x Print a detailed report about block numbers
-b Print the bad blocks
-f Force print the file system status regardless of file system flags
-i Print file system data from an image file created using e2image command
lsscsi
Bash command used to list information about SCSI devices connected to a Linux system
xfs_info
Bash command to print details about the xfs file system
xfs_admin
Bash Command to change the parameters of an xfs file system
xfs_metadump
Bash command to copy the superblock metadata of the xfs file system to a file
xfs_growfs
Bash command to expand the xfs file system to fill the drive size
xfs_copy
Bash command to copy the contents of the xgs file system to another location