|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
欢迎大家来到仓酷云论坛!1.检查硬盘分区情形注:假定新增一个硬盘的装备文件名为/dev/sdb
2.开端分区3.检查指令赞助信息4.检查已有分区表Command(mforhelp):p
Disk/dev/sdb:500.0GB,500097376256bytes
255heads,63sectors/track,60800cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdb1*1608004883759687HPFS/NTFS 注:可以看出此硬盘曾经有一个分区,且一切的柱面都已分派
5.删除原有分区6.再次检查分区表Command(mforhelp):p
Disk/dev/sdb:500.0GB,500097376256bytes
255heads,63sectors/track,60800cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem 7.新增分区Command(mforhelp):n
Commandaction
eextended
pprimarypartition(1-4) 8.选择分区类型(主分区、扩大分区)、第几个分区9.设置分区的柱面规模,这里开端与停止都默许,直接回车
10.检查分区表Command(mforhelp):p
Disk/dev/sdb:500.0GB,500097376256bytes
255heads,63sectors/track,60800cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdb1160800488375968+83Linux 11.更改分区的类型Command(mforhelp):t
Selectedpartition1
Hexcode(typeLtolistcodes):L 注:假如有多个分区,会涌现提醒选择分区
10Empty1eHiddenW95FAT180OldMinixbfSolaris
21FAT1224NECDOS81Minix/oldLinc1DRDOS/sec(FAT-
32XENIXroot39Plan982Linuxswap/Soc4DRDOS/sec(FAT-
43XENIXusr3cPartitionMagic83Linuxc6DRDOS/sec(FAT-
54FAT16<32M40Venix8028684OS/2hiddenC:c7Syrinx
65Extended41PPCPRePBoot85LinuxextendeddaNon-FSdata
76FAT1642SFS86NTFSvolumesetdbCP/M/CTOS/.
87HPFS/NTFS4dQNX4.x87NTFSvolumesetdeDellUtility
98AIX4eQNX4.x2ndpart88LinuxplaintextdfBootIt
109AIXbootable4fQNX4.x3rdpart8eLinuxLVMe1DOSaccess
11aOS/2BootManag50OnTrackDM93Amoebae3DOSR/O
12bW95FAT3251OnTrackDM6Aux94AmoebaBBTe4SpeedStor
13cW95FAT32(LBA)52CP/M9fBSD/OSebBeOSfs
14eW95FAT16(LBA)53OnTrackDM6Auxa0IBMThinkpadhieeEFIGPT
15fW95Extd(LBA)54OnTrackDM6a5FreeBSDefEFI(FAT-12/16/
1610OPUS55EZ-Drivea6OpenBSDf0Linux/PA-RISCb
1711HiddenFAT1256GoldenBowa7NeXTSTEPf1SpeedStor
1812Compaqdiagnost5cPriamEdiska8DarwinUFSf4SpeedStor
1914HiddenFAT16<361SpeedStora9NetBSDf2DOSsecondary
2016HiddenFAT1663GNUHURDorSysabDarwinbootfbVMwareVMFS
2117HiddenHPFS/NTF64NovellNetwareb7BSDIfsfcVMwareVMKCORE
2218ASTSmartSleep65NovellNetwareb8BSDIswapfdLinuxraidauto
231bHiddenW95FAT370DiskSecureMultbbBootWizardhidfeLANstep
241cHiddenW95FAT375PC/IXbeSolarisbootffBBT
12.将磁盘格局设置为linuxLVMHexcode(typeLtolistcodes):8e
Changedsystemtypeofpartition1to8e(LinuxLVM) 13.再次检查分区表Command(mforhelp):p
Disk/dev/sdb:500.0GB,500097376256bytes
255heads,63sectors/track,60800cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdb1160800488375968+8eLinuxLVM 14.保留,加入fdiskCommand(mforhelp):w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks. 假如失足,应用partprobe指令重载分区表
15.检查硬盘分区情形#fdisk-l
Disk/dev/sdb:500.0GB,500097376256bytes
255heads,63sectors/track,60800cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdb1160800488375968+8eLinuxLVM 16.检查体系中已有的物理卷#pvdisplay
---Physicalvolume---
PVName/dev/sda2
VGNameVolGroup00
PVSize297.99GB/notusable20.87MB
Allocatableyes(butfull)
PESize(KByte)32768
TotalPE9535
FreePE0
AllocatedPE9535
PVUUIDoa2rNU-Tz2c-N1W0-AKcV-9UnE-ctdp-38dFQd 17.树立物理卷#pvcreate/dev/sdb1
Writingphysicalvolumedatatodisk"/dev/sdb1"
Physicalvolume"/dev/sdb1"successfullycreated 18.将新物理卷参加到卷组中#vgextendVolGroup00/dev/sdb1
Volumegroup"VolGroup00"successfullyextended 19.将新的空间加到原有逻辑卷中去#lvextend-L+500G/dev/VolGroup00/LogVol00 20.激活扩容的LVM分区#resize2fs-p/dev/VolGroup00/LogVol00 21.假如不扩容,可以增长逻辑卷#lvcreate-L200G-nlvol0VolGroup00
Logicalvolume"lvol0"created 22.删除逻辑卷#lvremove/dev/mapper/VolGroup00-lvol0 23.检查曾经存在的逻辑卷#lvdisplay
---Logicalvolume---
LVName/dev/VolGroup00/LogVol00
VGNameVolGroup00
LVUUIDipf0Gk-3xXU-vN0I-cXbm-ZKLD-XUju-mDe02Z
LVWriteAccessread/write
LVStatusavailable
#open1
LVSize48.81GB
CurrentLE1562
Segments1
Allocationinherit
Readaheadsectorsauto
-currentlysetto256
Blockdevice253:0
---Logicalvolume---
LVName/dev/VolGroup00/LogVol02
VGNameVolGroup00
LVUUIDRybA0Q-5B8T-bOwA-SsPK-Prai-qsix-kCeWWI
LVWriteAccessread/write
LVStatusavailable
#open1
LVSize49.91GB
CurrentLE1597
Segments1
Allocationinherit
Readaheadsectorsauto
-currentlysetto256
Blockdevice253:1
---Logicalvolume---
LVName/dev/VolGroup00/LogVol03
VGNameVolGroup00
LVUUIDczznK0-VsUK-VAtj-Vbam-PDJS-1yZt-A6BPgK
LVWriteAccessread/write
LVStatusavailable
#open1
LVSize195.31GB
CurrentLE6250
Segments1
Allocationinherit
Readaheadsectorsauto
-currentlysetto256
Blockdevice253:2
---Logicalvolume---
LVName/dev/VolGroup00/LogVol01
VGNameVolGroup00
LVUUIDzvLpEL-Dj8Y-a0XG-4H7q-ZPaa-XUXY-0ln7qw
LVWriteAccessread/write
LVStatusavailable
#open1
LVSize3.94GB
CurrentLE126
Segments1
Allocationinherit
Readaheadsectorsauto
-currentlysetto256
Blockdevice253:3 24.正式新增逻辑卷
#lvcreate-L500G-nLogVol04VolGroup00
25.格局化新增逻辑卷
#mkfs.ext3/dev/mapper/VolGroup00-LogVol04
26.挂载逻辑卷
#mount/dev/mapper/VolGroup00-LogVol04/data
27.编纂/etc/fstab将新增逻辑卷设置开机挂载,新增上面一行/dev/VolGroup00/LogVol04/dataext3defaults12 28.测试挂载29.检查并删除物理卷
检查挂载情形#df-h
/dev/mapper/VolGroup00-LogVol04
296G245M281G1%/backup 卸载删除逻辑卷#lvremove/dev/mapper/VolGroup00-LogVol04 检查物理卷#pvdisplay
---Physicalvolume---
PVName/dev/sda2
VGNameVolGroup00
PVSize297.99GB/notusable20.87MB
Allocatableyes(butfull)
PESize(KByte)32768
TotalPE9535
FreePE0
AllocatedPE9535
PVUUIDoa2rNU-Tz2c-N1W0-AKcV-9UnE-ctdp-38dFQd
---Physicalvolume---
PVName/dev/sdb1
VGNameVolGroup00
PVSize465.75GB/notusable1.66MB
Allocatableyes
PESize(KByte)32768
TotalPE14904
FreePE5304
AllocatedPE9600
PVUUIDavEKz2-t5Ko-jsn0-Pvuh-h8DJ-GV0o-ZQfBOL 将物理卷从卷组中移除#vgreduceVolGroup00/dev/sdb1 删除物理卷如许就能够从新停止格局化磁盘
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|