List, Create, Delete Partitions Flashcards
How do you list block devices?
lsblk
What is the command to create MBR partitions?
fdisk
i.e fdisk /dev/xvdb
What is the command to create GPT partitions?
gdisk
parted
i.e gdisk /dev/xvdb
What is the first sector used for when creating a MBR partition?
MBR records to contain information about the disk
In the fdisk utility what does changing the partitions system id do?
Labels the partition type for its use
i.e Linux swap, Linux LVM
How do you format a partition with a filesystem?
mkfs
i.e mkfs -t xfs /dev/xvdb1
How do you show information on available block devices on the system?
blkid
*shows block devices formatted with a filesystem
How do you mount a block device?
mount
i.e mount /dev/xvdb1 /mnt/mount1
How do you unmount a block device?
umount
i.e umount /mnt/mount1
After deleting a partition how do you reload (refresh) changes?
partprobe
*reloads information kernel reads in /proc directory
Why would you use the UUID of a block device instead of it’s name?
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 would you mount a block device using its UUID?
mount -U
What is the first sector used for when creating a a GPT partition?
GPT records
How do you create a persistent mount point (across reboots)?
Edit /etc/fstab
Paste UUID, /block/device or custom LABEL
Inside /etc/fstab what do the two numbers designate at the end of the line?
(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