|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
要多动手,不要怕什么搞坏了怎么办,你不搞坏,不去动手,就永远不会有收获,既然你在linux中是自由的,那就发挥自己的权利;
终究仍是找到了.如今将实行代码贴出来.但愿对人人有匡助!
[root@localhost~]#fdisk/dev/hda3
Thenumberofcylindersforthisdiskissetto3916.
Thereisnothingwrongwiththat,butthisislargerthan1024,
andcouldincertainsetupscauseproblemswith:
1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)
2)bootingandpartitioningsoftwarefromotherOSs
(e.g.,DOSFDISK,OS/2FDISK)
Command(mforhelp):p
Disk/dev/hda4:32.2GB,32212254720bytes
255heads,63sectors/track,3916cylinders
Units=cylindersof16065*512=8225280bytes
Diskidentifier:0×000bc363
DeviceBootStartEndBlocksIdSystem
/dev/hda1*12520078183Linux
/dev/hda226195815526822+8eLinuxLVM
/dev/hda31959261052371908eLinuxLVM
Command(mforhelp):n
Commandaction
eextended
pprimarypartition(1-4)
Selectedpartition4
Firstcylinder(2611-3916,default2611):
Usingdefaultvalue2611
Lastcylinderor+sizeor+sizeMor+sizeK(2611-3916,default3916):
Usingdefaultvalue3916
Command(mforhelp):t
Partitionnumber(1-4):4
Hexcode(typeLtolistcodes):8e
Changedsystemtypeofpartition4to8e(LinuxLVM)
Command(mforhelp):p
Disk/dev/hda:32.2GB,32212254720bytes
255heads,63sectors/track,3916cylinders
Units=cylindersof16065*512=8225280bytes
Diskidentifier:0×000bc363
DeviceBootStartEndBlocksIdSystem
/dev/hda1*12520078183Linux
/dev/hda226195815526822+8eLinuxLVM
/dev/hda31959261052371908eLinuxLVM
/dev/hda426113916104904458eLinuxLVM
Command(mforhelp):w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
WARNING:Re-readingthepartitiontablefailedwitherror16:Deviceorresourcebusy.
Thekernelstillusestheoldtable.
Thenewtablewillbeusedatthenextreboot.
Syncingdisks.
(注:倡议重启一下CentOS体系)
[root@localhost~]#pvcreate/dev/hda3
Physicalvolume“/dev/hda4″successfullycreated
[root@localhost~]#vgextendVolGroup00/dev/hda3
Volumegroup“VolGroup00″successfullyextended
[root@localhost~]#lvextend-l+100%FREE/dev/VolGroup00/LogVol00
ExtendinglogicalvolumeLogVol00to28.25GB
LogicalvolumeLogVol00successfullyresized
[root@localhost~]#lvresize-l+100%FREE/dev/VolGroup00/LogVol00
Newsize(904extents)matchesexistingsize(904extents)
lvresize:Resizealogicalvolume
lvresize
[-A|--autobackupy|n]
[--allocAllocationPolicy]
[-d|--debug]
[-h|--help]
[-i|--stripesStripes[-I|--stripesizeStripeSize]]
{-l|Cextents[+|-]LogicalExtentsNumber[%{VG|LV|FREE}]|
-L|Csize[+|-]LogicalVolumeSize[kKmMgGtTpPeE]}
[-n|--nofsck]
[-r|--resizefs]
[-t|--test]
[--typeVolumeType]
[-v|--verbose]
[--version]
LogicalVolume[Path][PhysicalVolumePath...]
[root@localhost~]#resize2fs/dev/VolGroup00/LogVol00
resize2fs1.40.2(12-Jul-2007)
Filesystemat/dev/VolGroup00/LogVol00ismountedon/;on-lineresizingrequired
olddesc_blocks=2,new_desc_blocks=2
Performinganon-lineresizeof/dev/VolGroup00/LogVol00to7405568(4k)blocks.
Thefilesystemon/dev/VolGroup00/LogVol00isnow7405568blockslong.
在linux中学习命令的最好办法是学习Shell脚本编程,Shell脚本比起其他语言来学习简单,但是功能却十分强大.通过学习Shell编程,能让你掌握大量的linux命令。 |
|