Linux Disk Management

Source: Internet
Author: User

Liunx Disk Management

1 , the first hard drive/DEV/SDA the second block/dev/sdb the third block/DEV/SBC

Installed before the system is generally installed RAID,LVM not commonly used

Partition----> Format-mounted disks

The first partition/dev/sda1 and so on

2 , Disk classification: mechanical disks, solid-state drives

3 ,free-m query Memory

System real Memory is Buffers/cache

buffers to write buffers, Sync writes buffers buffer data to disk

Cache to read the cache, the data in the disk is read out and stored in the cache.

2 , production environment mainstream server

Internet company mainstream servers: Dell Majority, IBM, HP

Major disks: SAS, SATA, SSD hard drives

1 ) Enterprise-class SAS HDD: 15000 rpm----300G, 600G, 1P.

A business Server used to provide general external services on the production line.

For example: on-line database business, storage business, image business and related high concurrency business, no special business requirements, SAS disk is preferred.

2 ) Enterprise-class SATA HDD: 7200-10000 rpm, common capacity 1t/2t, large cost-effective capacity

The main application is not to provide services on-line data storage or high concurrent business access to a small number of business applications

Less: Site programs and databases, pictures of offline backup and so on.

3) SSD Solid-state drives:

Small capacity, high price

Summary:

1 , online Business (external service), choose SAS Hard disk.

2 , Offline services (not available), SATA hard drives.

3 , line high concurrency small capacity business, SSD hard disk.

4 , and intelligently analyze tiered storage based on the data's access heat. (SATA+SSD)

Special attention:

Never use SATA hard drives to do online high-concurrency services or database business, which has the blood lesson:

A company using SATA database storage disk, resulting in a continuous database downtime for one months.

WORKAROUND: Convert the disk from SATA (RAID5) to SAS (RAID10)

Linux Disk Basics:

disk-- disk head--Head sector-sector track-track cylinder-cylinder

units- Cell Block block-data Block inode-index node

MBR The Master boot record includes:

Master boot Record (446 bytes) + Partition table (64 bytes) + End identifier (2 bytes)

Partition table: Four partition table, 16 bytes per partition table.

DD IF=/DEV/SDA of=mbr.bin bs=512 count=1

File Mbr.bin

Od-xa Mbr.bin View MBR content

Disk partitioning

1) The disk partition is essentially a 64-byte partition table for 0 Tracks 1 sectors, the partitioning tool fdisk (a disk with a river drizzle of 2 T), parted (suitable for disks larger than 2T, can partition less than 2T).

2) the partition of a disk is only 64bytes in size and only four partition table information (primary + extended partition) is supported.

3) the smallest unit of disk partitioning is a cylindrical face.

4) extended partitions cannot be used directly, and logical partitions need to be created.

5) An extended partition has its own partition table, so there can be more than one logical partition under the extended partition. Partitions are generally required before disk use, although it is not a problem to use the direct formatting without partitioning, but this is not a common situation.

6) a disk can have up to four partition information (the limit of the disk itself).

Primary partition Primary

In general, the primary partition is the partition that must exist on the disk, typically the first partition of the disk, and the operating system can be installed on the primary partition.

We install the system:

/ Boot Primary Partition

Swap Primary Partition

/    Primary Partition

/data Primary Partition

Extended partition:

Strictly speaking, the extended partition is not a normal partition, but a link, play a point of the role, we can expand the partition within the logical partition, expand the partition like a virtual out of a small hard disk, the difference is not MBR, and only the extended partition table, and the Extended partition table does not have a 64bytes limit, So you can divide multiple logical partitions in an extended partition.

A hard disk can only have one extended partition, and the extended partition cannot hold the data directly, and the extended partition is limited by the operating system.

Logical partition:

Logical partitions cannot be partitioned directly on disk and must exist within the extended partition. Multiple logical partitions can be divided within the extended partition, and the logical partition ports start with the number 5, where multiple logical partitions can be divided (the IDE disk may be numbered 5-63), SATA (number 5-15).

Precautions:

Due to the limitations of MBR and disk partition table size, if the disk is allocated 4p or 3p+e, even if the disk has the remaining space, then this part of the space can not be partitioned, because no partition is divided, partition table space is full. Therefore, when doing zoning planning, if the business needs, before the partition has been clear to more than 4 partitions, then you can choose 3p+e partition method, and in the last extended partition to all the remaining space allocated to this extended partition, of course, can also be used 1p+e,2p+e partition mode.

Description

1 , the extended partition is not a true usable partition, the extended partition is established, and a logical partition on the extended partition is required to be used.

2 , there is no difference between the primary partition and the logical partition generally used for data storage (for most data stores), the primary partition to be selected when the operating system is installed is the first partition.

3 , partition number 1-4 is reserved for primary or extended partitions, the logical partition number can only start at 5, and even if the 1-4 partition is left, the grid logical partition is not allocated.

4 , the hard disk partition, is actually modifies the hard disk partition table (partitiontable), that is, we through the Fdisk partition is actually in the change 64 byte partition table, the partition and the corresponding data has no relation. Therefore, in theory, resizing a partition does not delete the data within the partition.

Special instructions: The disk can be non-partitioned, directly formatted to use, but it is not recommended to do so.

Doing operation and maintenance of the road is usually the better off.

Common partitions:

1 , General partitioning

/boot 100M

Swap 1.5 Times

/ remaining disk size

2 , DB, and storage: There's a lot of data

/boot 100M

/50-200g

Swap 1.5 Times Memory

/data the remaining hard disk size, the data storage

3 , portal Big website

/ Boot 100M Primary Partition

/swap 1.5 double Memory Primary partition

/20-200g

No longer partition, keep, which will be divided in the future, and then according to the needs of---flexible expansion of the partition

Why is a sector only 512 bytes, why not 1024 bytes?

All vendor-defined standards

LVM poor performance, not recommended.


This article is from the "12349525" blog, please be sure to keep this source http://12359525.blog.51cto.com/12349525/1936477

Linux Disk Management

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.