104 Devices, Linux Filesystems, Filesystem Hierarchy Standard KT Flashcards

1
Q

104.1 Create partitions and filesystems

A

The following is a partial list of the used files, terms and utilities:

fdisk
gdisk
parted
mkfs
mkswap
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

fdisk

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

gdisk

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

parted

A

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…]…]]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

mkfs

A

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]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

mkswap

A

Command: mkswap sets up a Linux swap area on a device or in a file.

mkswap [options] device [size]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

104.2 Maintain the integrity of filesystems

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

du

A

Command: Summarize disk usage of the set of FILEs, recursively for directories.

du [OPTION]… [FILE]…
du [OPTION]… –files0-from=F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

df

A

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]…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

fsck

A

Command: fsck is used to check and optionally repair one or more Linux filesystems.

fsck [options] – [fs-options] [ …]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

e2fsck

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

mke2fs

A

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]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

tune2fs

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

xfs_repair

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

xfs_fsr

A

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] …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

xfs_db

A

Command: xfs_db is used to examine an XFS filesystem.

xfs_db [ -c cmd ] … [ -i|r|x|F ] [ -f ] [ -l logdev ] [ -p progname ] device

17
Q

104.3 Control mounting and unmounting of filesystems

A

The following is a partial list of the used files, terms and utilities:

/etc/fstab
/media/
mount
umount
blkid
lsblk
18
Q

/etc/fstab

A

/etc/fstab file is a system configuration file that contains all available disks, disk partitions and their options.

19
Q

/media/

A

/media/ directory contains subdirectories which are used as mount points for removeable media such as floppy disks, cdroms and zip disks.

20
Q

mount

A

Command: The mount command serves to attach the filesystem found on some device to the big file tree.

mount [-fnrsvw] [-t fstype] [-o options] device dir

21
Q

umount

A

Command: The umount command detaches the mentioned file system(s) from the file hierarchy.

umount [-dflnrv] {directory|device}…

22
Q

blkid

A

Command: The blkid program is the command-line interface to working with the libblkid(3) library. It can determine the type of content (e.g. filesystem or swap) that a block device holds, and also the attributes (tokens, NAME=value pairs) from the content metadata (e.g. LABEL or UUID fields).

blkid –label label | –uuid uuid

23
Q

lsblk

A

Command: lsblk lists information about all available or the specified block devices. The lsblk command reads the sysfs filesystem and udev db to gather information.

lsblk [options] [device…]

24
Q

104.5 Manage file permissions and ownership

A

The following is a partial list of the used files, terms and utilities:

chmod
umask
chown
chgrp

25
Q

chmod

A

Command: chmod changes the file mode bits of each
given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new mode bits.

chmod [OPTION]… MODE[,MODE]… FILE…
chmod [OPTION]… OCTAL-MODE FILE…

26
Q

umask

A

Command: umask() sets the calling process’s file mode creation mask (umask) to mask & 0777 (i.e., only the file permission bits of mask are used), and returns the previous value of the mask.

umask [-p] [-S] [mode]

27
Q

chown

A

Command: chown changes the user and/or group ownership of each given file.

chown [OPTION]… [OWNER][:[GROUP]] FILE…

28
Q

chgrp

A

Command: Change the group of each FILE to GROUP.

chgrp [OPTION]… GROUP FILE…

29
Q

104.6 Create and change hard and symbolic links

A

The following is a partial list of the used files, terms and utilities:

ln
ls

30
Q

ln

A

Command: In the 1st form, create a link to TARGET with the name LINK_NAME. In the 2nd form, create a link to TARGET in the current directory. In the 3rd and 4th forms, create links to each TARGET in DIRECTORY. Create hard links by default, symbolic links with –symbolic. By default, each destination (name of new link) should not already exist. When creating hard links, each TARGET must exist.

ln [OPTION]… [-T] TARGET LINK_NAME
ln [OPTION]… TARGET
ln [OPTION]… TARGET… DIRECTORY
ln [OPTION]… -t DIRECTORY TARGET…

31
Q

ls

A

Command: List information about the FILEs (the current directory by default).

ls [OPTION]… [FILE]…

32
Q

104.7 Find system files and place files in the correct location

A

The following is a partial list of the used files, terms and utilities:

find
locate
updatedb
whereis
which
type
/etc/updatedb.conf
33
Q

find

A

Command: find searches the directory tree rooted at each given starting-point by evaluating the given expression from left to right, according to the rules of precedence.

find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point…] [expression]

34
Q

locate

A

Command: locate reads one or more databases prepared by updatedb(8) and writes file names matching at least one of the PATTERNs to standard output, one per line.

locate [OPTION]… PATTERN…

35
Q

updatedb

A

Command: updatedb creates or updates a database used by locate(1). If the database already exists, its data is reused to avoid rereading directories that have not changed.

updatedb [OPTION]…

36
Q

whereis

A

Command: whereis locates the binary, source and manual files for the specified command names.

whereis [options] [-BMS directory… -f] name…

37
Q

which

A

Command: which returns the pathnames of the files (or links) which would be executed in the current environment, had its arguments been given as commands in a strictly POSIX-conformant shell.

which [-a] filename …

38
Q

type

A

Command: Display information about command type. For each NAME, indicate how it would be interpreted if used as a command name.

type [-afptP] name [name …]

39
Q

/etc/updatedb.conf

A

A configuration file for updatedb(8). /etc/updatedb.conf is a text file. Blank lines are ignored. A # character outside of a quoted string starts a comment extending until end of line.