2

I simply try to move file to another path and I'm getting mv: cannot move «file.mp4» to «/path/file.mp4»: Device or resource busy*

I've tried using lsof, but it's not showing any openfiles.

lsof +D /path/

I'm using aufs with the following mount options. aufs udba=reval,sum,create=mfs,br:


*cat file.mp4 > /dev/null didn't fail

here's something strange

mv file.mp4 /path/file.mp4

mv: cannot move «file.mp4» to «/path/file.mp4»: Device or resource busy*

touch /path/file.mp4

and after touch I can move the file... mv file.mp4 /path/file.mp4 works. but if I try to move a new file mv file2.mp4 /path/file2.mp4 I get the same error again Device or resource busy


*update

reboot didn't help :|

dmesg

[ 1162.330502] aufs au_lkup_neg:326:mv[40905]: I/O Error, 2013 should be negative on b9.
[ 1162.356955] aufs au_lkup_neg:326:mv[40908]: I/O Error, 2013 should be negative on b9.
[ 1279.411096] aufs au_lkup_neg:326:mv[47272]: I/O Error, 2013 should be negative on b9.
[ 1682.523704] aufs au_do_pin:470:mv[69289]: err -16
[ 1683.045368] aufs au_do_pin:470:mv[69295]: err -16
[ 1683.488039] aufs au_do_pin:470:mv[69296]: err -16
[ 1683.937787] aufs au_do_pin:470:mv[69297]: err -16
[ 1684.645443] aufs au_do_pin:470:mv[69298]: err -16
user2783132
  • 1,967

3 Answers3

0
  1. fuser will figure out the process and ask you to kill it, using this command:

    fuser -i -k -9 file.mp4
    fuser -i -k -9 /path/file.mp4
    

    Note: you should check both source and destination filenames.

  2. Have you tried logging out / in?

  3. Also, a reboot would probably release the file/path if your uptime is not critical.

0

You have a permissions issue on the destination directory. The touch successfully creates the file, and now that you have a "container", the move proceeds. The clue is that the 2nd attempt fails because the file in the destination doesn't exist. I can almost bet rep points if you touch the 2nd file, then the 2nd move will work just fine.

What is the filesystem? Do you have ACLs enabled? What is the complete path, and the permissions of each directory in that path? What user and group(s) are you using?

Avery Payne
  • 2,541
0

It turned out to be an aufs bug. for whatever reason it created additional empty directory in another sorage. I simply removed it.

user2783132
  • 1,967