当前位置:网站首页>Disk management and file system

Disk management and file system

2022-04-23 16:27:00 qjwthink

Catalog

One 、 Disk base

1、 Disk structure

2、 The data structure of the hard disk

3、 Disk interface type

4、MBR And disk partition represents

5、 Disk partition structure

6、 File system type

Two 、 Check and confirm the new hard disk

        1、fdisk command

        2、 Zoning steps

3、 ... and 、 Create file system

                1、mkswap command

Four 、 mount 、 Uninstall file system

1、mount command

2、umount command

summary


        

One 、 Disk base

1、 Disk structure

The physical structure of the hard disk

Disc : A hard disk has multiple disks , Every disc 2 Noodles ( Positive and negative sides )

head : One head per side

Mechanical drive

Solid state disk

2、 The data structure of the hard disk

A sector : The disc is divided into sectors , Each sector stores 512 Bytes of data ( The more sectors, the larger the capacity )

Magnetic track : Concentric circles with different radii on the same disk

cylinder : A circle formed by different discs with the same radius 〔 The number of cylinders and tracks is the same )

Hard disk storage capacity = Number of heads × Magnetic track ( cylinder ) Count × Sectors per channel × Bytes per sector

You can use a cylinder / head / Sector to uniquely locate each area on the disk

3、 Disk interface type

IDE、SATA、SCSI、SAS、 Fibre channel

4、MBR And disk partition represents

Master boot record (MBR: Master Boot Record)

MBR In the first physical sector of the hard disk

MBR Contains the main boot program of the hard disk 446 bytes And hard disk partition table (66 byte )

The partition table has 4 Zone record area , The recording area of each zone accounts for 16 Bytes

Linux Put the hard disk 、 Devices such as partitions are represented as files

Hda5 Express : First block ide The fifth partition of the interface

5、 Disk partition structure

The number of primary partitions in the hard disk is only 4 individual

The number of primary and extended partitions is limited to 1~4

Extended partitions are subdivided into logical partitions

The ordinal number of the logical partition will always be from 5 Start

6、 File system type

XFS file system

advantage : Support large files , There's a lot of storage , Log files can be backed up and repaired

● A partition where files and directory data are stored

● High performance log file system

●CentOS 7 The default file system used in the system

SWAP, Exchange file system

· by Linux The system establishes a switch partition

Linux Other file system types supported

FAT16、FAT32、NTFS

EXT4、JFS..

Two 、 Check and confirm the new hard disk

1、fdisk command

· View or manage disk partitions

Fdisk  -l   [ Disk device ]

or

Fdisk   [ Disk device ]

Common instructions in interactive mode

m、p、n、d、t、w、q

Necessary parameters :

-l List all partition tables

-u And  -l  Use it with , Displays the number of partitions

Select parameters :

-s< Partition number > The specified partition

-v Version information

Menu operation instructions

m : Display menu and help information

a : Active zone marker / Boot partition

d : Delete partition

l : Show partition type

n : New partition

p : display partition information

q : Exit without saving

t : Set partition number , Modify the system number of the partition

v : Check the area

w : Save the changes and exit

x : Expand applications , Advanced features

 

2、 Zoning steps

1、 First add the hard disk and let the system recognize , restart

This command can be used without restarting , To identify the hard drive

2、fdisk Partition , Easy to use , Maximize the use of hard disk performance

 

 

3、 Confirm the file system after formatting ,windows Can't use without formatting

Mkfs -t File system type      mkfs. File system type    Formatted partition or hard disk

4、 mount

Unmount

attach : Pay attention to mounting

1、 Preferably an empty file , There is a chance that the file will be lost

2、 If in the mount Directory , You can't unmount

3、 Multiple devices cannot be attached to one directory .

3、 ... and 、 Create file system

1、mkswap command

make swap, Create an exchange file system

mkswap   Zone devices

Example :

1、fdisk New partition

2、 Input t,hex Change the code to 82

attach : If the partition is not painted, you can use partprobe  /dev/sdb refresh

3、 Format as swap A section of

4、 Drive your car swap Partition

5、 End partition

Four 、 mount 、 Uninstall file system

1、mount command

Mount file system ,ISO Mirror to the specified folder

Mount [ -t type ]    The storage device     Mount point Directory

mount -o loop lSO Image file   Mount point Directory

2、umount command

Unmount the mounted file system

Umount Storage location

Umount Mount point Directory

attach : Permanently mount

Modify the configuration file     Parameters modified by the command   It's usually temporary

1、 Go to configuration file , Modify the parameters

 

 

 2、 see , success

attach : Permanent mounting of optical drive , Add the following text to the configuration file

Hardware device (UUID)    blkid    Mount point       file system (ISO9660)   default( The default on option ) 0( Backup ) 0( Check whether it is started )

Check disk usage df command

df  [ Options ]   [ file ]

 

summary

Learn about

1、 New hard disk , And be able to use

2、swap Partition   , Space creation, opening and closing

3、fdisk Partition

4、 Permanently mount the optical drive hard disk

5、 Basic structure of hard disk

版权声明
本文为[qjwthink]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231624474169.html