Sec. 18 Filesystem features: Attributes, Creating, Checking, Mounting. Flashcards

1
Q

extended attributes associate ________ not interpreted directly by the file system with files .

A

metadata

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

Four namespaces exist. what are they?

A
  1. user
  2. trusted,
  3. security
  4. system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The system namespace is used for __________ _______ _____ ?

A

Access Control lists

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

Describe the attibutes of the flag: Append-only

A
  • a file with the append-only attribute/flag set can only be opened in append mode for writing.
  • only the superuser can set or clear this attribute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

the security namespace is used by________?

A

SElinux.

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

Describe the attributes of the flag/attribute: immutable

A
  • a file with the immutable attribute/flag cannot be changed/modified
    • ​even by root
  • cannot be deleted or renamed
  • no hard link can be created to it
  • no data can be written to it.
  • Only the superuser can set or clear this attribute/flag.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what command utility would I use to change attributes of a file?

A

chattr

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

what is the syntax for chattr ?

A

chattr [=|-| mode] filename

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

what command would i use to list/view attributes of a file?

A

lsattr

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

Describe the attributes that come with the flag: No-dump

A
  • a file with the no-dump attribute set is ignored when the dump program is run
  • this is useful for swap and cache files that you don’t want to waste time backing up .
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe the attribute set by the flag: no-atime-update

A
  • with the no-atime-update set the file will not modify its atime(access time) record when a file is accessed but not otherwise modifed
  • this can increase the performance on some systems because it reduces teh amount of disk I/O on the system.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What command would I use to formatt(making) a filesystem on a partition?

A

mkfs

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

When would I use the command mkfs?

A

When I want to formatt a filesystem

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

what is the general format for the command mkfs?

A

mkfs [-t fstype] [options] [device-file]

  • # * where [device-file] is usually a
  • device name like* /dev/sda3 or /dev/vg/lvm1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Each filesystem type hs its own particular _______ that can be set when formating?

A

options

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

filesystem

A
  • filesystem:
    • all accessable files in linux are organized into on large hierarchical tree structure with the head being the root directory.(/)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

mount

A

the mount program allows the attaching at any point in the tree structure.

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

mount point

A

the mount point is the directory where the filesystem is attached.

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

mkdir

A

mkdir can be used to make a new directory.

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

what are the results of mounting a filesystem to a directory that is already used?

A

the information will be hidden not deleted. until after the new filesystem is unmounted .

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

explain each item in the following example:

$ sudo mount -t ext /dev/sdb4 /home

A
  • mount
    • mounts an ext4 filesystem
  • -t
    • ususlly not nessary to specify the type with the -t option.
  • /dev/sdb4
    • desginates where the filesystem is located on a specific partition of a hard drive
  • . /home
    • the filesystem is mounted at the position /home in the current directory tree.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

what does the command mount -a execute?

A

it mounts all the filesystems mention in the /etc/fstab.

  • note:
    • this is a good way to see if the filesystem entree you placed in /etc/fstab is was put in correctly.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

if were to execute the command mount with no options what would result?

A

it would generate a list of all the currently mounted filesystems.

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

what command would i use to unmount a filesystem?

A
  • umount
  • umount syntax:
    • umount [device-file | mount-point]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

what is a common error that is ecountered when unmount a filesystem?

A

trying to unmount a filesystem that is currenty in use.

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

what command would I use to find out which users are using the filesystem that I would like to unmount?

A

fuser

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

mount -a ; what does that execute?

A

mounts all the filesystems in the /etc/fstab file

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

When mounting w/ mount -a , what is the order of the mounting process?

A

the order from top to bottom of the /etc/fstab file.

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

it is bad practice to use the mount -a command for /etc/fstab checking. what should be used instead ?

A

findmnt –verify

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

mount -r ; executes what action? what what is the other option that does the same thing?

A

mounts a filesystem in read only mode. the other option that does the same thing is –read-only

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

