none
SQL Server 2017 CU9 (14.0.3035.2) MODIFY FILE encountered operating system error 31(A device attached to the system is not functioning.) while attempting to expand the physical file RRS feed

  • Question

  • Hello, 

    I'm trying to restore a database to Linux SQL Server, The drive is formated as XFS so is under the list of supported items, however, I'm getting the following error:

    Msg 5149, Level 16, State 3, Line 1
    MODIFY FILE encountered operating system error 31(A device attached to the system is not functioning.) while attempting to expand the physical file '/var/opt/mssql/data/TestDB.mdf'.

    Msg 3013, Level 16, State 1, Line 1
    RESTORE DATABASE is terminating abnormally.

    My Command for restore:

    RESTORE DATABASE TestDB
    FROM DISK = '/var/opt/mssql/backup/TestDB.bak'
    WITH MOVE 'TestDB' TO '/var/opt/mssql/data/TestDB.mdf',
    MOVE 'TestDB_Log' TO '/var/opt/mssql/data/TestDB_Log.ldf'

    Anyone able to help with this?

    Thank you.


    • Edited by WChandlerUK Thursday, August 16, 2018 10:26 AM
    Thursday, August 16, 2018 10:26 AM

All replies

  • Thanks, I've tired setting back the /backup and the /data folders to 777 to remove any such issue, thats still not working.

    mssql is the owner and group of the folders.

    I'm logged into SQL Server using the SA account also. 

    Thursday, August 16, 2018 1:01 PM
  • Hi WChandleUK,

    What's the size of database? Perhaps the file system usage is full so you encounter the system error 31.

    Please try to use df -Th to have a check disk space.

    If so, increase your problematic driver/file system size and try it again.

    If not, please try using SSMS to connect to your SQL Server then use Restore feature instead of SQL command.

    Check what happens.

    Regards,

    Pirlo Zhang 


    MSDN Community Support<br/> Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    • Proposed as answer by Pirlo Zhang Thursday, August 23, 2018 8:55 AM
    Friday, August 17, 2018 9:03 AM