fstab is not mounting drive after system reboot in Digital Ocean

We recently faced an issue in Digital Ocean when we were trying to add a newly created volume in our Droplet. The GPT partition was created with parted and mount command was working perfectly.

Further we did an entry in fstab to mount drive after reboot.

UUID=4g576f53-682h-4799-625a-401789048212 /mnt/do-volume ext4 defaults 0 2

Surprisingly after every reboot we could not find the Volume mounted.

[root@centos- ~]# mount -l
/dev/vda1 on / type ext4 (rw) [DOROOT]
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

As seen above we were unable to find our added volume which was /dev/sda

This drove us nuts. Digital Ocean support did not help in this regard and commented that this seems that some module is not loading properly, since we do not login on Customer’s server so you need to fix it yourself.

After trying to figure out the issue I observed that the issue was that fstab was loading before network services in Digital Ocean Droplet. Since fstab was unable to find the volume due to network unavailability, this caused the disk to not mounted after reboot.

So in order to fix this situation I used rc.local and made below entry:

mount -U uuid-of-the-disk /mnt/do-volume

This solved the issue and volume was being mounted after each reboot.

Leave a Reply

Your email address will not be published.


*