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
what is a *common error* that is ecountered when unmount a filesystem?
trying to unmount a filesystem that is currenty in use.
26
what command would I use to find out which users are using the filesystem that I would like to unmount?
**fuser**
27
**mount -a** ; what does that execute?
mounts all the filesystems in the **/etc/fstab** file
28
When mounting w/ **mount -a** , what is the order of the mounting process?
the order from top to bottom of the **/etc/fstab** file.
29
it is bad practice to use the **mount -a** command for **/etc/fstab** checking. what should be used instead ?
**findmnt --verify**
30
**mount -r** ; executes what action? what what is the other option that does the same thing?
mounts a filesystem in **read only** mode. the other option that does the same thing is **--read-only**
31
**mount -w** ; what does that execute?
mounts a filesystem with **read** and **write** privilages.
32
most devices to be mount are identified by file name like....?
**/dev/sda1**
33
what command will list filesystem , LABELS, UUID on avaliable block devices ?
**$ lsblk -fs**
34
if no options are given to the mount what happens?
a list of the mounted filesystems are printed
35
if I would like to override the option in **/etc/fstab** than what option would I use?
**-o**
36
does the **mount** command read **/etc/fstab** file if both device and directory are given as arguements .
no
37
If I would like to move a mount point to someplace different, how would I use the **mount** command?
$ **mount --move** *olddir newdir* **\***the physical location of the files have not changed .
38
what command would I use to un-attach a filesystem with?
**umount**
39
the file system is used for (**what?**)
to control how data is stored on the device
40
the pathname dir refers to (**what?**) of the filesystem on the block device
root
41
if only a directory is given for the **mount** command . ie **mount** *dir . then....?*
mount looks for a mount point (if not found a device) in the **fstab** file
42
what **mount** command will list all the mounted filesystems
$ **mount -l** \*the **l** option add labels
43
all files accessible in a unix suystem are setup as on a big ........?
tree
44
even though a filesystem may look like one piece th files can be ......?
spread over several devices
45
what command serves as a tool to attach a filesystem(found on a device) to the big file tree ?
**mount**
46
what is the standard form of **mount**?
**mount -t type device dir** *\*tells the kernel to mount filesystem form device on dir*
47
are root permissions needed to mount a filesystem?
yes
48
what does the **fstab** file contain?
**info** on all the filesystems that can be mounted
49
**fstab** is only read by .....?
programs
50
the order of records in **fstab is important why?**
because **fsck, mount, umount** sequencally iterate through fstab
51
the **first** field in the **fstab** describes .......?
the block special device or remote filesystem to be mounted
52
the second field in **fstab** is ...... ?
the mount point(target) for the filesystem .
53
w.r.t. the **second** field in **fstab** file how would i specify a swap partition ?
as "none"
54
the **third** field in **fstab** decribes what?
the type of filesystem
55
what does the fourth field descibe in **/etc/fstab**?
this field decribes the mount options associated with the filesystem.
56
how is the fourth field in the **/etc/fstab** formatted?
as a **comma-seperated** list
57
what is the 5th field used for in **/etc/fstab**?
the 5th field is used by dump to determine which filesystem needs to be dumped.
58
what uses the sixth field in **/etc/fstab**?
the 6th field is used by **fsck** to determine what order at which filesystem are checked @ boot
59
mounting a filesystem is the act of ....?
placing the **root** of one filesystem on a directory
60
what does **fstab** stand for?
filesystem table
61
**dumping** is the act of ...?
creating a **backup** of a filesystem ( often on tape)
62
what does \<**pass**\> used for ?
the order that **fsck** checks the filesystem
63
the automounter allows the system to mount....?
**filesystems** on demand and clean up those filesystems when they are not in use.
64
each **inode** stores the ....?
**attributes** , and the **disk block** location of the objects data
65
everything in linux is referenced by a .....?
file
66
even a directory is a .....?
file
67
linux files consist of a ......?
filename, inode and data block(s)
68
the operating system uses the **inode** number , not the filename to .....?
access the file and its information.
69
a file is a container that stores ....?
data
70
does the system use the filename to access the file information?
no
71
each file contains a signiture called a **magic number.** this **magic number** indicates the .....?
the **type** of file it is.
72
an **extension** is a suffix at th end of a file that ......?
that **indicates** the file type
73
describe a **regular file ,ASCII file**
this type of file stores text data. this data could be a document or database
74
decribe a **symbolic link** er
stores a pointer to another file. when this file is accessed, the file indicated by the stored pointer is read.
75
discibe a **directory** type file
a directory contains a list of the files stored in it and their inodes
76
describe a **character** **device** type file
represents a device that transfers data one character at a time.
77
descirbe the file type : **Block device**
represents a device that transfers data a block at a time
78
decribe the file type : **sockets**
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
there are three types of **file timestamps .**what are they?
1. **access** 2. **modification** 3. **change** these are part of a files metadata
80
the **access timestamp** is update each time a file is ....?
read
81
when is the **change timestamp** updated ?
when the file's metadata is changed
82
a **link** is a method of referring .....?
to data stored in another file
83
a files **metadata** is stored in an
inode
84
a files **metadata** structure contains a file's....
ownership, permissions, timestamps, and data block information.
85
access to the file is based on the information.....?
stored in the file's inode
86
a **hard link** is ....?
a **hard link** is an **entry** in the **data block** of a **directory** thatd associates the files name with the file's inode.
87
to create a **hard link** we excecute the command ....?
ln
88
using the command **ln** what option would make the link **symbolic**
**--symb****olic**
89
what is the syntax for the **ln** command
**ln [options] ... T TARGET LINK\_NAME**
90
permissions to a **symbolic link** are based on ....?
the permissions of the file it is connected to .
91
If I would like to remove a symbolic link what command could I use?
**\rm **
92
a hard link points to a ....?
number
93
a soft link or symbolic link point to a ...?
name
94
unlike a **hard link** a each **soft link** file has its own ....?
inode
95
what command could i use to determine what file a **symbolic link** is linked to ?
readlink
96
the file command compares the files **magic numbers** witrh the databases of file signitures contained in what files to determine the file type ?
1. **/usr/share/misc/magic** ## Footnote **2. /usr/share/misc/magic.mgc** **3. /etc/magic**
97
what command by default will display teh first 10 lines of a text file?
head
98
what option would allow me to pick home many lines I want the command head to display?
-n
99
what command by default will display the last 10 lines of a text file?
tail
100
what option for the tail command would allow me to follow new text lines as they are written ?
-f
101
the **fstab** file contains ......?
descriptive info about the filesystems the system can mount.
102
the order of the **fstab** file is important why?
becuause **fsck** , **mount** , and **umount** sequentially iterate through **fstab** doing their work.
103
**/etc/shadow** is a file which contains....?
the password info for the system's accounts and optional aging informantion.
104
each line in the file **/etc/shadow** contains how many fields ?
9
105
what is in the 1st field in **/etc/shadow**?
login name
106
what is in the **2nd** field in **/etc/shadow**?
encrypted password
107
what is in the **3rd** field in **/etc/shadow ? ​**
date of the last password change
108
what is in the **4th**field in **/etc/shadow**?
**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
what is in the **5th** field in **/etc/shadow**?
**maximum passeword age** the maximum password age is the number of days after which the user will have to change her password
110
what is in the **6th** field in /etc/shadow ?
**password warning period** the number of days before a passord is fing to expire during which the user should be warned
111
what is in the **7th** field in /etc/shadow ?
**password inactivity period** the number of days after a password has expired during which the password should still be accepted
112
what is in the **8th** field in **/etc/shadow**?
**account expiration date** the date of expiration of the account, expressed as the number of dayssince jan 1, 1970
113
what is in the **9th** field in **/etc/shadow**?
**reserved field**
114