2、使用fdisk命令对sdb进行分区
[iyunv@localhost ~]# fdisk /dev/sdb
输入:n 表示新建分区
Command(m for help):n
Command action
e extended
p primart partition(1-4)
输入:p表示建立一个原始分区
p
Partition number(1-4): 1
输入:1表示此分区编号为1.
First cylinder (1-1305,default 1):
输入:回车 表示使用默认起始柱面号.如果要分多个分区的话,先盘算好药多大,再输入数字
Using default value 1
Last cylinder or size or sizeM or sizeK (1-1305,default 1305):
输入:回车 表示使用默认结束柱面号.即分区使用整个硬盘空间
Using default value 1305
Command (m for help): w
输入:w 存盘,保存fdisk.
The partition table has been altered!
Calling ioctl() to re-read partition table.
Sysncing disks.
再使用fdisk -l 命令查看分区使用情况
[iyunv@localhost ~]# fdisk -l
3、设置新硬盘开机自动挂载
vi /etc/fstab
添加以下信息
/dev/sdb1 /DataCenter2 ext3 defaults 1 2
重启服务器 init 6
查看是否自动挂载上去了
[iyunv@localhost ~]# fdisk -l
Disk /dev/sda: 146.8 GB, 146815737856 bytes
255 heads, 63 sectors/track, 17849 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 17326 139171063 83 Linux
/dev/sda2 17327 17339 104422 8e Linux LVM
/dev/sda3 17340 17849 4096575 82 Linux swap
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 60801 488384001 83 Linux