Sec. 18 Filesystem features: Attributes, Creating, Checking, Mounting. Flashcards
extended attributes associate ________ not interpreted directly by the file system with files .
metadata
Four namespaces exist. what are they?
- user
- trusted,
- security
- system
The system namespace is used for __________ _______ _____ ?
Access Control lists
Describe the attibutes of the flag: Append-only
- 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
the security namespace is used by________?
SElinux.
Describe the attributes of the flag/attribute: immutable
- 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.
what command utility would I use to change attributes of a file?
chattr
what is the syntax for chattr ?
chattr [=|-| mode] filename
what command would i use to list/view attributes of a file?
lsattr
Describe the attributes that come with the flag: No-dump
- 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 .
Describe the attribute set by the flag: no-atime-update
- 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.
What command would I use to formatt(making) a filesystem on a partition?
mkfs
When would I use the command mkfs?
When I want to formatt a filesystem
what is the general format for the command mkfs?
mkfs [-t fstype] [options] [device-file]
- # * where [device-file] is usually a
- device name like* /dev/sda3 or /dev/vg/lvm1
Each filesystem type hs its own particular _______ that can be set when formating?
options
filesystem
-
filesystem:
- all accessable files in linux are organized into on large hierarchical tree structure with the head being the root directory.(/)
mount
the mount program allows the attaching at any point in the tree structure.
mount point
the mount point is the directory where the filesystem is attached.
mkdir
mkdir can be used to make a new directory.
what are the results of mounting a filesystem to a directory that is already used?
the information will be hidden not deleted. until after the new filesystem is unmounted .
explain each item in the following example:
$ sudo mount -t ext /dev/sdb4 /home
- 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.
what does the command mount -a execute?
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.
if were to execute the command mount with no options what would result?
it would generate a list of all the currently mounted filesystems.
what command would i use to unmount a filesystem?
- umount
-
umount syntax:
- umount [device-file | mount-point]
what is a common error that is ecountered when unmount a filesystem?
trying to unmount a filesystem that is currenty in use.
what command would I use to find out which users are using the filesystem that I would like to unmount?
fuser
mount -a ; what does that execute?
mounts all the filesystems in the /etc/fstab file
When mounting w/ mount -a , what is the order of the mounting process?
the order from top to bottom of the /etc/fstab file.
it is bad practice to use the mount -a command for /etc/fstab checking. what should be used instead ?
findmnt –verify
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
mount -w ; what does that execute?
mounts a filesystem with read and write privilages.
most devices to be mount are identified by file name like….?
/dev/sda1
what command will list filesystem , LABELS, UUID on avaliable block devices ?
$ lsblk -fs
if no options are given to the mount what happens?
a list of the mounted filesystems are printed
if I would like to override the option in /etc/fstab than what option would I use?
-o
does the mount command read /etc/fstab file if both device and directory are given as arguements .
no
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 .
what command would I use to un-attach a filesystem with?
umount
the file system is used for (what?)
to control how data is stored on the device
the pathname dir refers to (what?) of the filesystem on the block device
root
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
what mount command will list all the mounted filesystems
$ mount -l
*the l option add labels
all files accessible in a unix suystem are setup as on a big ……..?
tree
even though a filesystem may look like one piece th files can be ……?
spread over several devices
what command serves as a tool to attach a filesystem(found on a device) to the big file tree ?
mount
what is the standard form of mount?
mount -t type device dir
*tells the kernel to mount filesystem form device on dir
are root permissions needed to mount a filesystem?
yes
what does the fstab file contain?
info on all the filesystems that can be mounted
fstab is only read by …..?
programs
the order of records in fstab is important why?
because fsck, mount, umount sequencally iterate through fstab
the first field in the fstab describes …….?
the block special device or remote filesystem to be mounted
the second field in fstab is …… ?
the mount point(target) for the filesystem .
w.r.t. the second field in fstab file how would i specify a swap partition ?
as “none”
the third field in fstab decribes what?
the type of filesystem
what does the fourth field descibe in /etc/fstab?
this field decribes the mount options associated with the filesystem.
how is the fourth field in the /etc/fstab formatted?
as a comma-seperated list
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.
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
mounting a filesystem is the act of ….?
placing the root of one filesystem on a directory
what does fstab stand for?
filesystem table
dumping is the act of …?
creating a backup of a filesystem ( often on tape)
what does <pass> used for ?
the order that fsck checks the filesystem
the automounter allows the system to mount….?
filesystems on demand and clean up those filesystems when they are not in use.
each inode stores the ….?
attributes , and the disk block location of the objects data
everything in linux is referenced by a …..?
file
even a directory is a …..?
file
linux files consist of a ……?
filename, inode and data block(s)
the operating system uses the inode number , not the filename to …..?
access the file and its information.
a file is a container that stores ….?
data
does the system use the filename to access the file information?
no
each file contains a signiture called a magic number. this magic number indicates the …..?
the type of file it is.
an extension is a suffix at th end of a file that ……?
that indicates the file type
describe a regular file ,ASCII file
this type of file stores text data. this data could be a document or database
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.
discibe a directory type file
a directory contains a list of the files stored in it and their inodes
describe a character device type file
represents a device that transfers data one character at a time.
descirbe the file type : Block device
represents a device that transfers data a block at a time
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
there are three types of file timestamps .what are they?
- access
- modification
- change
these are part of a files metadata
the access timestamp is update each time a file is ….?
read
when is the change timestamp updated ?
when the file’s metadata is changed
a link is a method of referring …..?
to data stored in another file
a files metadata is stored in an
inode
a files metadata structure contains a file’s….
ownership, permissions, timestamps, and data block information.
access to the file is based on the information…..?
stored in the file’s inode
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.
to create a hard link we excecute the command ….?
ln
using the command ln what option would make the link symbolic
–symbolic
what is the syntax for the ln command
ln [options] … T TARGET LINK_NAME
permissions to a symbolic link are based on ….?
the permissions of the file it is connected to .
If I would like to remove a symbolic link what command could I use?
\rm <symbolic></symbolic>
a hard link points to a ….?
number
a soft link or symbolic link point to a …?
name
unlike a hard link a each soft link file has its own ….?
inode
what command could i use to determine what file a symbolic link is linked to ?
readlink
the file command compares the files magic numbers witrh the databases of file signitures contained in what files to determine the file type ?
- /usr/share/misc/magic
2. /usr/share/misc/magic.mgc
3. /etc/magic
what command by default will display teh first 10 lines of a text file?
head
what option would allow me to pick home many lines I want the command head to display?
-n
what command by default will display the last 10 lines of a text file?
tail
what option for the tail command would allow me to follow new text lines as they are written ?
-f
the fstab file contains ……?
descriptive info about the filesystems the system can mount.
the order of the fstab file is important why?
becuause fsck , mount , and umount sequentially iterate through fstab doing their work.
/etc/shadow is a file which contains….?
the password info for the system’s accounts and optional aging informantion.
each line in the file /etc/shadow contains how many fields ?
9
what is in the 1st field in /etc/shadow?
login name
what is in the 2nd field in /etc/shadow?
encrypted password
what is in the 3rd field in /etc/shadow ?
date of the last password change
what is in the 4thfield 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.
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
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
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
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
what is in the 9th field in /etc/shadow?
reserved field