Msg 5105, Level 16, State 2, Line 1
A file activation error occurred. The physical file name ' X:\filepath\mydb_Log.ldf' may be incorrect. Diagnose and correct additional errors, and retry the operation.
Msg 3156, Level 16, State 3, Line 1"
Oh very basic error in case you also faced that. Please understand below
1. This is not a permission issue at all
2. This file is in use doesn't create this error.
3. The only issue is sql server is not able to read this file as either this path doesn't exists or file doesn't exists.
I test the cases and In my cases I didn't put single quotes according , my file location was wrong, or my file doesn't exists