|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!公司内网的办事器硬盘空间不敷,将新买来的150G硬盘挂载并设置成samba的同享目次,关于samba请参考此文章http://www.centoscn.com/CentosServer/test/2013/0804/990.html,上面先容如何将一块新硬盘分区、格局化、挂载到体系,如合适你请持续浏览。办事器上已有两块硬盘,以是硬盘为sdc,前面就不做申明了,至于不晓得sdc怎样回事的人,先往问问百度年老再返来接着看。
1、#fdisk-l检察以后磁盘信息,就会发明最上面显现新到场的硬盘不是无效分区,以下:
Disk/dev/sdc:1500.3GB,1500301910016bytes
255heads,63sectors/track,182401cylinders
Units=cylindersof16065*512=8225280bytes
Disk/dev/sdcdoesntcontainavalidpartitiontable
2、#fdisk/dev/sdc对新硬盘分区,并依据提醒进一步操纵
DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIorOSFdisklabel
BuildinganewDOSdisklabel.Changeswillremaininmemoryonly,
untilyoudecidetowritethem.Afterthat,ofcourse,theprevious
contentwontberecoverable.
Thenumberofcylindersforthisdiskissetto182401.
Thereisnothingwrongwiththat,butthisislargerthan1024,
andcouldincertainsetupscauseproblemswith:
1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)
2)bootingandpartitioningsoftwarefromotherOSs
(e.g.,DOSFDISK,OS/2FDISK)
Warning:invalidflag0x0000ofpartitiontable4willbecorrectedbyw(rite)
Command(mforhelp):h输出h可检察匡助下令
h:unknowncommand
Commandaction
atoggleabootableflag
beditbsddisklabel
ctogglethedoscompatibilityflag
ddeleteapartition
llistknownpartitiontypes
mprintthismenu
naddanewpartition
ocreateanewemptyDOSpartitiontable
pprintthepartitiontable
qquitwithoutsavingchanges
screateanewemptySundisklabel
tchangeapartitionssystemid
uchangedisplay/entryunits
vverifythepartitiontable
wwritetabletodiskandexit
xextrafunctionality(expertsonly)
Command(mforhelp):n输出n举行分区
Commandaction
eextended
pprimarypartition(1-4)
p输出p为主分区,e为逻辑分区
Partitionnumber(1-4):1因为是新盘我们输出1来分第一个主分区,共能够分4个主分区
Firstcylinder(1-182401,default1):选择该分区的肇端磁盘数,如无特别需求激烈倡议选择默许,也就是1来分区(间接按回车)
Usingdefaultvalue1
Lastcylinderor+sizeor+sizeMor+sizeK(1-182401,default182401):界说该分区的巨细,假如按默许(按回车)便是利用全体可用存储额,如分一个1G的空间,输出+1024m
Usingdefaultvalue182401
Command(mforhelp):w写进分区
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
3、#fdisk-l能够找到我们方才分的一个分区,内容以下:
Disk/dev/sdc:1500.3GB,1500301910016bytes
255heads,63sectors/track,182401cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdc11182401146513600183Linux
4、#mkfs-text3-c/dev/sdc1对分区利用ext3格局化,如多个分区sdc2等以此类推,由于新硬盘加了-c参数要先检测磁盘坏道,此历程万分冗长(150G),守候。。。
mke2fs1.39(29-May-2006)
Filesystemlabel=
OStype:Linux
Blocksize=4096(log=2)
Fragmentsize=4096(log=2)
183156736inodes,366284000blocks
18314200blocks(5.00%)reservedforthesuperuser
Firstdatablock=0
Maximumfilesystemblocks=0
11179blockgroups
32768blockspergroup,32768fragmentspergroup
16384inodespergroup
Superblockbackupsstoredonblocks:
32768,98304,163840,229376,294912,819200,884736,1605632,2654208,
4096000,7962624,11239424,20480000,23887872,71663616,78675968,
102400000,214990848
Checkingforbadblocks(read-onlytest):done
Writinginodetables:done
Creatingjournal(32768blocks):done
Writingsuperblocksandfilesystemaccountinginformation:done
Thisfilesystemwillbeautomaticallycheckedevery22mountsor
180days,whichevercomesfirst.Usetune2fs-cor-itooverride.
5、#mkdir/var/samba新建挂载目次
6、#mount/dev/sdc1/var/samba挂载新硬盘
7、#df-hl检察分区巨细是不是和我们预定的一样:
文件体系容量已用可用已用%挂载点
/dev/sda79.5G3.2G5.9G35%/
/dev/sda69.5G151M8.9G2%/tmp
/dev/sda519G3.6G15G20%/usr
/dev/sda319G719M18G4%/home
/dev/sda2230G23G196G11%/var
/dev/sda199M25M69M27%/boot
/dev/sdb1233G156G78G67%/var/samba2
tmpfs1008M01008M0%/dev/shm
/dev/sdc11.4T198M1.3T1%/var/samba此举动新硬盘
8、#vi/etc/fstab设置体系主动挂载硬盘,到场一行:
/dev/sdc1/var/samba2ext3defaults00
9、重启办事器,用步骤7反省一下,统统一般挂载完成,祝好运~
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|