首页/aliyun服务器代维/CentOS下挂载EBS
aliyun服务器代维

CentOS下挂载EBS

EBS(Elastic Block Store)是Amazon EC2实例的持久性数据块级存储卷。

在简单介绍一下,购买EBS以后如何挂载到EC2。

环境:CentOS6.5

EBS:300GB

CentOS6.5下挂载EBS

1. 先用fdisk命令查看Device名。

# fdisk -l

Disk /dev/xvdg: 40.3 GB, 40256929792 bytes
255 heads, 63 sectors/track, 4894 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: 0x00000000

Disk /dev/xvde: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 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: 0x00000000

Disk /dev/xvdf: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 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: 0x00000000

根据容量判断,/dev/xvdf是购买的EBS。

2. 创建ext4文件系统

# mkfs -t ext4 /dev/xvdf

3. 创建目录及挂载

# mkdir /data
# mount /dev/xvdf /data

4. 确认

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvde       7.9G  650M  6.9G   9% /
tmpfs           7.4G     0  7.4G   0% /dev/shm
/dev/xvdf       296G  191M  281G   1% /data

5. 修改/etc/fstab

在/etc/fstab文件的最后进行添加。

# vi /etc/fstab
/dev/xvdf  /data     ext4    defaults         0 0

6. 重启系统进行确认

# shutdown -r now
# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvde       7.9G  651M  6.9G   9% /
tmpfs           7.4G     0  7.4G   0% /dev/shm
/dev/xvdf       296G  191M  281G   1% /data
SERVICE

相关服务与公开报价

以下为三家云市场官方店铺的在售商品,价格取自平台页面、可核验。 点击直达商品页,由平台完成下单与交付。

按本文主题推荐的云市场在售服务与公开报价
商品图 服务 / 商品 云市场 公开报价 操作
SSL证书 安装证书配置 SSL证书 安装证书配置 阿里云 ¥1 去商品页
https ssl免费证书申请 安装部署 维护配置 https ssl免费证书申请 安装部署 维护配置 阿里云 ¥100 去商品页
网站WEB APP标准化基础运行环境配置 安全加固 木马清理 网站WEB APP标准化基础运行环境配置 安全加固 木马清理 阿里云 ¥1000 去商品页
腾讯云服务器代维  云主机代维 运维外包服务 腾讯云服务器代维 云主机代维 运维外包服务 腾讯云 ¥1500 / 月 去商品页
云服务器专业安全代维 腾讯云服务器代维 运维外包 腾讯云代维 云服务器专业安全代维 腾讯云服务器代维 运维外包 腾讯云代维 腾讯云 ¥1000 / 7日 去商品页
SSL证书 HTTPS证书 加密证书安装服务 SSL证书 HTTPS证书 加密证书安装服务 腾讯云 ¥1 / 次 去商品页
企业网站运维技术支持服务(年度订阅) 企业网站运维技术支持服务(年度订阅) 华为云 ¥6000 / 年 去商品页
磁盘扩容 · 数据盘分区挂载(Linux / Windows) 磁盘扩容 · 数据盘分区挂载(Linux / Windows) 华为云 ¥200 / 次 去商品页
软件安装与部署服务(Apache / Nginx / Tomcat / 自建应用) 软件安装与部署服务(Apache / Nginx / Tomcat / 自建应用) 华为云 ¥3000 / 次 去商品页
FREE CHECKUP

先做一次免费服务器体检

我们会在 1 个工作日内给出问题清单与处置建议 —— 做不做代维都没关系。

135 410 16684
工作日 Mon – Fri 10:00 – 22:00 · 紧急故障 7×24 响应
立即拨打
CONTACT

在线留言

有什么可以帮您?

带 * 为必填