How to auto mount 2nd drive on boot in Windows Azure on linux?

Posted on

How to auto mount 2nd drive on boot in Windows Azure on linux? – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, ubuntu-12.04, azure, automount, block-device.

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.

Solution :

  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.

Leave a Reply

Your email address will not be published. Required fields are marked *