Ubuntu machines on azure got ephemeral disk that is being automatically mounted on /mnt
I don't want to have this ephemeral drive on /mnt but rather disable it or just move it to another location.
I've tried to achieve that with cloud-init like so:
mounts: - [/dev/sdb, null]but that didn't help,
so I tried to edit waagent.conf and reboot that machine like so:sed -i '/s/ResourceDisk.MountPoint=.*/ResourceDisk.MountPoint=\/ephemeral/' /etc/waagent.confbut that didn't solve the issue either...
Ultimately I would like to solve it with cloud-init as I would like to mount another drive (persist data) on /mnt instead.
Thanks
2 Answers
I found myself a solution for not mounting of the drive, may be useful for somebody.
/etc/fstab is being rewritten on each start. There are options in /etc/waagent.conf that will affect, how it is done. They start with ResourceDisk., list is available i.e. here below in README.
There is however no option to turn off the mount (AFAIK). But, it can still be done. I simply turned off formatting of the ResourceDisk by setting ResourceDisk.Format=n and I had to deconstruct the already formatted partition of the temporary drive.
I personally like visual tools more, so I used cfdisk /dev/sdb as root and deleted the partition. BE CAREFUL THERE, THE DEVICE MAY NOT BE /dev/sdb IN THE FUTURE.
If you would like to change the mount point location /mnt to other then you need to make correction in /mnt to /data and reboot the server and it's working perfectly without any issue.
root@ubuntutestingvm:~# cat /etc/fstab
# CLOUD_IMG: This file was created/modified by the Cloud Image build process
UUID=879b9943-72cc-4f03-b0c7-26ef2c4aa232 / ext4 defaults,discard 0 0
/dev/disk/cloud/azure_resource-part1 /data auto defaults,nofail,x-systemd.requires=cloud-init.service,comment=cloudconfig 0 2
see the attached screenshot.