仓酷云
标题:
来一发CentOS对新到场的硬盘格局化
[打印本页]
作者:
萌萌妈妈
时间:
2015-1-14 20:39
标题:
来一发CentOS对新到场的硬盘格局化
如果您觉得本篇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教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!
作者:
简单生活
时间:
2015-1-16 21:14
标题:
来一发CentOS对新到场的硬盘格局化
不同于Windows?系统需要花钱购买,因为Linux的核心是免费的,自由使用的,核心源代码是开放的。
作者:
爱飞
时间:
2015-1-25 22:49
我学习Linux的心得体会 ,希望对大家的学习有所帮助,由于水平有限,本文难免有所欠缺,望请指正。
作者:
不帅
时间:
2015-2-4 14:50
随着Linux技术的更加成熟、完善,其应用领域和市场份额继续快速增大。目前,其主要应用领域是服务器系统和嵌入式系统。然而,它的足迹已遍布各个行业,几乎无处不在。
作者:
透明
时间:
2015-2-10 03:08
尽量不要提问纯属是扯蛋.学习Linux特别是自己一个人初学入手的时候没人教很困难.当然如果可以的话平时多去买些Linux书...对学习Linux很有帮助.
作者:
因胸联盟
时间:
2015-2-28 19:26
通过自学老师给的资料和向同学请教,掌握了一些基本的操作,比如挂载优盘,编译程序,在Linux环境下运行,转换目录等等。学了这些基础才能进行下面的模拟OS程序。?
作者:
小妖女
时间:
2015-3-10 07:41
得到到草率的回答或者根本得不到任何Linux答案。越表现出在寻求帮助前为解决问题付出的努力,你越能得到实质性的帮助。
作者:
再现理想
时间:
2015-3-17 06:13
其中不乏很多IT精英的心血。我们学透以后更可以做成自己的OS!?
作者:
柔情似水
时间:
2015-3-24 02:09
我想即使Linux高手也很难快速准确精练的回答你。
欢迎光临 仓酷云 (http://ckuyun.com/)
Powered by Discuz! X3.2