mount -w ; what does that execute?

A

mounts a filesystem with read and write privilages.

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

most devices to be mount are identified by file name like….?

A

/dev/sda1

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

what command will list filesystem , LABELS, UUID on avaliable block devices ?

A

$ lsblk -fs

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

if no options are given to the mount what happens?

A

a list of the mounted filesystems are printed

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

if I would like to override the option in /etc/fstab than what option would I use?

A

-o

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

does the mount command read /etc/fstab file if both device and directory are given as arguements .

A

no

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

If I would like to move a mount point to someplace different, how would I use the mount command?

A

$ mount –move olddir newdir

*the physical location of the files have not changed .

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

what command would I use to un-attach a filesystem with?

A

umount

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

the file system is used for (what?)

A

to control how data is stored on the device

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

the pathname dir refers to (what?) of the filesystem on the block device

A

root

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

if only a directory is given for the mount command . ie mount dir . then….?

A

mount looks for a mount point (if not found a device) in the fstab file

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

what mount command will list all the mounted filesystems

A

$ mount -l

*the l option add labels

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

all files accessible in a unix suystem are setup as on a big ……..?

A

tree

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

even though a filesystem may look like one piece th files can be ……?

A

spread over several devices

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

what command serves as a tool to attach a filesystem(found on a device) to the big file tree ?

A

mount

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

what is the standard form of mount?

A

mount -t type device dir

*tells the kernel to mount filesystem form device on dir

47
Q

are root permissions needed to mount a filesystem?

A

yes

48
Q

what does the fstab file contain?

A

info on all the filesystems that can be mounted

49
Q

fstab is only read by …..?

A

programs

50
Q

the order of records in fstab is important why?

A

because fsck, mount, umount sequencally iterate through fstab

51
Q

the first field in the fstab describes …….?

A

the block special device or remote filesystem to be mounted

52
Q

the second field in fstab is …… ?

A

the mount point(target) for the filesystem .

53
Q

w.r.t. the second field in fstab file how would i specify a swap partition ?

A

as “none”

54
Q

the third field in fstab decribes what?

A

the type of filesystem

55
Q

what does the fourth field descibe in /etc/fstab?

A

this field decribes the mount options associated with the filesystem.

56
Q

how is the fourth field in the /etc/fstab formatted?

A

as a comma-seperated list

57
Q

what is the 5th field used for in /etc/fstab?

A

the 5th field is used by dump to determine which filesystem needs to be dumped.

58
Q

what uses the sixth field in /etc/fstab?

A

the 6th field is used by fsck to determine what order at which filesystem are checked @ boot

59
Q

mounting a filesystem is the act of ….?

A

placing the root of one filesystem on a directory

60
Q

what does fstab stand for?

A

filesystem table

61
Q

dumping is the act of …?

A

creating a backup of a filesystem ( often on tape)

62
Q

what does <pass> used for ?

A

the order that fsck checks the filesystem

63
Q

the automounter allows the system to mount….?

A

filesystems on demand and clean up those filesystems when they are not in use.

64
Q

each inode stores the ….?

A

attributes , and the disk block location of the objects data

65
Q

everything in linux is referenced by a …..?

A

file

66
Q

even a directory is a …..?

A

file

67
Q

linux files consist of a ……?

A

filename, inode and data block(s)

68
Q

the operating system uses the inode number , not the filename to …..?

A

access the file and its information.

69
Q

a file is a container that stores ….?

A

data

70
Q

does the system use the filename to access the file information?

A

no

71
Q

each file contains a signiture called a magic number. this magic number indicates the …..?

A

the type of file it is.

72
Q

an extension is a suffix at th end of a file that ……?

A

that indicates the file type

73
Q

describe a regular file ,ASCII file

A

this type of file stores text data. this data could be a document or database

74
Q

decribe a symbolic link er

A

