简体   繁体   English

未添加到实例的Amazon EC2 EBS CentOS 6.5存储容量

[英]Amazon EC2 EBS CentOS 6.5 Storage Capacity not Added to Instance

I have created a custom CentOS 6.5 image and registered it to AWS as EBS root device type. 我创建了一个自定义的CentOS 6.5映像并将其注册为AWS作为EBS根设备类型。 When I launch an instance, it works perfectly well, except that the storage capacity (instance storage to be included according to the instance type) is not added to the instance. 当启动一个实例时,它的运行情况非常好,除了没有将存储容量(根据实例类型包括的实例存储)添加到实例中。

I made a try booting an instance using the official CentOS 6.5 AMI that is located in the AWS Marketplace, but I got the same result. 我尝试使用位于AWS Marketplace中的官方CentOS 6.5 AMI引导实例,但是得到了相同的结果。

Does anyone know the reason, if it is a known issue, or whatever? 有谁知道原因,如果是已知问题,还是其他?

Thanks in advance. 提前致谢。

First you have to make sure that the instance store is attached at launch time. 首先,您必须确保实例存储在启动时已附加。 From the AWS console it should look something like this: 在AWS控制台中,它应如下所示:

附加实例存储

Once you boot the instance you have to create a filesystem in the drive by running: 启动实例后,必须通过运行以下命令在驱动器中创建文件系统:

mkfs.ext4 /dev/sdb

Then you need to mount that drive somewhere in your root filesystem: 然后,您需要将该驱动器挂载在根文件系统中的某个位置:

mkdir -p /mnt/myinstancestore
mount /dev/sdb /mnt/myinstancestore

You can run these commands to check that your drive is mounted: 您可以运行以下命令来检查驱动器是否已安装:

df -h
mount

You can also add the mount entry to your /etc/fstab file so that it mounts permanently after every reboot: 您还可以将安装条目添加到/etc/fstab文件中,以便在每次重新启动后将其永久安装:

/dev/sdb /mnt/myinstancestore ext4 defaults 1 2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM