在启动一个Amazon EC2 Linux实例自动挂载EBS卷实例、Amazon、EBS、Linux

2023-09-11 08:31:34 作者:梦倾她城

我有一个EBS卷(如的/ dev / SDF )已经被连接到一个EC2实例(从不同的EBS卷靴),我已经装卷(通过设置/ dev / SDF /数据)。当我停止并重新启动实例,成交量仍然附着但不再装了,我必须手动重新安装它。

I have an EBS volume (e.g. /dev/sdf) that has been attached to an EC2 instance (which boots from a different EBS volume), and I have mounted the volume (through mount /dev/sdf /data). When I stop and start again the instance, the volume is still attached but no longer mounted, and I have to manually mount it again.

有没有一种方法,使体积的/ dev / SDF 自动安装到 /数据在启动实例?

Is there a way to make the volume /dev/sdf automatically mounted to /data upon starting the instance?

推荐答案

请一个条目,以 / etc / fstab文件

条目将是这样的:

/dev/sdf    /data   ext3    defaults    1 1

重启时这会自动安装卷。

This will automatically mount the volume during reboot.