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

What are the knowledge points of linux disk format and management

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces linux disk formatting and management knowledge points, the article is very detailed, has a certain reference value, interested friends must read it!

First, let's take a look at the file system on Linux.

/: root directory

/ bin: binary, executable command

/ sbin: executable commands for administrative purposes only, usually only administrators have permission to use them.

/ boot: boot, a file used by the operating system to boot the system, usually referring to the kernel

/ dev: device file

Device type of Linux

Character devices: files that begin with c, linear devices

Block devices: files that begin with b, random devices

/ etc: configuration file

/ home: user's home directory, / home/username,eg:jerry,/home/jerry

/ lib,/lib64: library file

/ media: mount point directory, usually used to hang on portable devices

/ mnt: Mount point directory, which is mounted on an additional file system

/ misc: backup directory

/ net

/ opt optional directory, usually third-party software is occasionally installed under this path

/ proc: pseudo file system, kernel mapping in memory

/ selinux: security enhanced linux

/ srv: service belongs to the intermediate data storage location of the service

/ sys: similar to proc, usually used to access and obtain hardware device attribute information

/ tmp: temporary file directory

/ usr: stores read-only files

/ var: files that change frequently, such as logs, etc.

The file system is usually provided by the kernel. The file systems in Windows are: NTFS and FAT32 Linux are mainly provided by ext2,ext3,ext4,xfs,reiserfs,nfs,iso9600,jfs,brtfs.

To format a disk is to create a file system, so how do you format it? Here are the commands and usage of disk formatting.

The first step; zoning

Fdisk [DEVICE]

D Delete a partition

N create a new partition

W Save exit

Q do not save exit

L System ID corresponding to each partition type

T modify the System ID of the specified partition

The method of letting the kernel read the hard disk partition table again after partitioning

1. Restart the system

2. Use partprobe [DEVICE] to realize on RHEL5.

REHL6 is realized by using partx-a [PARTITION] DEVICE

Step 2: format the partition and create a file system

Mkfs-t fstype / dev/part = mke2fs-t fstype / dev/part

Key points: 1. The file system must be supported by the kernel before it can be used, that is, the kernel has a corresponding kernel module, or already

Integrate it into the kernel

2. To have the corresponding file system creation tool, this is usually mkfs.fstype

Mke2fs-t {ext2 | ext3 | ext4}

-b {1024 | 2048 | 4096}: block size

The block size depends on CPU's support for memory page frame size, which is 4K by default on x86 systems.

-L label: sets the volume label

-m #: the percentage of total space occupied by blocks reserved for management

-r #: the number of blocks reserved for management

-E: set the extended properties of the file system

Tune2fs

-l: displays file system super block information

-L label: reset the volume label

-m #: adjust the proportion of total space occupied by blocks reserved for management

-r #: adjust the number of blocks reserved for management

-o: set the mount default option

-O: set file system default properti

-E: adjust the extended properties of the file system

UUID, file system type and volume label of blkid DEVICE display device

Step 3 mounting

Mount [- t fstype] DEVICE MOUNT_POINT

Mount [- t fstype] LABEL= "volume label" MOUNT_POINT

Mount [- t fstype] UUID= "UUID" MOUNT_POINT

After mounting, the original data will be hidden, so it cannot be mounted to the common directory of the system.

When uninstalling, make sure that no process is accessing the mounted device; otherwise, it cannot be uninstalled

-o is used to specify hanging options.

Ro: read-only mount

Rw: read and write. The default is read and write.

Noatime: turn off update access time

Auto: whether it can be mounted by "mount-a"

Defaults: equivalent to rw, suid, dev, exec, auto, nouser, async, and relatime

Sync: synchronous write

Async: asynchronous write

Dev:

Remount: remount

Loop: local loopback device

-n does not update device files when hanging on the system

-r read-only mount, equivalent to "- o ro"

Free View memory size

-m: convert the space size to MB

-g: convert space size to GB

The above is all the contents of the article "what are the knowledge points of linux disk formatting and management". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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