Managing Storage Flashcards

Partitioning disks Linux file system Logical volume manager (LVM) Filesystem Hierarchy Standards (FHS)

1
Q

What partition types are supported in Linux?

A

Master Boot Record (MBR) partitions and Global Partition Table (GPT) partitions

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

What is swap memory?

A

Swap memory is dedicated disk space that the system will use in the event that it runs out of RAM. This can prevent application crashes and such.

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

How many partitions does the old MBR format support?

A

Up to four partitions

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

What does GPT stand for?

A

Global partition table

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

What does GUID stand for?

A

Globally unique identifier

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

How many partitions does GPT allow you to have?

A

Up to 128 partitions on a single disk. You do not have to worry about extended or logical partitions

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

What are the three characteristics of MBR partitions?

A

They contain Primary partitions, extended partitions, and logical partitions

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

What are two characteristics of GPT partitions?

A

They do away with the primary/extended/logical partition set and allow up to 128 defined partitions.

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

What is a block device?

A

Block devices are any device that contain storage blocks i.e. USB keys, removable media, disks etc..

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

What command would you use to manipulate the MBR partition table?

A

fdisk

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

What command would you use to manipulate the GPT partition table?

A

gdisk

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

Where do the disks reside in the file system?

A

They reside within the /dev (devices) folder.

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

What is a command to list out the disk and partition information for a given disk?

A

[sudo] fdisk -l /dev/ (sda, sdb, etc.)

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

Instead of listing out the disk and partition information, what is a command you could use to actually manipulate the disk itself?

A

[sudo] fsdisk /dev/ (sda, sdb, etc.)

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

What does the p command do once you are inside fdisk?

A

This command will print the file table of the disk you are in.

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

fdisk is the command used for which type of partition table?

A

MBR

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

What does the n command do once you are inside of fdisk?

A

This will allow you to create a new partition

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

When inside of fdisk, are the changes automatically written?

A

No, not until you hit w and press enter.

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

What does the w command do from within fdisk?

A

This writes the changes that have been made.

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

How can you list all of the block storage devices within your system?

A

lsblk (list block)

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

gdisk is used for what type of partitioning table?

A

GPT

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

Are there any tools that do both MBR and GPT?

A

Yes, but you cannot count on them since they may not be native. For example, Parted (partition editor)

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

What are some of the most popular filesystems?

A

EXT3, EXT4, XFS, BTRFS

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

What are three major requirements you should consider when choosing a file system?

A
  1. It should meet your needs
  2. Supported by the OS vendor
  3. Stable, mature, and reliable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Whats the command you would use to create a file system?

A

mkfs

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

What does the -t flag mean when using mkfs?

A

This is used to declare the ‘type’ of filesystem (ext3, ext4, xfs, etc)

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

What path can you navigate to in order to see a list of all the file system alias’s you could use to create a file system?

A

/usr/sbin/mkfs*

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

Whats the difference between the following commands?
sudo mkfs -t ext4 /dev/sdb1
sudo mkfs.ext4 /dev/sdb1

A

They do the same thing, however, mkfs.ext4 is simply an alias.

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

What command would you use to format a swap partition?

A

mkswap

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

Once you make a particular partition a swap partition, is it active immediately?

A

No, not until you issue a command to make it active

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

What is the command that you would use to make a partition that has been dictated as a swap partition, active?

A

sudo swapon /dev/ (sdb2, sda1, etc.)

32
Q

What is the command you could run to assign a label to a partition in a ext file system?

A

sudo e2label /dev/

33
Q

What is the command you could run to assign a label to a partition in a xfs file system?

A

sudo xfs_admin -L /dev/

34
Q

Are labels destructive to your data?

A

No. They are extremely helpful and can be easily changed.

35
Q

Can you use a disk that has not been mounted?

A

No, you must mount the disk before you are able to use it.

36
Q

What is a command that you could use to see all of the mounted partitions on your system?

A

mount

37
Q

What is a command you could use to see the file system disk space usage on your machine?

A

df -h

38
Q

Following convention, what file path are disks mounted that need to be mounted?

A

/mnt

39
Q

