|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!装假造机时空间划小了,因而又加了5G的空间,折腾了半天,挂上往了。收拾下弄个条记,备用。
1.增加磁盘,检察磁盘情况
[root@db1/]#fdisk-l
Disk/dev/sda:10.7GB,10737418240bytes
255heads,63sectors/track,1305cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sda1*15113059277537+83Linux
/dev/sda211501204843+82Linuxswap
Partitiontableentriesarenotindiskorder
Disk/dev/sdb:5368MB,5368709120bytes
255heads,63sectors/track,652cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
从查询了局看出,多了一个/dev/sdb的盘
2.用fdisk对/dev/sdb举行分区
[root@db1/]#fdisk/dev/sdb
Command(mforhelp):n
Commandaction
eextended
pprimarypartition(1-4)
p
Partitionnumber(1-4):1
Firstcylinder(1-652,default1):
Usingdefaultvalue1
Lastcylinderor+sizeor+sizeMor+sizeK(1-652,default652):
Usingdefaultvalue652
Command(mforhelp):w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
再次检察分区情形,多出来一个/dev/sdb1的区,这个1是我们在后面指定的,假如我们指定2,就酿成sdb2了。
[root@db1/]#fdisk-l
Disk/dev/sda:10.7GB,10737418240bytes
255heads,63sectors/track,1305cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sda1*15113059277537+83Linux
/dev/sda211501204843+82Linuxswap
Partitiontableentriesarenotindiskorder
Disk/dev/sdb:5368MB,5368709120bytes
255heads,63sectors/track,652cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdb116525237158+83Linux
[root@db1/]#
假如创立完以后,/proc/partitions检察不到对应的分区,利用parprobe下令革新一下就能够了:
[root@web1~]#cat/proc/partitions
majorminor#blocksname
80175825944sda
811020096sda1
8230716280sda2
838193150sda3
[root@web1~]#partprobe/dev/sda
[root@web1~]#cat/proc/partitions
majorminor#blocksname
80175825944sda
811020096sda1
8230716280sda2
838193150sda3
84135893835sda4
[root@web1~]#
3.格局化/dev/sdb1分区
[root@db1/]#mkfs-text3/dev/sdb1
mke2fs1.35(28-Feb-2004)
Filesystemlabel=
OStype:Linux
Blocksize=4096(log=2)
Fragmentsize=4096(log=2)
655360inodes,1309289blocks
65464blocks(5.00%)reservedforthesuperuser
Firstdatablock=0
Maximumfilesystemblocks=1342177280
40blockgroups
32768blockspergroup,32768fragmentspergroup
16384inodespergroup
Superblockbackupsstoredonblocks:
32768,98304,163840,229376,294912,819200,884736
Writinginodetables:done
Creatingjournal(8192blocks):done
Writingsuperblocksandfilesystemaccountinginformation:done
Thisfilesystemwillbeautomaticallycheckedevery30mountsor
180days,whichevercomesfirst.Usetune2fs-cor-itooverride.
4.创立目次并将/dev/sdb1挂在到该目次下
[root@db1/]#ls
backupdevinitrdmediaoptsbinsysusr
binetclibmiscprocselinuxtftpbootvar
boothomelost+foundmntrootsrvtmp
[root@db1/]#mkdir/u01
[root@db1/]#ls
backupdevinitrdmediaoptsbinsysu01
binetclibmiscprocselinuxtftpbootusr
boothomelost+foundmntrootsrvtmpvar
[root@db1/]#mount/dev/sdb1/u01
5.考证挂载是不是乐成
[root@db1/]#df-k
Filesystem1K-blocksUsedAvailableUse%Mountedon
/dev/sda191317727066884160101282%/
none45425604542560%/dev/shm
/dev/sdb151548524304048499561%/backup
6.设置开机主动挂载
[root@db1/]#vi/etc/fstab
#Thisfileiseditedbyfstab-sync-seemanfstab-syncfordetails
LABEL=//ext3defaults11
none/dev/ptsdevptsgid=5,mode=62000
none/dev/shmtmpfsdefaults00
none/procprocdefaults00
none/syssysfsdefaults00
LABEL=SWAP-sda2swapswapdefaults00
/dev/sdb1/u01ext3defaults00
/dev/hdc/media/cdromautopamconsole,exec,noauto,m
anaged00
/dev/fd0/media/floppyautopamconsole,exec,noauto,m
anaged00
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|