linux分区及逻辑卷划分.doc
《linux分区及逻辑卷划分.doc》由会员分享,可在线阅读,更多相关《linux分区及逻辑卷划分.doc(12页珍藏版)》请在冰豆网上搜索。
划分磁盘阵列和创建逻辑卷
标题
内容
01创建磁盘阵列分区
介绍如何创建磁盘阵列分区。
02创建逻辑卷组和逻辑卷
介绍如何创建逻辑卷组和逻辑卷。
03绑定逻辑卷和裸设备
介绍如何绑定逻辑卷和裸设备。
1创建磁盘阵列分区
任务说明
执行此任务可以手动格式化磁盘阵列并根据需要创建新的分区。
本节以在双机上创建分区/dev/sdc1为例,给出手动创建磁盘分区的方法。
操作时请根据实际的安装规划调整分区的具体信息。
操作指引
创建磁盘阵列的磁盘分区操作步骤如下:
步骤1以root用户登录主节点。
步骤2检查磁盘阵列的分区信息。
#fdisk-l
屏幕显示信息如下(供参考)。
Disk/dev/sda:
40.0GB,40007756288bytes
64heads,32sectors/track,38154cylinders
Units=cylindersof2048*512=1048576bytes
DeviceBootStartEndBlocksIdSystem
/dev/sda111024104856082Linuxswap
/dev/sda21025112641048576083Linux
/dev/sda311265381542753536083Linux
Disk/dev/sdb:
128.8GB,128849018880bytes
255heads,63sectors/track,15665cylinders
Units=cylindersof16065*512=8225280bytes
Disk/dev/sdbdoesn'tcontainavalidpartitiontable
Disk/dev/sdc:
73.1GB,73139224576bytes
255heads,63sectors/track,8892cylinders
Units=cylindersof16065*512=8225280bytes
Disk/dev/sdcdoesn'tcontainavalidpartitiontable
从以上加粗的信息可以看出磁盘阵列里的逻辑盘sdb和sdc没有划分分区。
步骤3格式化磁盘。
#fdisk/dev/sdc
屏幕显示信息如下(供参考)。
Thenumberofcylindersforthisdiskissetto8892.
Thereisnothingwrongwiththat,butthisislargerthan1024,
andcouldincertainsetupscauseproblemswith:
1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)
2)bootingandpartitioningsoftwarefromotherOSs
(e.g.,DOSFDISK,OS/2FDISK)
步骤4查看fdisk命令的参数。
Command(mforhelp):
m
屏幕显示信息如下(供参考)。
Commandaction
atoggleabootableflag
beditbsddisklabel
ctogglethedoscompatibilityflag
ddeleteapartition
llistknownpartitiontypes
mprintthismenu
naddanewpartition
ocreateanewemptyDOSpartitiontable
pprintthepartitiontable
qquitwithoutsavingchanges
screateanewemptySundisklabel
tchangeapartition'ssystemid
uchangedisplay/entryunits
vverifythepartitiontable
wwritetabletodiskandexit
xextrafunctionality(expertsonly)
步骤5查看磁盘/dev/sdc的分区表。
Command(mforhelp):
p
屏幕显示信息如下(供参考)。
Disk/dev/sdc:
73.1GB,73139224576bytes
255heads,63sectors/track,8892cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
步骤6给磁盘/dev/sdc添加新的分区。
Command(mforhelp):
n
屏幕显示信息如下(供参考)。
Commandaction
eextended
pprimarypartition(1-4)
步骤7配置分区信息。
1.输入“p”,设定分区为主分区,按“Enter”键。
2.输入“1”,划分/dev/sdc1分区,按“Enter”键。
Partitionnumber(1-4):
1
3.输入柱面开始位置,按“Enter”键。
Firstcylinder(1-8892,default1):
1
4.输入柱面结束位置,按“Enter”键。
Lastcylinderor+sizeor+sizeMor+sizeK(1-8892,default8892):
8892
步骤8设置分区ID。
1.输入修改分区编号的命令。
Command(mforhelp):
t
2.输入待修改的分区编号。
Partitionnumber(1-4):
1
3.输入分区类型“8e”。
Hexcode(typeLtolistcodes):
8e
步骤9查看磁盘/dev/sdc的分区表,检查分区是否成功。
Command(mforhelp):
p
屏幕显示信息如下(供参考)。
Disk/dev/sdc:
73.1GB,73139224576bytes
255heads,63sectors/track,8892cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdc11889271424958+8eLinuxLVM
步骤10将分区信息写入分区表并退出fdisk命令。
Command(mforhelp):
w
屏幕显示信息如下(供参考)。
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
WARNING:
Re-readingthepartitiontablefailedwitherror16:
Deviceorresourcebusy.
Thekernelstillusestheoldtable.
Thenewtablewillbeusedatthenextreboot.
Syncingdisks.
步骤11重启操作系统。
#reboot
步骤12检查磁盘阵列的分区信息。
#fdisk-l
屏幕显示信息如下(供参考)。
Disk/dev/sda:
40.0GB,40007756288bytes
64heads,32sectors/track,38154cylinders
Units=cylindersof2048*512=1048576bytes
DeviceBootStartEndBlocksIdSystem
/dev/sda111024104856082Linuxswap
/dev/sda21025112641048576083Linux
/dev/sda31126538154275353605Extended
/dev/sda511265215041048574483Linux
/dev/sda621505378881677720083Linux
Disk/dev/sdb:
128.8GB,128849018880bytes
255heads,63sectors/track,15665cylinders
Units=cylindersof16065*512=8225280bytes
Disk/dev/sdbdoesn'tcontainavalidpartitiontable
Disk/dev/sdc:
73.1GB,73139224576bytes
255heads,63sectors/track,8892cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdc11889271424958+8eLinuxLVM
----结束
2创建逻辑卷组和逻辑卷
任务说明
执行此任务可以手动创建物理卷、逻辑卷组和逻辑卷。
l上一节划分了分区/dev/sdc1。
本节在双机上以/dev/sdc1为物理卷创建逻辑卷组oracledg及其逻辑卷为例,介绍如何手动创建逻辑卷组和逻辑卷。
l逻辑卷组oracledg的逻辑卷划分以安装规划为准。
操作指引
创建逻辑卷组和逻辑卷操作步骤如下:
步骤1以root用户登录主节点。
步骤2创建物理卷。
#pvcreate/dev/sdc1
屏幕显示信息如下(供参考)。
P