how does block device, filesystem, and mount work together
content
- when we wanna use a new storage hardware on the linux system, we need to
- physically connect the device
- partition the device if needed
- put a filesystem on it (laymen term: reformat)
- mount the device to a location on the linux’s directory tree
in action:
lsblkto see what devices are connected physicallyfdisk /dev/sdbto partition/dev/sdb/dev/sdbbecomes/dev/sdb1,/dev/sdb2, etc
sudo mkfs.ext4 /dev/sdb1: create filesystemext4on block device/dev/sdb1mkdir -p /home/mydata: create a location for the block device to mount onsudo mount /dev/sdb1 /home/mydata: mount the block device to the location/home/mydatadf -hto verify