I'm currently programming a website and it's connecting to Ubuntu 12.04 linux VM on Windows Azure for database connections. The issue I'm having is that if the VM is restarted the attached disk I added for the db data files does not auto mount after the boot. I've added an entry in /etc/fstab (entry below) without any luck.

  1. What do I need to do to get this second drive (sdc1) to auto mount on boot in Azure?
  2. Does the auto mount happen BEFORE postgresql service starts? If not mounted before Postgresql, what do I need to do to have postgres start after its mounted?
  3. I'm also having to set sudo blockdev --setra 2048 /dev/sdc1 after the reboot as well. How do I get that setting persisted after reboot on the attached drive?
UUID=123456-456-546498-56464987-54654    /mnt/db_data    ext4    defaults,discard    0   0

Note: That isn't the UUID I'm using. I made it up just in case for security reasons.

  1. The following simple line works for me on ubuntu LTS 12.4:

    UUID="3c378300-120e-418c-a288-7aa623b26e66" /mnt-test auto defaults

    Also using ext4. It is auto mounted without any problems, are you getting any error message in syslog why your drive is not mounted

  2. Yes, the fstab (mount) script is one of first ones, you can check for yourself in the rc.d folders, see the UpStart docs

  3. You should use udev for that, there you can create these kind of settings per device.

  • Apparently /dev/sdb1 was being mapped to /mnt so I need to add 2 entries instead of one. i.e. /dev/sdb1 --> /mnt and then /dev/sdc1 --> /mnt/db_data. Note: I did use UUID's for both.
    – thames
    Dec 5 '13 at 21:31
  • Right, I did not notice the mount point. By default you get a few GB of a temporary data disk mounted to /mnt for a Linux machine (under windows its d: Drive) Dec 6 '13 at 13:01
  • I only bearly understand wht's happening, but I could not persist the mount in /mnt/data but swapping to /mnt-data fixed things for me.
    – dumbledad
    Mar 9 '20 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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