System File Checks Flashcards

1
Q

lsblk -f

blkid

A

To get labels and UUIDs
Use -f

Non GPT
Shows device name, label name, UUID etc. great when you need more information than device name. Easier to read for device name too.
To add these to fstab file, we need to call those with GPT Label: PARTLABEL=[partition label]

blkid
For GPT
To add these to fstab file, we need to call those with GPT UUID: PARTUUID=[partition UUID label]

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

fstab

A

File in /etc/fstab
Can add drives to this to auto mount them on boot.

Shows drives, mount locations and file system types

can be safely viewed using the cat command
cat /etc/fstab

Most versions of Linux will use ext2, 3, 4.
3 & 4 are identical except, ext3 has journalling enabled. Ext4 is an improvement on that.

FS Auto - Rare to see, but it mounts it automatically. Only really okay for read only media like a CD-ROM drive. File checks can actually damage file systems when they are unknown.

plus dump and pass info for backing up and file checks on boot?

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

tunefs -L Sales /dev/vg1/Sales

A

Labeling

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

Dump

A

Dump column used to use the dump program to backup on reboot if 1 in the dump column.
Second to last column with long form

0= do not backup
1= perform backup
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Pass

A

Pass column used to do a filesystem check during boot. Sets priority of scan

0 = don’t run filesystem check

1 = high priority filesystem check (get checked first)

2 = low priority filesystem check (get checked second so the system can continue to boot while these are checked)

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

UUID

A

Universally unique identifier
Aka GUID - Globally unique identifier

Used to identify partitions and as identity information in computer systems.

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

Drive options

auto/noauto

A

Options

auto/noauto - Automatically mount at boot time

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

user/nouser

A
  • Allow non-root users to mount
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

exec/noexec - Allow executables

A

1

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

ro - Mount read-only

A

1

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

rw - Mount read-write

A

1

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

sync/async - Perform disk I/O

A

1

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

synchronous or asynchronous
Sync - Commands wait for writes to complete
Async - Commands terminate prior to writes completing

A

1

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

dev/nodev - Allow block devices (/dev/*)

A

1

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

usrquota/grpquota - Enable user/group quotas

A

1

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

suid - Allow the use of SetUID/SetGID

A

1

17
Q

defaults - rw,suid,dev,exec,auto,nouser,asyn

A

Default settings as default options for drives

18
Q

df -h

du

A

df to look at the disk as a whole
-h Shows human readable data (GBs and MBs)

du to look at the folders inside that disk

19
Q

fsck -A

fsck -t ext2 /dev/sda2

A

fsck
FileSystem ChecK - checks file system for errors
the front end for the various filesystem tools

-A checks all filesystems

-t ext2 specifies filesystem type
/dev/sda2 is the specified drive

other examples:
e2fsck checks ext2/ext3 filesystems

To scan root drive:
Requires changes to fstab file and a reboot is required.
OR
Run a USB live Linux OS and scan the primary drive with fsck

20
Q

mkfs

A

Builds a linux filesystem
Formats ext2/ext3/ext4

Front end for format utilities

mke2fs similar but for ext

21
Q

debugfs

A

Special filesystem that resides in RAM

Useful for troubleshooting tools

22
Q

dumpe2fs

A

Prints out filesystem information

example:
dumpe2fs -h /dev/sda1
human readable

23
Q

tune2fs

A

tune the performance of a filesystem

change # of mounts between filesystem integrity checks
example:
tune2fs -c 60 -i 6m /dev/sda1
(60 mounts, 6 months)

Change a volume’s name

tune2fs -L Storage /dev/sdb1
tune2fs -l /dev/sda1 | grep volume

Convert ext2 to ext3

Enables journaling
tune2fs -j /dev/sdc1
24
Q

How should you use fsck to check the root drive on a CentOS server you have physical access to?

A

Run a USB live Linux OS and scan the primary drive with fsck

fsck -y /dev/[sda where OS is installed]