Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Why Device or resource busy whent to remove the file?

Writer Matthew Harrington

/dev/sda4 is in ntfs file system ,and mounted on /mnt/winntfs with ntfsusermap(the most key point),the post list how to mount ntfs in linux step by step.

how to mount ntfs in linux step by step

sudo cp -r mydoc /mnt/winntfs
ls /mnt/winntfs
mydoc
ls /mnt/winntfs/mydoc
analyse build cron

You can see that i have copied all content in $HOME/mydoc into /mnt/winntfs/mydoc,now i want to remove /mnt/winntfs/mydoc.

sudo rm -rf /mnt/winntfs/*
rm: cannot remove '/mnt/winntfs/mydoc': Device or resource busy
lsof | grep -i "mydoc"
lsof | grep -i "/mnt/winntfs/mydoc"

I want to get the process id number with lsof,and kill the process with id number ,then maybe remove it,but lsof command get nothing,why it can be copied some directory ,instead of removing it?How can i remove it ?

1 Answer

Device or resource is busy because partition is still mounted. You have to unmount the partition before removing the partition. Opened terminal and run:

sudo umount -f /mnt/winntfs/mydoc
sudo rm -rf /mnt/winntfs/*

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy