Automatically mount an EBS volume upon starting an Amazon EC2 Linux instance

后端 未结 3 1934
你的背包
你的背包 2021-01-30 02:02

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

3条回答
  •  耶瑟儿~
    2021-01-30 02:30

    I recommend using an /etc/init conf file that do that:

    • login with root
    • create a new file (not executable) name it like this : mountec2vol.conf
    • paste into it this code :
    # /etc/init/mountec2vol.conf
    #
    # description: Mounts the EBS Volume
    #
    start on net-device-up
    exec mount /dev/xvdf1 /myVolume`
    
    • Reboot if you want to test

    that's all what you have to do!

提交回复
热议问题