1. Directory and partition
Difference: Linux partition is a physical concept that physically separates storage space; Directory is a logical concept. The Linux directory tree is actually a logical data structure relationship between partitions, not a physical structure;
Contact: A partition must be mounted in a directory to be used, and partitions can Mount to any directory;
Summary: The partition is where the data is actually stored, and there is only one copy of the data. Directory is a logical mapping of partition data, just like shortcuts in Windows systems. Partition data can be mounted to any number of different directories. These directories are like shortcuts with different names, all pointing to the same partition data;
Recommended related learning video tutorials: linux video tutorial
2. Mount the partition to the directory
1. Manual mounting
mount /dev/sda1 /paul
The above command: Mount the partition /dev/sda1 to the /paul directory;
umount /paul
The above command: Unmount the partition of the /paul directory;
2. Automatically mount at boot
Modify the /etc/fstab configuration file and add a line at the end.
/dev/sda1 /paul ext4 defaults 0 0
3. Disk operation
1. Display the current disk of the machine:
fdisk -l
2. Disk format
Format Must umount
before changing.
Command:
mkfs.ext4 /dev/xvdb1
The partition is in ext4 file system format.
Recommended related articles and tutorials: linux tutorial
The above is the detailed content of What are partitions and directories in linux. For more information, please follow other related articles on the PHP Chinese website!