What are partitions and directories in linux

王林
Release: 2019-12-27 11:29:22
Original
3286 people have browsed it

What are partitions and directories in linux

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
Copy after login

The above command: Mount the partition /dev/sda1 to the /paul directory;

umount /paul
Copy after login

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
Copy after login

3. Disk operation

1. Display the current disk of the machine:

fdisk -l
Copy after login

2. Disk format

Format Must umount before changing.

Command:

mkfs.ext4 /dev/xvdb1
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template