linux创建lvm裸设备Word文档下载推荐.docx
《linux创建lvm裸设备Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《linux创建lvm裸设备Word文档下载推荐.docx(11页珍藏版)》请在冰豆网上搜索。
*
1
1912
15358108+
83
Linux
/dev/hda2
1913
2173
2096482+
82
Linuxswap
/dev/hda3
2174
2610
3510202+
Disk/dev/hdb:
2147MB,2147483648bytes
--可以看到这个设备还没有分区
16heads,63sectors/track,4161cylinders
Units=cylindersof1008*512=516096bytes
Disk/dev/hdbdoesn'
tcontainavalidpartitiontable
[root@rles~]#df-h
Filesystem
Size
UsedAvailUse%Mountedon
15G
7.5G
6.3G
55%/
none
553M
0
0%/dev/shm
3.3G
98M
3.1G
4%/tmp
[root@rles~]#
[root@rles~]#fdisk/dev/hdb
--为设备分区,下面是分区的过程
DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIorOSFdisklabel
BuildinganewDOSdisklabel.Changeswillremaininmemoryonly,
untilyoudecidetowritethem.Afterthat,ofcourse,theprevious
contentwon'
tberecoverable.
Thenumberofcylindersforthisdiskissetto4161.
Thereisnothingwrongwiththat,butthisislargerthan1024,
andcouldincertainsetupscauseproblemswith:
1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)
2)bootingandpartitioningsoftwarefromotherOSs
(e.g.,DOSFDISK,OS/2FDISK)
Warning:
invalidflag0x0000ofpartitiontable4willbecorrectedbyw(rite)
Command(mforhelp):
m
Commandaction
a
toggleabootableflag
b
editbsddisklabel
c
togglethedoscompatibilityflag
d
deleteapartition
l
listknownpartitiontypes
m
printthismenu
n
addanewpartition
o
createanewemptyDOSpartitiontable
p
printthepartitiontable
q
quitwithoutsavingchanges
s
createanewemptySundisklabel
t
changeapartition'
ssystemid
u
changedisplay/entryunits
v
verifythepartitiontable
w
writetabletodiskandexit
x
extrafunctionality(expertsonly)
l
-输入字母L查看分区类型
Empty
1e
HiddenW95FAT175
PC/IX
be
Solarisboot
FAT12
24
NECDOS
80
OldMinix
bf
Solaris
2
XENIXroot
39
Plan9
81
Minix/oldLinc1
DRDOS/sec(FAT-
3
XENIXusr
3c
PartitionMagic
Linuxswap
c4
4
FAT16<
32M
40
Venix80286
Linux
c6
5
Extended
41
PPCPRePBoot
84
OS/2hiddenC:
c7
Syrinx
6
FAT16
42
SFS
85
Linuxextended
da
Non-FSdata
7
HPFS/NTFS
4d
QNX4.x
86
NTFSvolumesetdb
CP/M/CTOS/.
8
AIX
4e
QNX4.x2ndpart87
NTFSvolumesetde
DellUtility
9
AIXbootable
4f
QNX4.x3rdpart8e
LinuxLVM
df
BootIt
OS/2BootManag50
OnTrackDM
93
Amoeba
e1
DOSaccess
W95FAT32
51
OnTrackDM6Aux94
AmoebaBBT
e3
DOSR/O
W95FAT32(LBA)52
CP/M
9f
BSD/OS
e4
SpeedStor
e
W95FAT16(LBA)53
OnTrackDM6Auxa0
IBMThinkpadhieb
BeOSfs
f
W95Ext'
d(LBA)54
OnTrackDM6
a5
FreeBSD
ee
EFIGPT
10
OPUS
55
EZ-Drive
a6
OpenBSD
ef
EFI(FAT-12/16/
11
HiddenFAT12
56
GoldenBow
a7
NeXTSTEP
f0
Linux/PA-RISCb
12
Compaqdiagnost5c
PriamEdisk
a8
DarwinUFS
f1
14
HiddenFAT16<
361
a9
NetBSD
f4
16
HiddenFAT16
63
GNUHURDorSysab
Darwinboot
f2
DOSsecondary
17
HiddenHPFS/NTF64
NovellNetware
b7
BSDIfs
fd
Linuxraidauto
18
ASTSmartSleep
65
b8
BSDIswap
fe
LANstep
1b
HiddenW95FAT370
DiskSecureMultbb
BootWizardhidff
BBT
1c
HiddenW95FAT3
n
extended
primarypartition(1-4)
--这里让输入主分区或者扩展分区,我输入p,表示主分区
p
Partitionnumber(1-4):
4
Firstcylinder(1-4161,default1):
--第几个主分区,这里应该输入1,不过测试也没关系
Usingdefaultvalue1
Lastcylinderor+sizeor+sizeMor+sizeK(1-4161,default4161):
Usingdefaultvalue4161
w
--这里输入w表示writetabletodiskandexit
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
2.查看系统信息,并创建pv
[root@rles~]#fdisk-l
2147MB,2147483648bytes
/dev/hdb4
4161
2097112+
[root@rles~]#pvcreate/dev/hdb4
--创建pv
Physicalvolume"
/dev/hdb4"
successfullycreated
[root@rles~]#pvdisplay/dev/hdb4
--查看pv信息
"
isanewphysicalvolumeof"
2.00GB"
---NEWPhysicalvolume---
PVName
/dev/hdb4
VGName
PVSize
2.00GB
Allocatable
NO
PESize(KByte)
0
TotalPE
FreePE
AllocatedPE
PVUUID
SPLedg-E05Q-nmXf-kwz9-Wbd9-Ci0a-0gwliT
[root@rles~]#ls-l/dev/hdb4
brw-rw----
1rootdisk3,68Jun
520:
48/dev/hdb4
3.创建vg
[root@rles~]#vgcreateoradata/dev/hdb4
Volumegroup"
oradata"
[root@rles~]#ls-l/dev/hdb4
4.创建lv
[root@rles~]#lvcreate-nsystem01-L2040Moradata
Logicalvolume"
system01"
created
[root@rles~]#ls-l/dev/oradata/
total0
lrwxrwxrwx
1rootroot28Jun
522:
54system01->
/dev/mapper/oradata-system01
[root@rles~]#lvremove/dev/oradata/system01
--删除lv
Doyoureallywanttoremoveactivelogicalvolume"
?
[y/n]:
y
successfullyremoved
[root@rles~]#ls-l/dev/oradata/
ls:
/dev/oradata/:
Nosuchfileordirectory
55system01->
5.绑定裸设备
[root@rlesoradata]#raw/dev/raw/raw1/dev/mapper/oradata-system01--注意,之前是没有/dev/raw目录的,执行后会自动创建
/dev/raw/raw1:
boundtomajor253,minor0
[root@rlesoradata]#
[root@rlesoradata]#ls-l/oradata/
total4
drwxr-xr-x
2rootroot4096Jun
523:
21system01
[root@rlesoradata]#raw-qa
--查询裸设备
6.为了保证重启后,可以挂载裸设备,修改下面文件,添加内容
[root@rlesoradata]#cat/etc/sysconfig/rawdevices
#Thisfileandinterfacearedeprecated.
#Applicationsneedingrawdeviceaccessshouldopenregular
#blockdeviceswithO_DIRECT.
#rawdevicebindings
#format:
<
rawdev>
<
major>
minor>
#
blockdev>
#example:
/dev/raw/raw1/dev/sda1
/dev/raw/raw285
/dev/raw/raw1/dev/mapper/oradata-system01
7.重启裸设备服务,验证是否能挂载
[root@rlesoradata]#/etc/init.d/rawdevicesrestart
--重启裸设备服务
Assigningdevices:
/dev/raw/raw1
-->
/dev/mapper/oradata-system01
done
[root@rlesoradata]#ls-l/dev/mapper/
crw-------
1rootroot
10,63Jun
24control
1rootdisk253,
0Jun
24oradata-system01
8.切换到oracle用户,测试在是否能在裸设备上创建表空间
[root@rlesoradata]#su-oracle
[oracle@rles~]$sqlplus'
/assysdba'
SQL*Plus:
Release10.2.0.1.0-ProductiononSatJun523:
41:
392010
Copyright(c)1982,2005,Oracle.
Allrightsreserved.
Connectedtoanidleinstance.
SQL>
startup
ORACLEinstancestarted.
TotalSystemGlobalArea
159383552bytes
FixedSize
1218268bytes
VariableSize
142608676bytes
DatabaseBuffers
12582912bytes
RedoBuffers
2973696bytes
Databasemounted.
Databaseopened.
setlinesize121
select*fromv$tablespace;
TS#NAME