Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Partitions and directories in linux

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report