104 Devices, Linux Filesystems, Filesystem Hierarchy Standard KT Flashcards
104.1 Create partitions and filesystems
The following is a partial list of the used files, terms and utilities:
fdisk gdisk parted mkfs mkswap
fdisk
Command: fdisk is a dialog-driven program for creation and manipulation of partition tables. It understands GPT, MBR, Sun, SGI and BSD partition tables.
fdisk [options] device
gdisk
Command: GPT fdisk (aka gdisk) is a text-mode menu-driven program for creation and manipulation of partition tables. It automatically converts a MBR partition table or BSD disklabel stored without a MBR carrier partition to the GPT format.
gdisk [ -l ] device
parted
Command: parted is a program to manipulate disk partitions. It supports multiple partition table formats, including MS-DOS and GPT. It is useful for creating space for new operating systems, reorganising disk usage, and copying data to new hard disks.
parted [options] [device [command [options…]…]]
mkfs
Command: mkfs is used to build a Linux filesystem on a device, usually a hard disk partition. This mkfs frontend is deprecated in favour of filesystem specific mkfs. utils.
mkfs [options] [-t type] [fs-options] device [size]
mkswap
Command: mkswap sets up a Linux swap area on a device or in a file.
mkswap [options] device [size]
104.2 Maintain the integrity of filesystems
The following is a partial list of the used files, terms and utilities:
du df fsck e2fsck mke2fs tune2fs xfs_repair xfs_fsr xfs_db
du
Command: Summarize disk usage of the set of FILEs, recursively for directories.
du [OPTION]… [FILE]…
du [OPTION]… –files0-from=F
df
Command: df displays the amount of disk space available on the file system containing each file name argument. If no file name is given, the space available on all currently mounted file systems is shown.
df [OPTION]… [FILE]…
fsck
Command: fsck is used to check and optionally repair one or more Linux filesystems.
fsck [options] – [fs-options] [ …]
e2fsck
Command: e2fsck is used to check the ext2/ext3/ext4 family of file systems.
e2fsck [ -pacnyrdfkvtDFV ] [ -b superblock ] [ -B blocksize ] [ -l|-L bad_blocks_file ] [ -C fd ] [ -j external-journal ] [ -E extended_options ] [ -z undo_file ] device
mke2fs
Command: mke2fs is used to create an ext2, ext3, or ext4 filesystem, usually in a disk partition (or file) named by device.
mke2fs [-c|-l filename] [-b block-size] [-C cluster-size]
[-i bytes-per-inode] [-I inode-size] [-J journal-options]
[-G flex-group-size] [-N number-of-inodes]
[-d root-directory]
[-m reserved-blocks-percentage] [-o creator-os]
[-g blocks-per-group] [-L volume-label]
[-M last-mounted-directory] [-O feature[,…]] [-r fs-revision] [-E extended-option[,…]] [-t fs-type] [-T usage-type ]
[-U UUID] [-e errors_behavior][-z undo_file]
[-jnqvDFSV] device [blocks-count]
tune2fs
Command: tune2fs allows the system administrator to adjust various tunable filesystem parameters on
Linux ext2, ext3, or ext4 filesystems.
tune2fs [ -l ] [ -c max-mount-counts ]
[ -e errors-behavior ] [ -f ] [ -i interval-between-checks ]
[ -I new_inode_size ] [ -j ] [ -J journal-options ]
[ -m reserved-blocks-percentage ]
[ -o [^]mount-options[,…] ] [ -r reserved-blocks-count ] [ -u user ] [ -g group ] [ -C mount-count ]
[ -E extended-options ] [ -L volume-label ]
[ -M last-mounted-directory ] [ -O [^]feature[,…] ]
[ -Q quota-options ] [ -T time-last-checked ] [ -U UUID ]
[ -z undo_file ] device
xfs_repair
Command: xfs_repair repairs corrupt or damaged XFS filesystems.
xfs_repair [ -dfLnPv ] [ -m maxmem ] [ -c subopt=value ]
[ -o subopt[=value] ] [ -t interval ] [ -l logdev ] [ -r rtdev ] device
xfs_fsr
Command: xfs_fsr improves the organization of mounted filesystems. The reorganization algorithm operates on one file at a time, compacting or otherwise improving the layout of the file extents (contiguous blocks of file data).
xfs_fsr [-v] [xfsdev | file] …