What is the full command you would use to mount a partition?

A

sudo mount /dev/ /mnt/

40
Q

Do partitions need to be mounted to a folder?

A

Yes, following convention (/mnt). You could leave them to their default path, but this can be very long and difficult to remember

41
Q

What does the flag mean in the following command:

mount -a

A

This will mount all file systems (of the given types) mentioned in /etc/fstab

42
Q

What does the flag mean in the following command:

mount -r

A

Mount as read only

43
Q

What does the flag mean in the following command:

mount -w

A

Mount as read/write

44
Q

What does the flag mean in the following command:

mount -t

A

This will allow you to specify the file system type

45
Q

What does the flag mean in the following command:

mount -o

A

Specify additional options

46
Q

What is the command you would run to unmount a particular partition?

A

sudo umount /dev/ /partition/file/path

47
Q

If you reboot the system after mounting a disk/partition, will they still be mounted?

A

No, if you want it to be persistent, you need to put them in the file system table (/etc/fstab)

48
Q

Where is the file system table located at?

A

/etc/fstab

49
Q

What command can you use to get the UUID of the partitions on your disk?

A

blkid (block id)

50
Q

If you were to change the label of a disk/partition, and move it to another computer, would the UUID change or stay the same?

A

It would stay the same. This is why the UUID is so reliable

51
Q

Can you mount disks by label?

A

Yes. This can be done within the file system table (/etc/fstab). Instead of /dev/ you would put label=

52
Q

Where are the utilities that you can use for physical volumes located?

A

/usr/sbin/pv*

53
Q

Where are the utilities that you can use for volume groups located?

A

/usr/sbin/vg*

54
Q

Where are the utilities that you can use for logical volumes located?

A

/usr/sbin/lv*

55
Q

When you create logical volumes, what is the best way to build them?

A

From the ground up. Create your physical volumes, then your volume groups, then your logical volumes

56
Q

What is the command to create a physical volume?

A

pvcreate

57
Q

What is the command to create a volume group?

A

vgcreate

58
Q

What command can you use to verify the creation of physical volumes?

A

pvdisplay or pvs

59
Q

What command can you use to verify the creation of volume groups?

A

vgdisplay of vgs

60
Q

What is the command to create a logical volume?

A

lvcreate

61
Q

What command can you use to verify the creation of logical volumes?

A

lvdisplay or lvs

62
Q

Where would you normally find applications?

A

/bin, /usr/bin, /sbin, /usr/sbin, /opt

63
Q

What is the /bin folder used for?

A

Essential user command binaries (required to have the system work). It is also available to all users.

Not required for the system to boot, but probably required to conduct some system operations

64
Q

What is the /sbin folder used for?

A

Contains system binaries and are required for the system to boot.

65
Q

What is the /usr/bin folder used for?

A

Contains most user commands/binaries.

66
Q

What is the /usr/sbin folder used for?

A

Non-essential standard system binaries

67
Q

What is the /opt folder used for?

A

Contains software not included with the installation

68
Q

What is the /boot/ folder used for?

A

Contains boot files and the Linux kernel

69
Q

What is the /dev/ folder used for?

A

Contains device nodes representing hardware

70
Q

What is the /etc/ folder used for?

A

Contains system configuration files

71
Q

What is the /mnt/ folder used for?

A

Contains temporary mount points for media

72
Q

What is the /proc/ folder used for?

A

Virtual file system containing data files for processes on the system

73
Q

What is the /sys/ folder used for?

A

Virtual file system containing data for hot plug devices. Similar to /proc/

74
Q

What is the /usr/ folder used for?

A

Contains binaries and data shareable between users

75
Q

What is the /home/ folder used for?

A

User home folder and personnel files. Often this is on a separate partition so that if you fill it up it doesn’t affect the OS performance

76
Q

What is the /lib/ folder used for?

A

Used for libraries/linkable libraries. Normally when applications run they rely on libraries to provide basic function and are shared between apps

77
Q

What is the /var/ folder used for?

A

Contains variable data for programs in /usr/. Definitely contains information for log files (system, journald, applications etc.), also the print spooler.