Disks, Filesystems, and Mounting Flashcards

1
Q

Linux allows low level access to…?

A

disk drives through device nodes in the /dev directory.

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

Usually, disks are _______ with a filesystem, and _______ to a directory instead.

A

formatted, mounted.

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

Filesystems are created with some variant of the…?

A

mkfs command.

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

The default filesystem of Red Hat Enterprise Linux is the..?

A

ext3 filesystem.

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

The mount command is used to map the root directory of a disk’s (or a disk partition’s) filesystem to an…?

A

already existing directory. (This directory is then referred to as a mount point.

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

The umount command is used to …?

A

unmount a filesystem from a mount point.

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

The df command is used to report…?

A

filesystem usage, and tables currently mounted devices.

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

Linux Disk Device Nodes:

/dev/fd0 disk type…?

A

floppy disk

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

Linux Disk Device Node:

/dev/hda disk type…?

A

IDE Primary Master

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

Linux Disk Device Node:

/dev/hdb disk type…?

A

IDE Primary Slave

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

Linux Disk Device Node:

/dev/hdc disk type…?

A

IDE Secondary Master

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

Linux Disk Device Node:

/dev/hdd disk type…?

A

IDE Secondary Slave.

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

Linux Disk Device Node:

/dev/sd[a-z] …?

A

SCSI Disks

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

Linux Disk Device Node:

/dev/cdrom …?

A

Symbolic Link to CD/ROM

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

Although device nodes exist for disk drives, usually standard users do not have…?

A

permissions to access them directly.

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

More often than not, hard disks are further divided into partitions. Partitions are regions of the hard disk that can…?

A

each be used as if it were a separate disk.

(Just as there are device nodes for every disk, there are also device nodes for every disk partition. The name of a partition’s device node is simply the partition number appended to the name of the disk’s device node. For example, the device node for the third partition of the primary slave IDE drive is called /dev/hdb3.)

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

By accessing disk drives through their device nodes, users may see (and write) the contents of the drive byte for byte. To the user, the drive looks like a (very big) file. When elvis cats the contents of a file to the drive’s device node, the information is…?

A

Transferred, byte for byte, to the drive.

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

On the floppy, what is the filename associated with the information?

A

Trick question. It doesn’t have one. Who is the user owner? What are the permissions? There are none. It’s just data.

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

A filesystem provides order to disk drives by organizing the drive into…?

A

Fixed sized chunks called blocks.

(The filesystem then organizes these blocks, effectively saying “this block is going to contain only inodes”, “this block is going to contain only dentries”, “these 3 block over here, and that one over there, are going to contain the contents of the file /etc/services”, or “this first block is going to store information which keeps track of what all the other blocks are being used for”. Filesystems provide all of this structure that is usually taken for granted.)

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

Before a disk can be used to store files in a conventional sense, it must be…?

A

initialized with this type of low level structure. In Linux, this is usually referred to as “creating a filesystem”. In other operating systems, it is usually referred to as “formatting the disk”.

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

Linux supports a large number of different types of filesystems (the fs(5) man page lists just a few). While Linux’s native filesystem is the ext2 (or in Red Hat Enterprise Linux, the ext3) filesystem, it also….?

A

supports the native filesystems of many other operating systems, such as the DOS FAT filesystem, or the OS/2 High Performance File System.

22
Q

In Linux, filesystems are created with some variant of the mkfs command. Because these commands are usually used only by the administrative user, they do not…?

A

live in the stadard /bin or /usr/bin directories, and therefore cannot be invoked as simple commands. Instead, they live in the /sbin directory, which is reserved for administrative commands.

23
Q

The mkfs command, and its variants, can be configured with a large collection of command line switches which specify…?

A

low level details about the filesystem. These details are beyond the scope of this course, however. Fortunately, the various options default to very reasonable general purpose defaults. For the curious, more information can be found in the mkfs.ext2(8) and similar man pages.

24
Q

Once a disk or a disk partition has been formatted with a filesystem, users need some way to access the directories and files that the filesystem provides. In other operating systems, sers are usually very aware of disk partitions, because they have to refer to them using labels such as C: or D:. In Unix, users are…?

A

often unaware of partitions, because different disk partitions are organized into a single directory structure.

25
Q

Every filesystem provides a root directory that serves as…?

A

the base of that filesystem.

26
Q

Upon booting the system, one of your disk’s partitions acts as the…?

A

root partition, nd its root directory becomes the system’s root directory /.

27
Q

The / directory has subdirectories, and those subdirectories have subdirectories, all of which reside in …?

A

the root partition’s filesystem.

28
Q

If a system has multiple disks, however, or if a disk has multiple partitions, the story gets…?

A

more complicated.

29
Q

In order to access the filesystems on the other partitions, the root directories of those filesystems are…?

A

mapped to an already existing directory through a standard Unix technique called mounting.

30
Q

How can a user determine which directories are being used as mount points?

A

One approach is to run the mount command without arguments.

31
Q

Without arguments, the mount command returns a list of …?

A

current mount points, the device that is mounted to it, the type of filesystem that device has been formatted with, and any mount options associated with the mount.

32
Q

virtual filesystems…?

A

are implemented by the kernel directly, and do not exist on any physical device.

33
Q

If you seldom know which directories are being used as mount points, and which files exist in which partitions, why bother even talking about it?

A

or now, we will address two reasons. The first reason is that there can be subtle issues that creep up which are related to the underlying filesystem. Partitions can run out of space. If a filesystem mounted on /home runs out of space, no more files can be created underneath the /home directory. This has no effect on the /tmp directory, however, because it belongs to another filesystem. In Unix, when a partition fills up, it only effects the part of the directory structure underneath its mount point, not the entire directory tree.

34
Q

Users can determine how much space is available on a partition with the…?

A

df command, which stands for “disk free”.

35
Q

df [OPTION…] [FILE…] …?

A

Show information about all partitions, or partition on which FILE resides.

36
Q

df command switch:

-a, –all…?

A

Shows all filesystems, including those of size 0.

37
Q

df command switch:

-h, –human-readable …?

A

Print sizes in human readable format.

38
Q

df command switch:

-i, –inodes …?

A

List inode usage instead of block usage.

39
Q

df command switch:

-T, –print-type …?

A

Include filesystem type.

40
Q

Not only will the df command show how much space is left on particular partitions, but it also gives a very readable table of which…?

A

devices are mounted to which directories.

41
Q

The second reason users need to be aware of filesystems and mount points involves…?

A

temporary media such as floppies and CD/ROM drives. Like any block device, floppy disks and CD/ROM disks are formatted with filesystems. In order to access these filesystems, they must be mounted into the directory structure, using a (already existing) directory as a mount point.

42
Q

By default, only the root user can…?

A

mount and unmount devices.

43
Q

The “Console User” (someone who has logged in from a virtual console or the X login screen) gains ownership of devices associated with…?

A

the physical machine, such as a floppy drive, and special permissions to mount these devices to predefined mount points, such as /media/floppy. If a user has logged in by some other technique, such as over the network, or via the su command, they will not be considered the “Console User”, and will not have permissions to mount these devices.

44
Q

A filesystem can only be unmounted if it is considered…?

A

“non-busy”.

45
Q

What can keep a filesystem “busy”?

A

Any open file, or any process that has a current working directory in the filesystem, “busy”s the filesystem. The only way for the filesystem to be unmounted is to track down any processes that might be keeping the filesystem “busy”, and kill them.

46
Q

The GNOME graphical environment runs an automounter, which keeps an eye on the…?

A

CD/ROM drive, and will automatically mount the filesystem of any newly inserted disk.

47
Q

The automounter is part of the graphical environment, and does not…?

A

exist if a user logged in through a virtual console.

48
Q

he automounter only works for the…?

A

CD/ROM drive. The floppy drive, or other devices, must be mounted “manually”.

49
Q

In order to improve performance, the kernel buffers all…?

A

block device (harddrive) interactions. For example, when you copy a file to a floppy, the file might seem to have been copied almost immediately. Later, when you unmount the floppy with the umount command, the command takes a while to return while writes are being committed to the floppy. When unmounting the device, the kernel is forced to commit all pending transactions to the disk.

50
Q

What would happen if you removed the floppy from the drive before buffered writes were committed to disk?

A

At best, the files that you thought you had copied to the floppy would not be there. At worst, you may have a corrupted floppy, and a confused Linux kernel the next time someone tries to mount a floppy.