Linux disk and file system concepts

Source: Internet
Author: User

Linux disk and file system concepts

I. Disk

1. IO Interface Type

(1) transmission type classification

Parallel Port: The same cable can be connected to multiple devices;

IDE has two bus, Master, slave

SCSI: Broadband: 16-1; narrowband: 8-1

Serial Port: Only one device can be connected to the same cable;

(2) Hard Disk category (theoretical data transmission)

IDE (ata): Parallel Port, 133 MB/s

SCSI: Parallel Port, ultrasc31620, 320 MB/S, UltraSCSI640, 640 MB/S

SATA: serial port, 6 gbps

SAS: serial port, 6 gbps

USB: serial port, 480 MB/s

2. Introduction to hard disk types and disks

(1) mechanical hard drive: internal vacuum

Disk: A disk with magnetic material on the front and back. It is rotated by a motor and fixed to all disks.

Each disc has a head on the front and back, and all the heads are fixed on a mechanical arm.

Average seek time: 5400 rpm, 7200 rpm, 10000 rpm, 15000rpm rpm

Track (track): factory format on each disk

Sector (sector): bytes Unit

Cylinder

The closer it is to a partition composed of a cylindrical partition than an external partition, the faster it is. On Windows, drive C is on the outermost side.

(2) SSD

Similar to multiple parallel USB flash drives, it simulates the mechanism of a mechanical hard disk in working mode.

Electrical equipment, speed personal notebook is 3 to 5 times, read 400 iops (io per second), write 200 iops

3. Device

(1) device type

Block: random access. The data exchange unit is block ";

Character (character): Linear access. The data exchange unit is "character", which is generally a serial device;

(2) Device File representation in FHS standard:/dev

1) Device Files: drivers associated with the device; Device Access entries;

2) device Number:

Major: Specifies the device type. It indicates the driver required by the device;

Minor: number of sub-devices, which is used to identify different devices of the same type. It is the access entry for a specific device;

(3) mknod command: command used to create special files for fast or character Devices

Format: mknod [OPTION]... name type [major minor]

-M MODE: permission to access the created device file;

(4) Device File Name: ICANN Internet Name address allocation institution provision

1) disk: IDE:/dev/hd [a-z]

SCSI, SATA, USB, SAS:/dev/sd [a-z]

2) Partition:/dev/sda #:/dev/sda1 ,...

Note: CentOS 6 and 7 mark all hard drive device files as/dev/sd [a-z] #

(5) method of referencing a device: Device File Name, volume label, UUID

4. Format

Low-level formatting: hardware manufacturers divide tracks before partitioning to form clusters

Advanced formatting: Perform partitioning and create a file system.

The file attributes/permissions set for each operating system are different. to store the required data

5. MBR (Master Boot Record): The primary Boot partition, which is a 512Mb sector numbered 0.

446 bytes: bootloader, boot loader program, Master Boot Record, boot operating system program;

64 bytes: a partition table. Each 16 bytes identifies a partition. There are only four partitions in total;

2 bytes: indicates whether the MBA is valid; 55AA indicates that the MBA is valid;

Note:

1) a maximum of four primary partitions and only one extended partition can be created.

2) extended partitions cannot be used independently. To continue to be divided into logical partitions, multiple logical partitions can be created.

3) a partition is an independent file system.

4) primary and extended partitions: 1-4; logical partitions: 5 +

Ii. VFS Virtual File System

1. VFS: Virtual File System, intermediate layer between different File systems and upper Interfaces

2. file systems supported by VFS

Linux File System: Ext series [ext2 (no log function), ext3, ext4] (CentOS 5/6)

Xfs (CentOS 7 has no limit on the size of a single file), reiserfs, btrfs

CD: iso9660

Network File System: nfs, cifs

Cluster File System: gfs2 and ocfs2

Kernel-level Distributed File System: ceph

Windows File System: vfat, ntfs

Pseudo File System: proc, sysfs, tmpfs, hugepagefs

Unix file systems: UFS, FFS, JFS

Swap File System: swap

User space distributed file systems: mogilefs, moosefs, glusterfs

3. Log File System

New functions added to the series after Ext2

Working Mode: Enter the operation in the log area and write the operation into the inode and block areas after completion to prevent errors and completely scan the surface.

It will occupy space and CPU performance, but the development of hardware can offset these shortcomings.

This article permanently updates the link address:

Related Article

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.