本 Wiki 开启了 HTTPS。但由于同 IP 的 Blog 也开启了 HTTPS,因此本站必须要支持 SNI 的浏览器才能浏览。为了兼容一部分浏览器,本站保留了 HTTP 作为兼容。如果您的浏览器支持 SNI,请尽量通过 HTTPS 访问本站,谢谢!
这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版后一修订版两侧同时换到之后的修订记录 | ||
linux:liunxbasics:computerfundamentals:partition [2016/06/08 03:48] – created haregy | linux:liunxbasics:computerfundamentals:partition [2016/06/08 08:04] – haregy | ||
---|---|---|---|
行 1: | 行 1: | ||
====Partition in Liunx==== | ====Partition in Liunx==== | ||
===== ===== | ===== ===== | ||
- | ===Hardrive in Linux=== | + | ===Hardrive |
+ | For SATA, USB, SAS, these type of devices are showing in Linux like: | ||
+ | < | ||
+ | the //a// after// sd// indicates the currently number of harddisk. The order of these number is only associate with the computer checking sequence for harddrives. First is a , then b... | ||
+ | For older IDE, the old version of Linux call them: | ||
+ | < | ||
+ | Since IDE harddrives is no longer used in new generation computers, some new version Linux just put them into **sd** aslo. | ||
+ | ===Other devices format === | ||
+ | ^ Devices | ||
+ | |SCSI / SAS / USB / SATA | / | ||
+ | |IDE| / | ||
+ | |Virtual I/ | ||
+ | |Floppy Disk | / | ||
+ | |Printer | / | ||
+ | |Mouse | / | ||
+ | |CD/DVD ROM | / | ||
+ | \\ | ||
+ | For more devices name: [[https:// | ||
===MBR=== | ===MBR=== | ||
MBR: Master boot record\\ | MBR: Master boot record\\ | ||
+ | A master boot record (MBR) is a special type of boot sector at the very beginning of partitioned computer mass storage devices like fixed disks or removable drives intended for use with IBM PC-compatible systems and beyond. The concept of MBRs was publicly introduced in 1983 with PC DOS 2.0.\\ | ||
+ | MBR infos are usually stored at the first sector of hardrive. It take space of one sector(usually 512Bytes). In this space, there are two mainly data are stored in it: | ||
+ | * MBR (446Bytes in classic MBR) | ||
+ | * Partition Table(64 Bytes, Divided into 4 parts) | ||
+ | So partition in Liunx usually is shown like:< | ||
+ | |||
+ | ==Primary Partition== | ||
+ | A primary partition contains one file system. In DOS and all early versions of Microsoft Windows systems, Microsoft required what it called the system partition to be the first partition. | ||
+ | ==Extended Partition== | ||
+ | Partition is used for keeping data safe by separating sectors into different range. Because Partition table only supports 4 partitions, for getting more partitions, people use a record called** extended boot record (EBR)** to create a new partition that we called Extended partition.In Extended Partition, the space could be divided into 4 or more pieces. Each pieces is called **Logical partition**. Extended partition response for recording partition table for each logical partition. | ||
+ | \\ | ||
+ | {{ : | ||
+ | |||
+ | ==Devices Numbers== | ||
+ | In MBR, the frist 4 numbers are reserved by primary partition and extended partition. Thus, the devices for partition should be like this: | ||
+ | < | ||
+ | / | ||
+ | <WRAP center round info 100%> | ||
+ | sda[1-4] are fully reserved by primary partition and extended partition even they don't exist. Thus the number of logical partition has to start from number 5. Only **one** extended partition could exist at the same time. | ||
+ | </ | ||
+ | <WRAP center round important 100%> | ||
+ | Never combine Primary partition and Logical partition into a new partition, because it will damage partition record in extended partition. Extended partition usually store partition info at the beginning of each logical partition. | ||
+ | </ | ||
+ | |||
+ | ===GPT=== | ||
+ | GPT: GUID partition table\\ | ||
+ | GUID Partition Table (GPT) is a standard for the layout of the partition table on a physical hard disk, using globally unique identifiers (GUID). Although it forms a part of the Unified Extensible Firmware Interface (UEFI) standard (Unified EFI Forum proposed replacement for the PC BIOS), it is also used on some BIOS systems because of the limitations of master boot record (MBR) partition tables, which use 32 bits for storing logical block addresses (LBA) and size information on a traditionally 512 byte disk sector. | ||
+ | {{ : | ||
+ | |||
+ | ==LBA0== | ||
+ | Traditionally, | ||
+ | ==LBA1: | ||
+ | The partition table header defines the usable blocks on the disk. It also defines the number and size of the partition entries that make up the partition table. | ||
+ | The header contains the disk globally unique identifier (GUID). It records its own size and location (always LBA 1) and the size and location of the secondary GPT header and table (always the last sectors on the disk). Importantly, | ||
+ | ==LBA2-33== | ||
+ | This area is used for recording partitions informations. Each LBA has 4 records, total equal to 4 by 32 = 128. Every LBA has 64Bytes space to store number of start / end sectors, Thus, GPT could provide 264 512Bytes = 263 1KBytes = 233TB = 8 ZB space. | ||
+ | ===Advantages of GPT=== | ||
+ | |||
+ | * Unordered List ItemUses GUIDs (UUIDs) to identify partition types - No collisions. | ||
+ | * Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks. | ||
+ | * Arbitrary number of partitions - depends on space allocated for the partition table - No need for extended and logical partitions. By default the GPT table contains space for defining 128 partitions. However if the user wants to define more partitions, he/she can allocate more space to the partition table (currently only gdisk is known to support this feature). | ||
+ | * Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB. MBR is limited to addressing 2 TiB of space per drive. | ||
+ | * Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged. | ||
+ | * CRC32 checksums to detect errors and corruption of the header and partition table. | ||
+ | \\ | ||
+ | {{ : | ||
+ | <WRAP center round info 100%> | ||
+ | Fdisk is not support GPT. | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 100%> | ||
+ | Warning: For Windows, there is no support for booting from a BIOS/GPT partitioning scheme. If you have already installed Windows with a BIOS/MBR partitioning scheme do not convert the drive to GPT! Windows will fail to boot if this is done - irrespective of the bootloader used to chainload Windows. One can either install Windows in UEFI mode and use an UEFI bootloader (which uses GPT), or possibly restore/ | ||
+ | </ | ||
+ | ===BIOS / UEFI=== | ||
+ | BIOS(basic input/ | ||
+ | |||
+ | ==BIOS + MBR== | ||
+ | {{ : | ||