一、添加物理硬件
关机后添加新的磁盘上去
二、检查磁盘是否检查成功
fdisk -l
#查看是否加载了新的磁盘sbx(x为磁盘序号a-z,如果新加的是二块磁盘,则看是否有sdb)
#Disk /dev/sdb: 214.7 GB, 214748364800 bytes
#255 heads, 63 sectors/track, 26108 cylinders
#Units = cylinders of 16065 * 512 = 8225280 bytes
#
#Disk /dev/sdb doesn't contain a valid partition table
三、添加硬盘
fdisk /dev/sdb
Command (m for help): m
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
#输入e创建扩展分区,输入p创建主分区
Partition number (1-4): 1
First cylinder (1-26108, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-26108, default 26108):
Using default value 26108
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
#输入l创建逻辑分区
First cylinder (1-26108, default 1):
Using default value 1
#分区的起始柱头,一般默认即可
Last cylinder or +size or +sizeM or +sizeK (1-26108, default 26108):
Using default value 26108
#分区的结束柱头,或输入大小,如+1024M
Command (m for help): p
查看划分好的分区的磁盘标识
Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 26108 209712478+ 5 Extended
/dev/sdb5 1 26108 209712447 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
#输入w保存退出
mkfs -t ext3 -c /dev/sdb5
#输入mkfs格式化分区
mkdir /data
mount /dev/sdb5 /data/
df -h
vi /etc/fstab
添加:
/dev/sdb5 /data ext3 defaults 1 2
:wq
四、重启并检查磁盘挂载情况
reboot
df -h
阅读(1321) | 评论(0) | 转发(0) |