时间:2015-04-01 17:02:34 作者:qipeng 来源:系统之家 1. 扫描二维码随时看资讯 2. 请使用手机浏览器访问: https://m.xitongzhijia.net/xtjc/20150401/43673.html 手机查看 评论 反馈
扩展分区建好我们就可以在扩展分区建立逻辑分区
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l #建逻辑分区
First cylinder (263-785, default 263):
Using default value 263
Last cylinder, +cylinders or +size{K,M,G} (263-785, default 785): +2G
Command (m for help): p
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfaa2aa49
Device Boot Start End Blocks Id System
/dev/sdb1 1 262 2104483+ 83 Linux
/dev/sdb4 263 785 4200997+ 5 Extended
/dev/sdb5 263 524 2104483+ 83 Linux
上面显示已经建好一个主分区,一个逻辑分区,但是这些现在还没有生效我们需要保存退出。
Command (m for help): w #保存退出
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@bogon 桌面]# fdisk -l
Disk /dev/sda: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000471ad
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 3851 30720000 83 Linux
/dev/sda3 3851 4106 2048000 82 Linux swap / Solaris
/dev/sda4 4106 10444 50912256 5 Extended
/dev/sda5 4106 10444 50911232 83 Linux
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfaa2aa49
Device Boot Start End Blocks Id System
/dev/sdb1 1 262 2104483+ 83 Linux
/dev/sdb4 263 785 4200997+ 5 Extended
/dev/sdb5 263 524 2104483+ 83 Linux
再次查看就看到了/dev/sdb的分区信息,虽然现在我们看到进行分区了,但是内核kenel还没有识别为了不要重启将分区表写入kenel我们要用到partprobe工具:使kenel重新读取分区表。
[root@bogon 桌面]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (设备或资源忙)。 As a result, it may not reflect all of your changes until after reboot.
kenel识别分区表后,我们还不能使用它要对其进行格式化。mkfs.加文件系统格式,扩展分区是不能格式化的。
[root@bogon 桌面]# mkfs.ext4 /dev/sdb1 #格式化成ext4文件格式(要分区格式化,不能将整个硬盘格式化)
mke2fs 1.41.12 (17-May-2010)
发表评论
共0条
评论就这些咯,让大家也知道你的独特见解
立即评论以上留言仅代表用户个人观点,不代表系统之家立场