|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!起首,对新到场的硬盘格局化。
步调1:
复制代码代码示例:
[root@rac1~]#fdisk/dev/sdb
DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIorOSFdisklabel
BuildinganewDOSdisklabel.Changeswillremaininmemoryonly,
untilyoudecidetowritethem.Afterthat,ofcourse,theprevious
contentwontberecoverable.
Thenumberofcylindersforthisdiskissetto1305.
Thereisnothingwrongwiththat,butthisislargerthan1024,
andcouldincertainsetupscauseproblemswith:
1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)
2)bootingandpartitioningsoftwarefromotherOSs
(e.g.,DOSFDISK,OS/2FDISK)
Warning:invalidflag0x0000ofpartitiontable4willbecorrectedbyw(rite)
Command(mforhelp):m
Commandaction
atoggleabootableflag
beditbsddisklabel
ctogglethedoscompatibilityflag
ddeleteapartition
llistknownpartitiontypes
mprintthismenu
naddanewpartition
ocreateanewemptyDOSpartitiontable
pprintthepartitiontable
qquitwithoutsavingchanges
screateanewemptySundisklabel
tchangeapartitionssystemid
uchangedisplay/entryunits
vverifythepartitiontable
wwritetabletodiskandexit
xextrafunctionality(expertsonly)
步调2:
复制代码代码示例:
Command(mforhelp):n
Commandaction
eextended
pprimarypartition(1-4)
p
Partitionnumber(1-4):1
Firstcylinder(1-1305,default1):
Usingdefaultvalue1
Lastcylinderor+sizeor+sizeMor+sizeK(1-1305,default1305):
Usingdefaultvalue1305
Command(mforhelp):w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
步调3:
复制代码代码示例:
[root@rac1~]#fdisk-l
Disk/dev/sda:10.7GB,10737418240bytes
255heads,63sectors/track,1305cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sda1*11147921324683Linux
/dev/sda211481305126913582Linuxswap
Disk/dev/sdb:10.7GB,10737418240bytes
255heads,63sectors/track,1305cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdb111305104823815Extended
步调4格局化分区
复制代码代码示例:
[root@rac1~]#mkfs-text3-c/dev/sdb1
mke2fs1.35(28-Feb-2004)
Filesystemlabel=
OStype:Linux
Blocksize=4096(log=2)
Fragmentsize=4096(log=2)
1310720inodes,2620595blocks
131029blocks(5.00%)reservedforthesuperuser
Firstdatablock=0
Maximumfilesystemblocks=2684354560
80blockgroups
32768blockspergroup,32768fragmentspergroup
16384inodespergroup
Superblockbackupsstoredonblocks:
32768,98304,163840,229376,294912,819200,884736,1605632
Checkingforbadblocks(read-onlytest):done
Writinginodetables:done
Creatingjournal(8192blocks):done
Writingsuperblocksandfilesystemaccountinginformation:done
Thisfilesystemwillbeautomaticallycheckedevery25mountsor
180days,whichevercomesfirst.Usetune2fs-cor-itooverride.
步调5:创立目次然后将该分区加挂到该目次下
复制代码代码示例:
[root@rac1/]#mkdir/u01
[root@rac1/]#mount/dev/sdb1/u01
步调6:修正/etc/fstab文件增加以下纪录使体系每次重启后都能主动加载该分区
步调7:
[root@rac1/]#vi/etc/fstab
在文件的开端填加以下内容
/dev/sdb1/u01ext3defaults12
申明:
若新加硬盘的时分选择了创立逻辑盘(即选择了e)的时分,格局话的时分会报以下毛病:
复制代码代码示例:
mkfs-text3-c/dev/sdb1
Invalidargumentpassedtoext2librarywhilesettingupsuperblock.
这是由于我们这里只创立了逻辑盘,没有创立逻辑分区,以是创立完逻辑盘后还必要创立逻辑分区:
复制代码代码示例:
[root@jbxueoracle]#fdisk/dev/sdb
Thenumberofcylindersforthisdiskissetto2088.
Thereisnothingwrongwiththat,butthisislargerthan1024,
andcouldincertainsetupscauseproblemswith:
1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)
2)bootingandpartitioningsoftwarefromotherOSs
(e.g.,DOSFDISK,OS/2FDISK)
Command(mforhelp):m
Commandaction
atoggleabootableflag
beditbsddisklabel
ctogglethedoscompatibilityflag
ddeleteapartition
llistknownpartitiontypes
mprintthismenu
naddanewpartition
ocreateanewemptyDOSpartitiontable
pprintthepartitiontable
qquitwithoutsavingchanges
screateanewemptySundisklabel
tchangeapartitionssystemid
uchangedisplay/entryunits
vverifythepartitiontable
wwritetabletodiskandexit
xextrafunctionality(expertsonly)
Command(mforhelp):n
Commandaction
llogical(5orover)
pprimarypartition(1-4)
l
Firstcylinder(1-2088,default1):
Usingdefaultvalue1
Lastcylinderor+sizeor+sizeMor+sizeK(1-2088,default2088):
Usingdefaultvalue2088
Command(mforhelp):w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
[root@jbxueoracle]#fdisk-l
Disk/dev/sda:21.4GB,21474836480bytes
255heads,63sectors/track,2610cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sda1*110008032468+83Linux
/dev/sda210011200160650082Linuxswap/Solaris
/dev/sda3120126101132582583Linux
Disk/dev/sdb:17.1GB,17179869184bytes
255heads,63sectors/track,2088cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdb11208816771828+5Extended
/dev/sdb5120881677179783Linux
[root@jbxueoracle]#mkfs-text3-c/dev/sdb5
mke2fs1.39(29-May-2006)
Filesystemlabel=
OStype:Linux
Blocksize=4096(log=2)
Fragmentsize=4096(log=2)
2097152inodes,4192949blocks
209647blocks(5.00%)reservedforthesuperuser
Firstdatablock=0
Maximumfilesystemblocks=0
128blockgroups
32768blockspergroup,32768fragmentspergroup
16384inodespergroup
Superblockbackupsstoredonblocks:
32768,98304,163840,229376,294912,819200,884736,1605632,2654208,
4096000
Checkingforbadblocks(read-onlytest):done
Writinginodetables:done
Creatingjournal(32768blocks):done
Writingsuperblocksandfilesystemaccountinginformation:done
Thisfilesystemwillbeautomaticallycheckedevery21mountsor
180days,whichevercomesfirst.Usetune2fs-cor-itooverride.
[root@jbxueoracle]#fdisk-l
Disk/dev/sda:21.4GB,21474836480bytes
255heads,63sectors/track,2610cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sda1*110008032468+83Linux
/dev/sda210011200160650082Linuxswap/Solaris
/dev/sda3120126101132582583Linux
Disk/dev/sdb:17.1GB,17179869184bytes
255heads,63sectors/track,2088cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdb11208816771828+5Extended
/dev/sdb5120881677179783Linux
云云便完成了linux下新硬盘的增加与分区、格局化等操纵。
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们! |
|