Storage Flashcards
list the block devices
- lsblk
- ls -l /dev/ | grep “^b”
Block device Major and Minor numbers
1 RAM
3 HARD DSK or CD ROm
6 PARALLE PRINTERS
8 SCSI DISK
list partition table
sudo fdisk -l /dev/sda
Master Boot Record (MBR) partition - Max 2T
2TB max and 4 Primary partition
GUID partition
- No max size per partition
- Unlimited partitions
Let’s partition with gdisk, an improved version of fdisk
It works with GPT partitioning scheme
once in, use ? to see all available options
gdisk create new partion
use n to create new partition
gdiks partition with default 20 GB
Check the newly created partition with gdisk
lsblk
sudo fdisk -l /dev/sdb
File System Types
Create EXT4 file system
mkfs.ext4 /dev/sdb1
mkdir /mnt/ext4;
mount /dev/sdb1 /mnt/ext4
Check if EXT4 mount was successful
mount | grep /dev/sdb1
or
df -hP | grep /dev/sdb1
Make the mount available even after reboot. Adding a record to /etc/fstab
echo “/dev/sdb1 /mnt/ext4 ext4 rw 0 0”»_space; /etc/fstb
Show disk usage of each files and folder under specific path
du -sh /home/kalinga/*
Show disk usage of each volume
du -h