作者:reistlin
发布时间:January 21, 2011
分类:原创文章
作者: reistlin
来源: http://www.reistlin.com/blog/125
更新时间: 2011.01
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要
Part1:关于主分区的配置
1,执行 fdisk -l 显示分区表信息,检查硬盘设备 /dev/sdb(1TB)
[root@reistlin.com ~]# fdisk -l
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
2,执行 fdisk /dev/sdb 进行分区
[root@reistlin.com ~]# fdisk /dev/sdb
The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
3,按 m 显示菜单,按 p 显示分区表信息
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)
4,按 n,按 p 创建一个主分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
5,按 1 选择一个主分区号,同时选择 First/Last cylinder 定义主分区大小
Partition number (1-4): 1
First cylinder (1-121601, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601):
Using default value 121601
6,主分区建立完成后,按 w 写入,保存并退出
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
7,执行 fdisk -l 显示分区表信息,我们可以看到 /dev/sdb1 是一个主分区,Id 为 83
[root@reistlin.com ~]# fdisk -l
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 121601 976760001 83 Linux
Part2:关于扩展分区,逻辑卷的配置
1,按 n,按 e 创建一个扩展分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
2,按 1 选择一个扩展分区号,同时选择 First/Last cylinder 定义扩展分区大小
Partition number (1-4): 1
First cylinder (1-121601, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601):
Using default value 121601
3,按 n,按 l,创建一个逻辑卷,同时选择 First/Last cylinder 定义逻辑卷大小
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1-121601, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601):
Using default value 121601
4,扩展分区,逻辑卷建立完成后,按 w 写入,保存并退出
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
5,执行 fdisk -l 显示分区表信息,我们可以看到 /dev/sdb1 是一个 Extended 扩展分区,Id 为 5;/dev/sdb5 是扩展分区下的一个逻辑卷,Id 为 83
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 121601 976760001 5 Extended
/dev/sdb5 1 121601 976759969+ 83 Linux
Part3:Thanks Old Yang (RHCE) [http://www.oldyang.net]