aliyun的centos系统数据盘默认情况下是没有挂上去的,而且都没有分区和格式化,需要自己手动操作:
1,查看硬盘
#df -h,只有挂载的才可以看的到。
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 20G 6.1G 13G 33% /
tmpfs 750M 0 750M 0% /dev/shm
2,查看所有硬盘
#fdisk -l
Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00073f45
Device Boot Start End Blocks Id System
/dev/xvda1 * 1 2611 20970496 83 Linux
Disk /dev/xvdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbf36230f
Device Boot Start End Blocks Id System
/dev/xvdb1 1 2610 20964793+ 83 Linux
3,对/dev/xvdb进行分区
#fdisk /dev/xvdb
依次执行命令:
n:增加分区
p:主分区
1:第一个分区
回车两次,默认选择所有磁道
w:保存
4,查看新分区:
#fdisk -l
5,格式化新分区:
#mkfs.ext4 /dev/xvdb1
6,添加启动时的自动挂载
#vi /etc/fstab
添加一行
/dev/xvdb1 /mnt ext4 defaults 0 0
#mount -a,挂载
也可以手动挂载:
#mount /dev/xvdb1 /mnt