![](https://img.51dongshi.com/20250105/wz/18528817452.jpg)
?系統大全為您提供1,介紹LVM是邏輯盤卷管理(LogicalVolumeManager)的簡稱,它是Linux環境下對磁盤分區進行管理的一種機制,LVM是建立在硬盤和分區之上的一個邏輯層,來提高磁盤分LVM區管理的靈活性。前面談到,LVM是在磁盤分區和文件系統之間添加的一個邏輯層,來為文件系統屏蔽下層磁盤分區布局,提供一個抽象的盤卷,在盤卷上建立文件系統。物理卷(physicalvolume)物理卷就是指硬盤分區或從邏輯上與磁盤分區具有同樣功能的設備(如RAID),是LVM的基本存儲邏輯塊,但和基本的物理存儲介質(如分區、磁盤等)比較,卻包含有與LVM相關的管理參數。2,創建[root@cn-iss-install-01mapper]#fdisk-l[root@cn-iss-install-01mapper]#fdisk/dev/sdbDevicecontainsneitheravalidDOSpartitiontable,norSun,sgiorOSFdisklabelBuildinganewDOSdisklabelwithdiskidentifier0x874c7742.Changeswillremaininmemoryonly,untilyoudecidetowritethem.Afterthat,ofcourse,theprevIoUscontentwon'tberecoverable.Warning:invalidflag0x0000ofpartitiontable4willbecorrectedbyw(rite)WARNING:DOS-compatiblemodeisdeprecated.It'sstronglyrecommendedtoswitchoffthemode(command'c')andchangedisplayunitstosectors(command'u').Command(mforhelp):mCommandactionatoggleabootableflagbeditbsddisklabelctogglethedoscompatibilityflagddeleteapartitionllistkNownpartitiontypesmprintthismenunaddanewpartitionocreateanewemptyDOSpartitiontablepprintthepartitiontableqquitwithoutsavingchangesscreateanewemptySundisklabeltchangeapartition'ssystemiduchangedisplay/entryunitsvverifythepartitiontablewwritetabletodiskandexitxextrafunctionality(expertsonly)Command(mforhelp):pdisk/dev/sdb:96.6GB,96636764160bytes255heads,63sectors/track,11748cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesdiskidentifier:0x874c7742DeviceBootStartEndBlocksIdSystemCommand(mforhelp):nCommandactioneextendedpprimarypartition(1-4)pPartitionnumber(1-4):1Firstcylinder(1-11748,default1):Usingdefaultvalue1Lastcylinder,+cylindersor+size{K,M,G}(1-11748,default11748):+80GCommand(mforhelp):pdisk/dev/sdb:96.6GB,96636764160bytes255heads,63sectors/track,11748cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesdiskidentifier:0x874c7742DeviceBootStartEndBlocksIdSystem/dev/sdb111044483891398+5ExtendedCommand(mforhelp):wThepartitiontablehasbeenaltered!Callingioctl()tore-readpartitiontable.Syncingdisks.[root@cn-iss-install-01mapper]#rebootor[root@cn-iss-install-01Packages]#partprobe[root@cn-iss-install-01~]#fdisk-ldisk/dev/sda:17.2GB,17179869184bytes64heads,32sectors/track,16384cylindersUnits=cylindersof2048*512=1048576bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesdiskidentifier:0x0005b1c0DeviceBootStartEndBlocksIdSystem/dev/sda1*225125600083LinuxPartition1doesnotendoncylinderboundary./dev/sda225216384165201928eLinuxLVMPartition2doesnotendoncylinderboundary.disk/dev/sdb:96.6GB,96636764160bytes255heads,63sectors/track,11748cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesdiskidentifier:0x874c7742DeviceBootStartEndBlocksIdSystem/dev/sdb111044483891398+5Extendeddisk/dev/mapper/VG00-LV_rootfs:16.4GB,16374562816bytes255heads,63sectors/track,1990cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesdiskidentifier:0x00000000disk/dev/mapper/VG00-LV_swap:536MB,536870912bytes255heads,63sectors/track,65cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesdiskidentifier:0x00000000[root@cn-iss-install-01~]#[root@cn-iss-install-01Packages]#pvcreate/dev/sdb1Writingphysicalvolumedatatodisk"/dev/sdb1"Physicalvolume"/dev/sdb1"successfullycreated[root@cn-iss-install-01Packages]#[root@cn-iss-install-01Packages]#vgcreatevg03/dev/sdb1Volumegroup"vg03"successfullycreated[root@cn-iss-install-01Packages]#lvcreate-L83G-nvgdatavg03[root@cn-iss-install-01Packages]#mke2fs/dev/vg03/vgdatamke2fs1.41.12(17-May-2010)Filesystemlabel=OStype:LinuxBlocksize=4096(log=2)Fragmentsize=4096(log=2)Stride=0blocks,Stripewidth=0blocks5439488inodes,21757952blocks1087897blocks(5.00%)reservedforthesuperuserFirstdatablock=0Maximumfilesystemblocks=4294967296664blockgroups32768blockspergroup,32768fragmentspergroup8192inodespergroupSuperblockbackupsstoredonblocks:32768,98304,163840,229376,294912,819200,884736,1605632,2654208,4096000,7962624,11239424,20480000Writinginodetables:doneWritingsuperblocksandfilesystemaccountinginformation:doneThisfilesystemwillbeautomaticallycheckedevery23mountsor180days,whichevercomesfirst.Usetune2fs-cor-itooverride.[root@cn-iss-install-01Packages]#[root@cn-iss-install-01Packages]#[root@cn-iss-install-01Packages]#mkfmkfifomkfs.cramfsmkfs.ext3mkfs.ext4devmkfsmkfs.ext2mkfs.ext4[root@cn-iss-install-01Packages]#mkfs.ext4/dev/vg03/vgdatamke2fs1.41.12(17-May-2010)Filesystemlabel=OStype:LinuxBlocksize=4096(log=2)Fragmentsize=4096(log=2)Stride=0blocks,Stripewidth=0blocks5439488inodes,21757952blocks1087897blocks(5.00%)reservedforthesuperuserFirstdatablock=0Maximumfilesystemblocks=4294967296664blockgroups32768blockspergroup,32768fragmentspergroup8192inodespergroupSuperblockbackupsstoredonblocks:32768,98304,163840,229376,294912,819200,884736,1605632,2654208,4096000,7962624,11239424,20480000Writinginodetables:doneCreatingjournal(32768blocks):doneWritingsuperblocksandfilesystemaccountinginformation:doneThisfilesystemwillbeautomaticallycheckedevery37mountsor180days,whichevercomesfirst.Usetune2fs-cor-itooverride.[root@cn-iss-install-01Packages]#[root@cn-iss-install-01spool]#mount/dev/vg03/vgdata/var/spool/repo/[root@cn-iss-install-01spool]#cdrepo/[root@cn-iss-install-01repo]#lslost+found[root@cn-iss-install-01repo]#pwd/var/spool/repo[root@cn-iss-install-01repo]#3,常用檢查命令:[root@cn-iss-install-01/]#pvdisplay[root@cn-iss-install-01/]#vgdisplay[root@cn-iss-install-01/]#lvdisplay[root@cn-iss-install-01/]#pvcreatePleaseenteraphysicalvolumepathRun`pvcreate--help'formoreinformation.[root@cn-iss-install-01/]#vgcreatePleaseprovidevolumegroupnameandphysicalvolumesRun`vgcreate--help'formoreinformation.[root@cn-iss-install-01/]#lvcreatePleaseprovideavolumegroupnameRun`lvcreate--help'formoreinformation.[root@cn-iss-install-01/]#vgextendPleaseentervolumegroupnameandphysicalvolume(s)Run`vgextend--help'formoreinformation.[root@cn-iss-install-01/]#lvextendPleasespecifyeithersizeorextentsbutnotboth.Run`lvextend--help'formoreinformation.[root@cn-iss-install-01/]#?經驗總結:??以上就是系統大全給大家介紹的如何使用看過上述的方法都有一定的了解了吧,好了,如果大家還想了解更多的資訊,那就趕緊點擊系統大全官網吧。??本文來自系統大全http:///如需轉載請注明!