12.LInux disk, System file concept "Mr.robot"

Source: Internet
Author: User

Preface: These system washes the disk The paper concept, must understand. "Mr.robot"

----------------------------------------------------

The fastest side of the disk is generally divided into C-drive

MBR: Master boot Record

cannot be used for partitioning,

The hard disk is used to record partitions,

512bytes:

446bytes: A section of the system boot program that loads the operating system boot

64bytes:16 bytes A partition with a total of 4 partitions, so the HDD primary partition is up to 4, fat

2 bytes:mbr validity of the mark 5A

3 primary partitions,

An extended partition that is used to record logical partitions, referencing additional partition tables

Logical Partitioning

RPM How many turns per minute

SATA 1

SATA 2 300m/s

SATA 3 600m/s

Does not mean that in actual use can reach 600m per second, there is a very critical factor is the transmission speed of the hard disk, because the SATA interface is connected with the hard disk, if the hard drive transmission speed is the highest also only 300m per second, that sata3.0 and sata2.0 basically no difference;

cat/proc/partitions Partition information

Root is not on the hard disk in the kernel, hang the disk in the root

When the kernel is booting, he only hangs on the root/

The kernel hangs the file to the root/, root/Access entry as a file

/bin/sbin

/usr/bin/usr/sbin/usr/local/bin/usr/local/sbin

/lib/lib64/usr/lib/usr/lib64/usr/local/lib/usr/local/lib64

/etc configuration file, the program has multiple configuration files to place a directory

/media,/mnt mount point

/dev Mount device

/proc,/sys device status information via file system access, SYS interface is notified to Dev

Home Directory

/var status information temporarily dump log cache

/opt Optional Directory/misc

/SRV Storage Services Related data

/tmp Temporary file system

/boot kernel file

/USR Software Installation location

Vfs:

File system:

Basic file System: Ext2,ext3,ext4,reiserfs,xfs,jfs,vfat,ntfs

Cluster file system: GFS2,OCFS2

Network File system: NFS,SMBFS (CIFS)

CD iso9660

Raw


Inode: The properties of the saved file, and in which blocks after the record file is stored

Inode number

Time stamp

belong to the group of main genera

Permissions

Where to put the file

Block block of data:

The size of the block can be specified, at the time of formatting

But a block can only save one file, if the storage is a few k files, and disk each block is 128k, that is a huge waste of space,

It also causes more Inode,inode to occupy disk space,

So when formatting, choose the right block size, depending on how much file you want to store.


Block and inode ratios, 32:1 64:1

After formatting, this line can be calculated as proportional


Reserved: According to the size of the hard disk, adjust


Defragmenting the disk is


When a small file is deleted, a small space is left, and multiple scattered small spaces are allocated for continuous large free space.

Partition Table/etc/fstab

↓↓↓


First column: partition identifier, can write partition of label partition UUID can also write partition name

Second column: The mount point of the partition

Third column: Format of the partition

Fourth column: Some mount parameters of Muount

The fifth column: The number indicates whether the dump was backed up. 1 means backup, 0 means no backup

The Sixth column: the number indicates whether the boot self-test disk, 1 and 2 means detection, 0 means not detection first 1 after 2 CentOS and Redhat/partition must be set to 1, and only one 1 in fstab allowed

Fourth column common options:

Async/sync:async indicates that the disk and memory are out of sync. The system writes the memory data to disk at intervals, and sync synchronizes the memory and the data on the disk at all times.

Auto/noauto: Indicates auto mount/no auto mount on boot

Default: Indicates that the mount definition is set according to the defaults of most permanent file systems, which contains RW, suid, dev, exec, auto, Nouser, and async realtime

RO: Read-only permission mount

RW: Readable writable permission mount

Exec/noexec: Indicates that the executable file is allowed/not allowed to execute, and must not mount the noexec in/partition. Otherwise, the system will be re-installed.

User/nouser: Indicates allow/disallow other user to mount partition outside root

Suid/nosuid: Indicates that the Allow/disallow partition has a suid attribute, typically nosuid

    • Relatime -Update inode access records in real time. Only the access time in the record is older than the current access will be updated. (similar to Noatime, but does not interrupt processes such as Mutt or other programs that detect whether a file has been modified since it was last accessed.) ) To improve performance (see atime Parameters ).

Swap partition:

Linux uses memory mechanism:/proc/sys/vm/swapiness

How big is good:

Greater than 2G, less than 4G =4g

Less than 2G =2* physical memory

8g+:=4g

View memory space usage status

Cat/proc/meninfo

Free

-M: Display results in megabytes

-G: Display results in gigabytes

Swap partition:

Virtual memory

Mkswap formatted as virtual memory

-L label Specifies the volume label

Swapon Starting virtual memory

-A start all virtual partitions

-P: Specify priority

Swapoff shutting down virtual memory

--------


This article is from the "Mr.robot" blog, make sure to keep this source http://80602872.blog.51cto.com/12350020/1893919

12.LInux disk, System file concept "Mr.robot"

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.