In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain the example analysis of Linux hard disk partition for you in detail. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
File system focus: inode (index node), block (logical block), superblock (the block where each file system begins, used to store information such as the size of the file system, empty or filled blocks, and its respective total number, etc.)
The physical composition of the disk:
A circular disk
The robotic arm, and the disk read head on the robotic arm (erasable data on the disk)
The spindle motor can rotate the disk so that the reading head of the mechanical arm reads and writes data on the disk.
Physical composition of the disk:
The sector (sector) is the smallest unit of physical storage, and each sector is 512bytes
The sector is formed into a circle, which is the magnetic column, which is the smallest unit of the partition.
The first sector is the most important, in which there are mbr (main boot area) and partition table, in which mbr occupies 446bytes and partition table occupies 64bytes
Disk partitions: specify the start and end columns of the partition
The column range of the partition is recorded in the partition table of the first sector.
Inode: store permissions and attributes, including:
1. The owner and group of the file (owner/group)
two。 The access mode of the file (read/write/excute)
3. The type of the file (type)
4. The time when the file was created or changed (ctime), the last read time (atime), the last modified time (mtime)
5. The capacity of the file
6. Flags that define file features (flag), such as SetUID...
7. The direction of the real content of the file (pointer)
Data block: store actual data
Superblock: record the overall information of the entire file system, including the total amount of inode and block, usage, surplus, etc.
Because ext2 is an indexed file system, it usually does not require frequent defragmentation
If the hard disk file system is hundreds of gb, it would be unwise to put all the inode and block together, because the number of inode and block is too large to manage, so the ext2 file system is basically divided into multiple block group when formatted, and each block group has an independent inode/block/superblock system.
There is only one superblock; in a file system except that the first block group contains superblock, and the subsequent block group does not necessarily contain superblock. If it contains superblock, the superblock is mainly used as a backup of the superblock in the first block group, and can be rescued by superblock.
Dumpe2fs / dev/hda2: view hda2 partition and superblock information
The directory will not only occupy one block, that is, if the number of files under the directory is so large that a block cannot hold all the file names compared with the inode table, linux will give the directory an extra block to continue to record the first closed data.
If the file is too discrete, you can copy all the data in the file system, then reformat the file system, and then copy the data back to solve the problem.
Log file system: ext3:
Preparation: when the system wants to write a file, it will now record the information that a file is ready to write in the logging block.
Actual write: start writing the permissions and data at that time; start updating metadata data
End: after updating the data field metadata, complete the recording of the file in the logging block.
When the file system is inconsistent, the system only needs to check the logging block to find the abnormal file, and then check the consistency of the file without checking the whole filesystem, so as to achieve the ability to quickly repair filesystem.
Common support file systems are:
Traditional file system: ext2,mimix,ms-dos,fat (using vfat module), iso9660 (CD-ROM), etc.
Journal file system: ext3,reiserfs,windows'sntfs,ibm's jfs,sgi's xfs
Network file system: nfs,smbfs
The standard file system for Linux is ext2
View the file systems supported by linux: ll / lib/modules/$ (uname-r) / kernel/fs
View the supported file systems that are currently loaded into memory: cat / proc/filesystems
Hard links (not across filesystem, cannot link directories): generate new file names through inode links to the file system, not new files
Soft links: equivalent to shortcuts under windows
Create link file: Ln [- sf] source file target file
After Linux repartition, you may need to restart to update the core partition table; without restarting, you can also execute it with the following command: the function of partprobe;partprobe is that the core of higher vocational education must read the new partition table.
When partitioning a hard disk, it is better to be safer in single maintenance mode; when fdisk is being carried out, if some partition of the hard disk is still in use, then it is very likely that the system core cannot reload the partition table of the hard disk, the solution is to love the partition that should be used to remove it, and then re-enter the fdisk again, re-write partition table, and you can succeed.
This is the end of this article on "sample Analysis of Linux hard disk Partition". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.