Disk and file System Management (i)

Source: Internet
Author: User

I. File system

1. File system is a disk partition management software, manage and dispatch the file storage space, provide the logical structure, physical structure and storage method of the file, realize the mapping of the file from the identity to the actual address, realize the file control operation and access operation, realize the sharing of file information and provide the reliable file secrecy and protection measures, provide the security of the document.

The file system divides the partition into two parts, part is the source data store, the other part is the data store, the data store is divided into logical storage unit, several logical storage units constitute the storage block, there is a block bitmap in the metadata store to identify whether each disk block is used, The inode number is used to specify that the file is stored in those disk blocks, and that there are related properties that store the file but no file name is stored

Two. Hard links and soft links (symbolic links)

1. Hard Links

The link file generated by ln for the file to be linked (displayed as a normal file when viewed with the LS command)

A. Can only be created on files and cannot be applied to the directory

B. Cannot cross file system

C. Creating a hard link increases the number of times a file is linked

[[email protected] test]# ls-l sum.sh-rwxr-xr-x 1 root root 106 Apr 18:25 Sum.sh[[email protected] test]# Ln/root/te st/sum.sh Lsum.sh[[email protected] test]# ls-l sum.sh-rwxr-xr-x 2 root root 106 Apr 18:25 Sum.sh[[email protected] Te st]# ls-l lsum.sh-rwxr-xr-x 2 root root 106 Apr 18:25 lsum.sh

The second field has a value of 2 for the number of times the file was hard-linked, and 1 o'clock when the file is deleted.

2. Soft Links

LN-SV The linked file generated by the file to be linked (displayed as a linked file when viewed with the LS command)

A. Can be applied to the catalog

B. can cross file system

C. No increase in the number of links to linked files

D. The number of characters that the specified path contains

lrwxrwxrwx 1 root root 3 17:33 csum.sh-/root/test/sum.sh

17 is the size of the symbolic link file, and the value is the number of characters worth the link source file path

Three.

The du command shows the size of the file taking up disk space

-S displays the overall size of sub-files and subdirectories under the entire directory

-H to convert units

DF command to view the use of file system disk partitions

-I displays the usage of the inode within the disk partition

-H to convert units

-p POSIX display, neat not to break the line

Four. device files

Files in the/dev/directory are device files

CRW-------1 VCSA TTY 7, 3 21:12 VCSA

7,128 Master device number and secondary device, the main device number is the type of identification device, the secondary device number identifies different devices in the same type, the device file is not size

The file used to create the block or character device is the Mknod command

A device file is a portal that is used for program access.

Usage: Mknod device name device type main device number secondary device number

-M MoD

1. Block device files (random access by block, with hard disk)

2. Character device files (linear access by character, with keyboard)

Five. device file name of the hard drive device

1.IDE devices start with HD, SATA SCSI devices start with SD, IDE has two interfaces, one interface has two master and slave/DEV/HDA,/DEV/HDB,/DEV/HDC,/DEV/HDD,SATA SCSI devices are/dev/sda,/ Dev/sdb

Hda

HDA1: First primary partition

HDA2: Second Primary partition

...

A total of four primary partitions, or three primary partitions and an extended partition, can have multiple logical partitions under the extended partition, only one extended partition on a disk, or no, a partition is a separate file system

FDISK-L: List all disks and disk partitions

Fdisk-l/dev/sda1: Viewing a specific partition

2.Linux Supported file Systems

Role of Mount:

is to associate a separate partition file system to the root file system, and not all subdirectories under the root directory can be mounted to other partitions

Six. Partition Management

1.fdisk command to create a new partition

Fdisk/dev/sda

P: Displays the partition of the current hardware, including unsaved changes

N: Create a new partition

E: Extended partition

P: Primary partition

D: Delete a partition

W: Save exit

Q: Do not save exit

T: Modify the partition type

L

L: Show all supported types

After creation the kernel does not recognize the newly created partition needs to read the partition table again

The Partprobe command notifies the kernel to reread the partition table, which needs to be formatted and mounted using the partition

The block size on the disk is 1k,2k,4k

A block group of disk partitions has a super block to hold the block group and the size of the block a series of information, there is a block Group description table for the current starting and ending position of each block group, there is a block bitmap, there is an inode bitmap, there is an inode table

MBR is not on any partition it is a sector




This article is from "Luo Chen's blog" blog, please be sure to keep this source http://luochen2015.blog.51cto.com/9772274/1641504

Disk and file System Management (i)

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.