日期:2014-05-16  浏览次数:21000 次

linux下添加逻辑分区并挂载(手动和自动方式)
一、查看新磁盘
[root@desktop61 Desktop]# fdisk -cul /dev/sdc

Disk /dev/sdc: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
二添加逻辑分区
[root@desktop61 Desktop]# fdisk -cu /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x740491c5.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.


Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)


Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)


Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e---------------〉选择扩展分区
Partition number (1-4): 2
First sector (2048-41943039, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): 10G
Value out of range.
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +10G


Command (m for help): N
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
L-----------------〉选择逻辑分区
First sector (4096-20973567, default 4096): 
Using default value 4096
Last sector, +sectors or +size{K,M,G} (4096-20973567, default 20973567): +5G


Command (m for help): N
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
L-------------------〉选择逻辑分区
First sector (10491904-20973567, default 10491904): 
Using default value 10491904
Last sector, +sectors or +size{K,M,G} (10491904-20973567, default 20973567): +5G
Value out of range.
Last sector, +sectors or +size{K,M,G} (10491904-20973567, default 20973567): 
Using default value 20973567


Command (m for help): P--------------->打印分区列表


Disk /dev/sdc: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x740491c5


   Device Boot      Start         End      Blocks   Id  System
/dev/sdc2            2048    20973567    10485760    5  Extended
/dev/sdc5            4096    10489855     5242880   83  Linux
/dev/sdc6        10491904