What & How & Why

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

后一修订版
前一修订版
后一修订版两侧同时换到之后的修订记录
linux:liunxbasics:computerfundamentals:partition [2016/06/08 03:48] – created haregylinux:liunxbasics:computerfundamentals:partition [2016/06/08 07:25] haregy
行 1: 行 1:
 ====Partition in Liunx==== ====Partition in Liunx====
 ===== ===== ===== =====
-===Hardrive in Linux===+===Hardrive format in Linux=== 
 +For SATA, USB, SAS, these type of devices are showing in Linux like: 
 +<code>/dev/sd[a-]</code> 
 +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: 
 +<code>/dev/hd[a-]</code> 
 +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  ^  Name in Liunx  ^ 
 +|SCSI / SAS / USB / SATA |  /dev/sd[a-p] 
 +|IDE|  /dev/hd[a-p](Only in older Liunx) 
 +|Virtual I/O(included in Liunx |  /dev/vd[a-p] 
 +|Floppy Disk |  /dev/fd[a-p] 
 +|Printer |  /dev/lp[0-2](25pin) # /dev/lp[0-15](USB) 
 +|Mouse |  /dev/mouse(currently in use) # /dev/psaux(PS/2) # /dev/input/mouse[0-15](general) | 
 +|CD/DVD ROM |  /dev/scd[0-1](general) # /dev/sr[0-1](CentOS) # /dev/cdrom(currently in use)  | 
 +\\ 
 +For more devices name: [[https://www.kernel.org/doc/Documentation/devices.txt|Link]] 
  
 ===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:<code>/dev/sd[hardrive number][partition number]</code>
 +
 +==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.
 +\\
 +{{ :linux:liunxbasics:computerfundamentals:mbr.png?600 |}}
 +
 +==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:
 +<code>/dev/sda[1-4] // primary partition and extended partition
 +/dev/sda[5-]  // logical partition</code>
 +<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>
 +<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.
 +</WRAP>
 +
 +