资源描述:
《Linux VPS下启用未使用的硬盘空间扩充LVM》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、LinuxVPS下启用未使用的硬盘空间扩充LVMSSH登陆后,查看现有分区、挂载及swap情况:可以看到大概8G的硬盘空间分布情况df-halfree-m[root@XenSystem~]#df-halFilesystemSizeUsedAvailUse%Mountedon/dev/mapper/VolGroup00-LogVol005.7G1.1G4.4G20%/proc000-/procsysfs000-/sysdevpts000-/dev/pts/dev/xvda199M27M67M29%/boottmpfs257M0257M
2、0%/dev/shmnone000-/proc/sys/fs/binfmt_miscsunrpc000-/var/lib/nfs/rpc_pipefs[root@XenSystem~]#free-m total used free shared buffers cachedMem: 512 506 5 0 447 9-/+buffers/cache: 49 463Swap: 2079 0
3、 2079查看硬盘设备列表:fdisk-lDisk/dev/xvdb:23.6GB,23622320128bytes255heads,63sectors/track,2871cylindersUnits=cylindersof16065*512=8225280bytesDisk/dev/xvdbdoesn'tcontainavalidpartitiontableDisk/dev/xvda:8589MB,8589934592bytes255heads,63sectors/track,1044cylindersUnits=cylind
4、ersof16065*512=8225280bytes DeviceBoot Start End Blocks Id System/dev/xvda1 * 1 13 104391 83 Linux/dev/xvda2 14 1044 8281507+ 8e LinuxLVM硬盘/dev/xvdb尚未划分使用,接下来我们为dev/xvdb分区fdisk/dev/xvdb[root@XenSystem~]#fdisk/dev/xvdbD
5、evicecontainsneitheravalidDOSpartitiontable,norSun,SGIorOSFdisklabelBuildinganewDOSdisklabel.Changeswillremaininmemoryonly,untilyoudecidetowritethem.Afterthat,ofcourse,thepreviouscontentwon'tberecoverable.Thenumberofcylindersforthisdiskissetto2871.Thereisnothingwrongwi
6、ththat,butthisislargerthan1024,andcouldincertainsetupscauseproblemswith:1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)2)bootingandpartitioningsoftwarefromotherOSs (e.g.,DOSFDISK,OS/2FDISK)Warning:invalidflag0x0000ofpartitiontable4willbecorrectedbyw(rite)#输入n,新建分
7、区Command(mforhelp):n#输入P,主分区Commandaction e extended p primarypartition(1-4)p#目前是xvdb第一个分区输入1Partitionnumber(1-4):1#敲回车,默认就行了Firstcylinder(1-2871,default1):Usingdefaultvalue1Lastcylinderor+sizeor+sizeMor+sizeK(1-2871,default2871):Usingdefaultvalue2871#这里输入t,指定分区的格式
8、为8e(LVM)Command(mforhelp):tSelectedpartition1Hexcode(typeLtolistcodes):8eChangedsystemtypeofpartition1to8e(LinuxLVM)#