stores a pointer to another file. when this file is accessed, the file indicated by the stored pointer is read.

75
Q

discibe a directory type file

A

a directory contains a list of the files stored in it and their inodes

76
Q

describe a character device type file

A

represents a device that transfers data one character at a time.

77
Q

descirbe the file type : Block device

A

represents a device that transfers data a block at a time

78
Q

decribe the file type : sockets

A

a socket is a method of communication between two processes on the same or different machines. the four types of sockets are stream, datagram, raw, and sequenced

79
Q

there are three types of file timestamps .what are they?

A
  1. access
  2. modification
  3. change

these are part of a files metadata

80
Q

the access timestamp is update each time a file is ….?

A

read

81
Q

when is the change timestamp updated ?

A

when the file’s metadata is changed

82
Q

a link is a method of referring …..?

A

to data stored in another file

83
Q

a files metadata is stored in an

A

inode

84
Q

a files metadata structure contains a file’s….

A

ownership, permissions, timestamps, and data block information.

85
Q

access to the file is based on the information…..?

A

stored in the file’s inode

86
Q

a hard link is ….?

A

a hard link is an entry in the data block of a directory thatd associates the files name with the file’s inode.

87
Q

to create a hard link we excecute the command ….?

A

ln

88
Q

using the command ln what option would make the link symbolic

A

–symbolic

89
Q

what is the syntax for the ln command

A

ln [options] … T TARGET LINK_NAME

90
Q

permissions to a symbolic link are based on ….?

A

the permissions of the file it is connected to .

91
Q

If I would like to remove a symbolic link what command could I use?

A

\rm <symbolic></symbolic>

92
Q

a hard link points to a ….?

A

number

93
Q

a soft link or symbolic link point to a …?

A

name

94
Q

unlike a hard link a each soft link file has its own ….?

A

inode

95
Q

what command could i use to determine what file a symbolic link is linked to ?

A

readlink

96
Q

the file command compares the files magic numbers witrh the databases of file signitures contained in what files to determine the file type ?

A
  1. /usr/share/misc/magic

2. /usr/share/misc/magic.mgc

3. /etc/magic

97
Q

what command by default will display teh first 10 lines of a text file?

A

head

98
Q

what option would allow me to pick home many lines I want the command head to display?

A

-n

99
Q

what command by default will display the last 10 lines of a text file?

A

tail

100
Q

what option for the tail command would allow me to follow new text lines as they are written ?

A

-f

101
Q

the fstab file contains ……?

A

descriptive info about the filesystems the system can mount.

102
Q

the order of the fstab file is important why?

A

becuause fsck , mount , and umount sequentially iterate through fstab doing their work.

103
Q

/etc/shadow is a file which contains….?

A

the password info for the system’s accounts and optional aging informantion.

104
Q

each line in the file /etc/shadow contains how many fields ?

A

9

105
Q

what is in the 1st field in /etc/shadow?

A

login name

106
Q

what is in the 2nd field in /etc/shadow?

A

encrypted password

107
Q

what is in the 3rd field in /etc/shadow ? ​

A

date of the last password change

108
Q

what is in the 4thfield in /etc/shadow?

A

minimum password age

teh minimum password age is the number of days theuser will have to wait before she will be allowed to change their password again.

109
Q

what is in the 5th field in /etc/shadow?

A

maximum passeword age

the maximum password age is the number of days after which the user will have to change her password

110
Q

what is in the 6th field in /etc/shadow ?

A

password warning period

the number of days before a passord is fing to expire during which the user should be warned

111
Q

what is in the 7th field in /etc/shadow ?

A

password inactivity period

the number of days after a password has expired during which the password should still be accepted

112
Q

what is in the 8th field in /etc/shadow?

A

account expiration date

the date of expiration of the account, expressed as the number of dayssince jan 1, 1970

113
Q

what is in the 9th field in /etc/shadow?

A

reserved field

114
Q
A