挂载aliyun的数据盘

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



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值