Could not find a part of the path 'C:\var\opt\mssql\Log\backuplog.txt' in SQL server on linux

MJ Jakati 116 Reputation points
2021-05-21T16:37:49.033+00:00

Hello Team,

I have installed SQL Sever on Linux and changed the log and data files locations as well. When I ran backup job and to view the backup job output file with SSMS when I click on view I am getting below error.

Could not find a part of the path 'C:\var\opt\mssql\Log\backuplog.txt' in SQL server on linux

I am not sure some how its picking windows location format can some one help me on this. Please.

Is there any way root directly is pointing to C:\ drive?

SQL Server Migration Assistant
SQL Server Migration Assistant
A Microsoft tool designed to automate database migration to SQL Server from Access, DB2, MySQL, Oracle, and SAP ASE.
SQL Server | Other
{count} votes

Answer accepted by question author
  1. MJ Jakati 116 Reputation points
    2021-05-21T18:51:34.133+00:00

    98761-sql-root-directory-wrong.png

    Its a Linux server some how root directory is picking C:\ drive instead of /.

    Can some one please let me know how to fix it.


9 additional answers

Sort by: Most helpful
  1. Erland Sommarskog 127.4K Reputation points MVP Volunteer Moderator
    2021-05-22T18:22:51.337+00:00

    Somethings seems to me messed up on your system, but I can say what. I will ask some questions, but I am not sure that they will lead anywhere.

    The folder dialog above, where exactly did you get this one?

    Can you post a screen of what you have under Database default locations? (Right-click server in Object Explorer, select Properties and then Database Settings.)

    What does SELECT * FROM sys.dm_os_enumerate_fixed_drives return?

    What does SELECT serverproperty('Pathseparator') returm?

    0 comments No comments

  2. MJ Jakati 116 Reputation points
    2021-05-25T17:49:55.75+00:00

    Hello ErlandSommarskog,

    Below is the information which you requested.

    99527-sql-c-drive-on-linux.png

    SELECT * FROM sys.dm_os_enumerate_fixed_drives
    / 3 DRIVE_FIXED 77457788928

    SELECT serverproperty('Pathseparator')
    /


  3. MJ Jakati 116 Reputation points
    2021-05-31T14:54:18.423+00:00

    I got this error when I am trying to view the logs files of SQL server jobs

    Below is the screen shot.

    101154-c-drive-comming-in-output-log-file-view.png

    0 comments No comments

  4. Erland Sommarskog 127.4K Reputation points MVP Volunteer Moderator
    2021-05-31T21:30:50.37+00:00

    I've tried this, and I was able to reproduce the error. I also compared to how it works on Windows, and found that it does not really work that much better. If I run SSMS on the machine where SQL Server is running, I can access the file. But if I run SSMS from a different machine, I get:

    Access to the path '\\PRESENT10\C$\Program Files\Microsoft SQL Server\MSSQL15.NITTON\MSSQL\Log\Blafs.log' is denied.
    

    That is, SSMS tries to access the file directly, without going through SQL Server. This would work for Windows if I enable administrative shares on PRESENT10 (which is not really recommended)

    True, what it tries with the Linux machine has absolutely no chance of working.

    I would suggest that you file a bug on https://feedback.azure.com/forums/908035-sql-server. (You could first make an attempt to see if this has already been failed, but the search capabilities are not that fantastic.)

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.