Manage Basic Storage Flashcards
What commands can be used to for disk partition?
df
fdisk (-l option lists partitions)
What are the steps to add a disk to a VM? (Include all options under fdisk)
Bonus: What command can you use to unmount?
Add disk to VM (If space is not already available)
fdisk -l - To view the disk you want to edit
fdisk /dev/sdb (name of disk added)
n - for new partition
p - for primary (or just hit enter for default)
1 - for partition number (or just hit enter)
2048 - for first sector (or just hit enter)
default or +size{K,M,G} (most likely default)
w - writing table to disk
mkfs.xfs /dev/sdb1 - assigns file system type
mkdir /anything - (can be anywhere)
mount /dev/sdb1 /anything - mount partition to fs
vim /etc/fstab - mounts on boot
/dev/sdb1 /anything xfs defaults 0 0
(tab between all values)
Bonus: To Unmount
umount /anything