Linux磁盘管——创建分区 fdisk

存储设备类型

Drive解释

Hard drives are kept in /dev and have different names depending on what type of drive they are. IDE/ATA drives are labelled as /dev/hda, /dev/hdb, /dev/hdc and /dev/hdd (since a PC's IDE interfaces can only handle 4 devices at a time). Note that these can be devices such as IDE/ATA CDROMS, Compact Flash to IDE converters, and some special floppy drives (although they tend to appear mainly in laptops). For SCSI devices the labels are /dev/sda, /dev/sdb, /dev/sdc, /dev/sdd, /dev/sde, /dev/sdf, /dev/sdg, /dev/sdh and /dev/sdi (since a SCSI chain can contain up to nine devices). Other types of drive, such as USB, SATA, etc. are mapped to these SCSI devices by Linux. Therefore SATA and USB drives are labelled as /dev/sdX where X is a letter, starting at "a".

创建分区

参考:fdisk

Linux内核识别到的分区

[root@51cto ~]# cat /proc/partitions 
major minor  #blocks  name

   8        0  167772160 sda
   8        1     204800 sda1
   8        2   20480000 sda2
   8        3   20480000 sda3
   8        4          1 sda4
   8        5   20480000 sda5
   8        6     262144 sda6

fdisk –l          查看所有硬盘的所有分区
fdisk –l  /dev/sda     常看一个盘的分区
p           打印现在分区表
n              创建的新的分区
e           扩展分区
p              主分区
d              删除分区
w             保存退出
q              不保存退出
fdisk命令 删除前面的字符ctrl+backspace  

猜你喜欢

转载自www.cnblogs.com/kelamoyujuzhen/p/9149568.html