Partitions and directories in linux
I. directories and partitions
Difference: the partition of Linux is a physical concept, which physically separates the storage space; the directory of Linux is a logical concept, and the directory tree of Linux is actually a data logical structure relationship between partitions, not a physical structure.
Contact: a partition must be mounted in a directory before it can be used, and the partition can be mounted to any directory
Summary: partition is the real place to store data, there is only one piece of data. A directory is a logical mapping of partition data, just like shortcuts in Windows systems, where partition data can be mounted to any number of different directories, which, like shortcuts with different names, point to the same partition data.
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: uninstall the partition of the / paul directory
2. Power on and mount automatically.
Modify the / etc/fstab configuration file and add a line at the end.
/ dev/sda1 / paul ext4 defaults 0 0
III. Disk operation
1. Display the current disk of the machine:
Fdisk-l
2. Disk formatting
You must umount before formatting.
Command:
Mkfs.ext4 / dev/xvdb1
Partition is in the file system format of ext4.
These are the details of what are partitions and directories in linux. Please pay attention to other related articles for more information.