资源描述:
《Linux下fdisk使用方法》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Linux下fdisk使用方法理论知识:一块磁盘最多有4个分区,包括(主分区+扩展分区),扩展分区不能直接使用,需进行分区为逻辑分区,其数字从5开始。首先在未开机前添加一块磁盘,然后开机。[root@wangbin~]#fdisk–l//查看磁盘分区情况Disk/dev/sda:42.9GB,42949672960bytes255heads,63sectors/track,5221cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocks
2、IdSystem/dev/sda1*12520078183Linux//系统引导分区/dev/sda2262862096482+82Linuxswap/Solaris//交换分区/dev/sda3287522139640387+83LinuxDisk/dev/sdb:21.4GB,21474836480bytes255heads,63sectors/track,2610cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSyst
3、em/dev/sdb111217977552183Linux/dev/sdb2121824349775552+83LinuxDisk/dev/sdc:21.4GB,21474836480bytes255heads,63sectors/track,2610cylindersUnits=cylindersof16065*512=8225280bytesDisk/dev/sdcdoesn'tcontainavalidpartitiontable///dev/sdc磁盘没有有效的分区表,说明没有进行分区。[root@wangbin
4、~]#fdisk/dev/sdc//对/dev/sdc进行分区DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIorOSFdisklabelBuildinganewDOSdisklabel.Changeswillremaininmemoryonly,untilyoudecidetowritethem.Afterthat,ofcourse,thepreviouscontentwon'tberecoverable.Thenumberofcylindersforthis
5、diskissetto2610.Thereisnothingwrongwiththat,butthisislargerthan1024,andcouldincertainsetupscauseproblemswith:1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)2)bootingandpartitioningsoftwarefromotherOSs(e.g.,DOSFDISK,OS/2FDISK)Warning:invalidflag0x0000ofpartiti
6、ontable4willbecorrectedbyw(rite)Command(mforhelp):m//输入m得到帮助信息Commandactionatoggleabootableflagbeditbsddisklabelctogglethedoscompatibilityflagddeleteapartition//删除分区llistknownpartitiontypesmprintthismenunaddanewpartition//增加分区ocreateanewemptyDOSpartitiontablepprin
7、tthepartitiontable//打印分区qquitwithoutsavingchanges//不保存退出screateanewemptySundisklabeltchangeapartition'ssystemiduchangedisplay/entryunitsvverifythepartitiontablewwritetabletodiskandexit//保存退出xextrafunctionality(expertsonly)Command(mforhelp):nCommandactioneextendedp
8、primarypartition(1-4)pPartitionnumber(1-4):1Firstcylinder(1-2610,default1):Usingdefaultvalue1Lastcylinderor+sizeor+sizeMor+sizeK(1-2610,default2610):+50