List, Create, Delete Partitions Flashcards

1
Q

How do you list block devices?

A

lsblk

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

What is the command to create MBR partitions?

A

fdisk

i.e fdisk /dev/xvdb

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

What is the command to create GPT partitions?

A

gdisk
parted
i.e gdisk /dev/xvdb

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

What is the first sector used for when creating a MBR partition?

A

MBR records to contain information about the disk

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

In the fdisk utility what does changing the partitions system id do?

A

Labels the partition type for its use

i.e Linux swap, Linux LVM

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

How do you format a partition with a filesystem?

A

mkfs

i.e mkfs -t xfs /dev/xvdb1

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

How do you show information on available block devices on the system?

A

blkid

*shows block devices formatted with a filesystem

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

How do you mount a block device?

A

mount

i.e mount /dev/xvdb1 /mnt/mount1

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

How do you unmount a block device?

A

umount

i.e umount /mnt/mount1

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

After deleting a partition how do you reload (refresh) changes?

A

partprobe

*reloads information kernel reads in /proc directory

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

Why would you use the UUID of a block device instead of it’s name?

A

To ensure when mounting the device is not a different device and files are accidentally overwritten because they can have duplicate names if not plugged into the system at the same time

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

How would you mount a block device using its UUID?

A

mount -U

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

What is the first sector used for when creating a a GPT partition?

A

GPT records

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

How do you create a persistent mount point (across reboots)?

A

Edit /etc/fstab

Paste UUID, /block/device or custom LABEL

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

Inside /etc/fstab what do the two numbers designate at the end of the line?

A

(dump) (fsck order)
dump species whether dump command can be use to make a backup of the device, 0 means disable
fsck is the order in which block devices are integrity checked after abrupt shutdown, 0 means no scan

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

How do you manually mount block devices listed in /etc/fstab?

A

mount -a

*useful to check for errors

17
Q

How do you unmount block devices listed in /etc/fstab?

A

umount -a

18
Q

How do you create a volume or partition label?

A

xfs: xfs_admin -L {name} {/block/device}
ext: tune2fs -L {name} {/block/device}
* partition must be formatted with a filesystem, cannot be mounted

19
Q

Where is partition information kept on the system?

A

/proc/partitions