仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 608|回复: 8
打印 上一主题 下一主题

[CentOS(社区)] 来一发CentOS对新到场的硬盘格局化

[复制链接]
萌萌妈妈 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-14 20:39:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

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教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!
简单生活 该用户已被删除
沙发
发表于 2015-1-16 21:14:36 | 只看该作者

来一发CentOS对新到场的硬盘格局化

不同于Windows?系统需要花钱购买,因为Linux的核心是免费的,自由使用的,核心源代码是开放的。
爱飞 该用户已被删除
板凳
发表于 2015-1-25 22:49:42 | 只看该作者
我学习Linux的心得体会 ,希望对大家的学习有所帮助,由于水平有限,本文难免有所欠缺,望请指正。
不帅 该用户已被删除
地板
发表于 2015-2-4 14:50:06 | 只看该作者
随着Linux技术的更加成熟、完善,其应用领域和市场份额继续快速增大。目前,其主要应用领域是服务器系统和嵌入式系统。然而,它的足迹已遍布各个行业,几乎无处不在。
透明 该用户已被删除
5#
发表于 2015-2-10 03:08:29 | 只看该作者
尽量不要提问纯属是扯蛋.学习Linux特别是自己一个人初学入手的时候没人教很困难.当然如果可以的话平时多去买些Linux书...对学习Linux很有帮助.
因胸联盟 该用户已被删除
6#
发表于 2015-2-28 19:26:23 | 只看该作者
通过自学老师给的资料和向同学请教,掌握了一些基本的操作,比如挂载优盘,编译程序,在Linux环境下运行,转换目录等等。学了这些基础才能进行下面的模拟OS程序。?
小妖女 该用户已被删除
7#
发表于 2015-3-10 07:41:29 | 只看该作者
得到到草率的回答或者根本得不到任何Linux答案。越表现出在寻求帮助前为解决问题付出的努力,你越能得到实质性的帮助。
再现理想 该用户已被删除
8#
发表于 2015-3-17 06:13:41 | 只看该作者
其中不乏很多IT精英的心血。我们学透以后更可以做成自己的OS!?
柔情似水 该用户已被删除
9#
发表于 2015-3-24 02:09:00 | 只看该作者
我想即使Linux高手也很难快速准确精练的回答你。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-6-26 10:55

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表