none
Where Should We Store Database Backups?

    Question

  • I have my application and a PostgreSQL database running on a D1_V2 Standard instance (Ubuntu 16.04). I currently back up my database, which is only a few MB in size, every day using a cron job to a directory on the VM (ex: ~/backup). This particular instance comes with a 50 GB local SSD. This setup has been working fine and seems like it'll work fine until my disk fills up, but what is more concerning to me is that I read that local SSDs are only temporary storage. Is this true? If so, I would assume this means my application and all of my data is at risk of being deleted. How should I change my current set up, if at all, to support persistent storage?

    Thanks in advance for any help!

    • Edited by adeeb_ch Saturday, December 31, 2016 8:32 AM
    Saturday, December 31, 2016 8:31 AM

Answers

All replies

  • Hello adeeb_ch,

    NEVER use the local HDD/SSD storage for backups! Everytime you reboot or the machine fails, you'll lose everything.

    You should mount an extra virtual disk (VHD) (e.g., as "/Backup") and place your backups there.

    See: https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-attach-disk-portal (the example is for Windows, but on Linux you'll see an extra hard disk you need to format and assign a path, typical stuff).

    Hope this helps.

    Cheers.


    André Melancia | Developer / DBA / Microsoft Certified Trainer (MCT) | Andy.PT

    Sunday, January 01, 2017 12:19 AM
  • Hi,


    Thank you for contacting Microsoft forums. We are pleased to answer your query.


    The local SSD is a temporary storage that is included with a Premium Storage supported series VM. It is not recommended to store application/backup data as it is not persisted in Azure Blob Storage.

    As Andre mentioned, you need to opt for a persistent disk. Here is a guide for adding a persistent disk to a Linux VM created in ARM mode.


    I hope that the reply will assist you in getting your query addressed. In case you require further assistance, please do reply to the thread as we are always available to your queries.



    Regards.

    Md. Shihab

    ********************************************************************

    Please remember to click "Mark as Answer" on the post that helps you as this can be beneficial to other community members reading the thread. And vote as helpful.

    Sunday, January 01, 2017 7:56 AM
  • Thank you both for your helpful replies!

    As I understand it, this means I will have to set up my entire environment again on a VHD; is that correct? I currently have everything on this local SSD, including my operating system, application files, database, web server, cron scripts, backups, and more. Is there anything I can keep on the local SSD?

    I feel like the local SSD should actually be a local SSD, not temporary storage. I don't think many people would expect a Premium Storage option to be temporary storage that can be cleared whenever you restart the VM. I have restarted my VM before, and the local SSD hasn't been wiped, so I think I may have gotten lucky.
    Wednesday, January 04, 2017 3:51 PM
  • After looking at my VM again, I think I may be confusing the Local SSD with the OS disk. My instance has a 50 GB Local SSD, but when I SSH into the machine, I see that it has a size of 28.80GB. When I run df -H, I see the following:

    Filesystem      Size  Used Avail Use% Mounted on
    udev            1.8G     0  1.8G   0% /dev
    tmpfs           361M   37M  324M  11% /run
    /dev/sda1        31G  5.7G   25G  19% /
    tmpfs           1.9G   43M  1.8G   3% /dev/shm
    tmpfs           5.3M     0  5.3M   0% /run/lock
    tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
    none             66k     0   66k   0% /etc/network/interfaces.dynamic.d
    cgmfs           103k     0  103k   0% /run/cgmanager/fs
    /dev/sdb1        53G   55M   50G   1% /mnt
    tmpfs           361M     0  361M   0% /run/user/1000

    So fortunately, I don't believe I'm using the local SSD, which is at /mnt. I think my cron scripts, web server, and application files are fine on the OS disk, but I will need to put my database and backups on a VHD.

    What do you think of this approach?
    • Edited by adeeb_ch Wednesday, January 04, 2017 4:03 PM
    Wednesday, January 04, 2017 4:02 PM
  • Hi,


    The entry /dev/sdb1 pertains to the temporary SSD storage and it is mainly used for System Paging file and can be used at best for storing temporary data only.

    In your case, the best approach would be to attach a new disk to your Linux VM and then move your Database and Backup files on to it.


    I hope that the reply will assist you in getting your query addressed. In case you require further assistance, please do reply to the thread as we are always available to your queries.


    Regards.

    Md. Shihab

    ******************************************************************************

    Please remember to click "Mark as Answer" on the post that helps you as this can be beneficial to other community members reading the thread. And vote as helpful.

    Thursday, January 05, 2017 6:53 AM