Linux hard disk Partition and file system management

Source: Internet
Author: User

Linux hard disk Partition and file system management

File System focus: inode (index node), block (Logical block), superblock (the block at the beginning of each file system, used to store the size of the file system, empty or filled blocks and their respective totals)

Physical composition of the Disk:
Circular Disk
Mechanical Arm, with the disk read header on the manipulator arm (data on the disk can be erased)
The Spindle Motor allows you to rotate the disk so that the Read Head of the mechanical arm can read and write data on the disk.

Physical composition of a disk:
The slice (sector) is the smallest physical storage unit, and each slice is 512 bytes.
Make the slice into a circle, that is, the magnetic column. The magnetic column is the smallest unit of the partition.
The first sector is the most important, including mbr (Main Boot zone) and the partition table. mbr occupies 446 bytes, while the Partition Table occupies 64 bytes.

Disk Partition: Specify the start and end columns of the partition.

The shard range is recorded in the shard table of the first slice.

Inode: stores permissions and attributes, including:

• Owner and group of the archive );

• Read/write/excute );

• The type of the archive );

• The time when the file is established or the status changes (ctime), the last read time (atime), and the last modified time (mtime );

• Capacity of the archive;

• Flag defining the characteristics of archives, such as SetUID ...;

• Pointer );

Data block: stores actual Data.
Superblock: records the overall information of the entire file system, including the total inode and block quantity, usage, and remaining amount.

Because ext2 is an indexed file system, fragments are usually not required.

If the hard disk file system is hundreds of gb, it is unwise to put all inode and block together, because the number of inode and block is too large to be easily managed; therefore, the ext2 file system is basically divided into multiple block groups during formatting. Each block group has an independent inode/block/superblock system.

A file system has only one superblock. Except that the first block group contains superblocks, subsequent block groups do not necessarily contain superblocks, if a superblock is contained, the superblock is used as the backup of the superblock In the first block group, which can be used for superblock rescue.

Dumpe2fs/dev/hda2: View hda2 partition and superblock Information

A directory does not occupy only one block. That is to say, if there are too many files under the directory, a block cannot accommodate all file names and inode tables, linux will give this directory an extra block to continue recording the first off data

If the files are too discrete, you can copy all the data in the file system, reformat the file system, and copy the data back to solve the problem.

Log File System: ext3:
Preparation: if the system wants to write a file, it will now record the information of the file to be written in the logging block.
Actual write: start to write the current permissions and data; start to update metadata data Data
End: After the data domain metadata is updated, the file is recorded in the log record block.
When the file system is inconsistent, the system only needs to check the log record block to find the abnormal file, and then checks the consistency of the file, instead of checking the entire filesystem to quickly fix the filesystem

Common supported file systems include:
Traditional file systems: ext2, mimix, ms-dos, fat (using vfat module), iso9660 (CD), etc.
Log File System: ext3, reiserfs, windows 'sntfs, ibm's jfs, sgi's xfs
Network File System: nfs, smbfs

In Linux, the standard file system is ext2.

View linux-Supported file systems: ll/lib/modules/$ (uname-r)/kernel/fs

View the file systems currently supported by the system loaded into the memory: cat/proc/filesystems

Hard link (not cross-filesystem or link directory): generate a new file name through inode link of the file system, instead of generating a new file
Soft link: A shortcut in windows

Create a link file: Ln [-sf] source file target file

After Linux is partitioned, you may need to restart to update the split table of the core. If you do not restart, run the following command: partprobe; the role of partprobe is that the core of higher vocational colleges must read New split tables.

When partitioning a hard disk, it is better to be safer in the single-person maintenance mode; when performing fdisk, if a partition of the hard disk is still in use, it is very likely that the system core will not be able to reload the partition table of the hard disk. The solution is to drop the partition in use, and then re-enter the fdisk and re-write the partition table, it will be successful.

How to add a new hard disk partition to the Mount process in CentOS

RHCE training notes-Hard Disk partitioning and LVM

Representation of hard disk partitions in Linux

Ubuntu-Hard Disk partitioning, formatting, and automatic mounting configuration

Linux and Windows hard disk partition settings

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.