I have an EC2 instance running mongo, with data stored on a separate EBS device. I decided to change EC2 instance type, and when I restarted I did not see the disk anymore, so I had to mount again. Don't know if this is due to instance downgrade, or if my mount simple does not survive the instance restart. I mounted the disk with this command:

mount /dev/xvdf /data -o noatime -o noadirtime
  • You have to add it in /etc/fstab in order to be automatically mounted after the restart. – dkokmadis Jul 10 '18 at 8:51

In order to preserve a mount point after a server reboot, you have to add it in /etc/fstab fstab

So you have to add the following line in /etc/fstab

/dev/xvdf /data ext4 errors=remount-ro 0 2

  • is there any command that, given a mount, ouput back the corresponding fstab entry? I want to ensure same parameters I used to mount command lien and I don't find an easy way to match – Felice Pollano Jul 10 '18 at 12:58
  • You can check the mount options with the command mount | grep "/dev/xvdf" – dkokmadis Jul 10 '18 at 13:01

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.