In SQL Server on Linux (Ubuntu 16.04 + SQL Server 2017 RC2), the database is arranged on a different disk from the OS. (I mounted /dev/sdb1 on /datadir.)

When restarting or Shutdown, the following message will be displayed at restart.

[FAILED] Failed unmouting /datadir

When restarting, I think that unmounting is done before the SQL Server process ends, but what kind of setting should be done to solve this problem?

Is there a setting like changing the order so that unmout is executed after SQL Server service termination or not unmounting the added disk when restarting?

  • 1
    I think you will get an answer if you post this question on unix.stackexchange.com - if you do that, you should also delete the question here since cross posting on the StackExchange network is discouraged.
    – Hannah Vernon
    Aug 13, 2017 at 16:21

1 Answer 1


The systemd unit file for the SQL server should be locally extended by a dependency on the /datadir this will make sure the start is done after the mount and the unmount waits for the stop. The most generic option to do this would be


I think it automatically depend on the installation path of the scripts already.

Note that you do not need to modify the systemd unit files in the library directory but you can amend them in the /etc/systemd/system/<sqlserver>.service

  • Thanks for the advice!! Adding [RequiresMoutsFor], solved the problem. Aug 14, 2017 at 1:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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