- 远程连接实例。
- 运行
fdisk -l
命令查看实例是否有数据盘。如果执行命令后,没有发现 /dev/vdb,表示您的实例没有数据盘,无需格式化数据盘,请忽略本文后续内容。如果您的数据盘显示的是 dev/xvd?,表示您使用的是非 I/O 优化实例。 - 创建一个单分区数据盘,依次执行以下命令:
- 运行
fdisk /dev/vdb
:对数据盘进行分区。- 输入
n
并按回车键:创建一个新分区。 - 输入
p
并按回车键:选择主分区。因为创建的是一个单分区数据盘,所以只需要创建主分区。
- 输入
- 输入分区编号并按回车键。因为这里仅创建一个分区,可以输入
1
。 - 输入第一个可用的扇区编号:按回车键
- 输入最后一个扇区编号:因为这里仅创建一个分区,所以按回车键采用默认值。
- 输入
wq
并按回车键,开始分区。 - 运行:
mkfs.ext3 /dev/vdb1
- 创建磁盘挂载目录,运行命令:
mkdir -p /data
- 备份 etc/fstab:运行命令
cp /etc/fstab /etc/fstab.bak
- 向 /etc/fstab 写入新分区信息,运行命令:
echo /dev/vdb1 /data ext3 defaults 0 0 >> /etc/fstab
- 查看 /etc/fstab 中的新分区信息,运行命令:
cat /etc/fstab
- 挂载文件系统,运行命令:
mount /dev/vdb1 /data
- 查看目前磁盘空间和使用情况:运行命令
df -h
。如果出现新建文件系统的信息,说明挂载成功,可以使用新的文件系统了
阿里云 Linux 格式化和挂载数据云盘
阿里云 Linux 格式化和挂载数据云盘
TONYLABS
12 Feb, 2019
Like what you're reading? Subscribe to our top stories.
We will continue to update Front; if you have any questions or suggestions, please contact us!
Follow us on Medium, Twitter, Facebook, YouTube, and Dribbble.

Written by
Hanna Wolfe
I create advanced website builders made exclusively for web developers.
3 Comments
-
Dave Austin 1 day ago
As a Special Education teacher this resonates so well with me. Fighting with gen ed teachers to flatten for the students with learning disabilities. It also confirms some things for me in my writing.
Reply -
Christina Kray 2 days ago
Since our attention spans seem to be shrinking by the day — keeping it simple is more important than ever.
Reply
Post a comment
Stay in the know
Get special offers on the latest developments from Front.