rm -rf does not work: 'Device or resource busy'
up vote
1
down vote
favorite
I'm using OpenVZ to create containers and it creates a folder for each container to store its files. I stopped the creation of a container before it gets completed, so it created a folder for that container, but when I try to remove that folder using rm -rf
, I get the 'Device or resource busy'
error, but when I do 'lsof <container folder>'
or 'fuser <container folder>'
, it returns nothing, even when I do umount <container folder>
nothing happens. So I'm not sure which process or device is using it. How can I remove this folder?
rm container openvz
add a comment |
up vote
1
down vote
favorite
I'm using OpenVZ to create containers and it creates a folder for each container to store its files. I stopped the creation of a container before it gets completed, so it created a folder for that container, but when I try to remove that folder using rm -rf
, I get the 'Device or resource busy'
error, but when I do 'lsof <container folder>'
or 'fuser <container folder>'
, it returns nothing, even when I do umount <container folder>
nothing happens. So I'm not sure which process or device is using it. How can I remove this folder?
rm container openvz
Addsudo
and see if it removes it!
– George Udosen
Sep 24 at 12:41
Please replaceTheFilename
with the folder name (keep the surrounding quotes) inenv DIR="TheFilename" fgrep "$( df --output=source "$DIR" | tail -1 )" /etc/mtab
, run that in a terminal, and edit your question to include the output.
– Chai T. Rex
Sep 24 at 12:49
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm using OpenVZ to create containers and it creates a folder for each container to store its files. I stopped the creation of a container before it gets completed, so it created a folder for that container, but when I try to remove that folder using rm -rf
, I get the 'Device or resource busy'
error, but when I do 'lsof <container folder>'
or 'fuser <container folder>'
, it returns nothing, even when I do umount <container folder>
nothing happens. So I'm not sure which process or device is using it. How can I remove this folder?
rm container openvz
I'm using OpenVZ to create containers and it creates a folder for each container to store its files. I stopped the creation of a container before it gets completed, so it created a folder for that container, but when I try to remove that folder using rm -rf
, I get the 'Device or resource busy'
error, but when I do 'lsof <container folder>'
or 'fuser <container folder>'
, it returns nothing, even when I do umount <container folder>
nothing happens. So I'm not sure which process or device is using it. How can I remove this folder?
rm container openvz
rm container openvz
edited Sep 24 at 12:39
muclux
2,2181524
2,2181524
asked Sep 24 at 12:23
Alex
1417
1417
Addsudo
and see if it removes it!
– George Udosen
Sep 24 at 12:41
Please replaceTheFilename
with the folder name (keep the surrounding quotes) inenv DIR="TheFilename" fgrep "$( df --output=source "$DIR" | tail -1 )" /etc/mtab
, run that in a terminal, and edit your question to include the output.
– Chai T. Rex
Sep 24 at 12:49
add a comment |
Addsudo
and see if it removes it!
– George Udosen
Sep 24 at 12:41
Please replaceTheFilename
with the folder name (keep the surrounding quotes) inenv DIR="TheFilename" fgrep "$( df --output=source "$DIR" | tail -1 )" /etc/mtab
, run that in a terminal, and edit your question to include the output.
– Chai T. Rex
Sep 24 at 12:49
Add
sudo
and see if it removes it!– George Udosen
Sep 24 at 12:41
Add
sudo
and see if it removes it!– George Udosen
Sep 24 at 12:41
Please replace
TheFilename
with the folder name (keep the surrounding quotes) in env DIR="TheFilename" fgrep "$( df --output=source "$DIR" | tail -1 )" /etc/mtab
, run that in a terminal, and edit your question to include the output.– Chai T. Rex
Sep 24 at 12:49
Please replace
TheFilename
with the folder name (keep the surrounding quotes) in env DIR="TheFilename" fgrep "$( df --output=source "$DIR" | tail -1 )" /etc/mtab
, run that in a terminal, and edit your question to include the output.– Chai T. Rex
Sep 24 at 12:49
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
I did several umount commands and it worked well for me. For some reason, the folder has been mounted several times by openvz, so I had to umount it several times to be able to remove it.
where do you mean to put the comment?
– Alex
Sep 24 at 16:19
Sorry, my fault. You can also mark this post as answer.
– abu_bua
Sep 24 at 16:21
add a comment |
up vote
0
down vote
$ umount /directory/
=> umount(/directory/): Resource busy -- try 'diskutil unmount'
So I tried with
diskutil unmount /directory/
and it works for me.
New contributor
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I did several umount commands and it worked well for me. For some reason, the folder has been mounted several times by openvz, so I had to umount it several times to be able to remove it.
where do you mean to put the comment?
– Alex
Sep 24 at 16:19
Sorry, my fault. You can also mark this post as answer.
– abu_bua
Sep 24 at 16:21
add a comment |
up vote
1
down vote
I did several umount commands and it worked well for me. For some reason, the folder has been mounted several times by openvz, so I had to umount it several times to be able to remove it.
where do you mean to put the comment?
– Alex
Sep 24 at 16:19
Sorry, my fault. You can also mark this post as answer.
– abu_bua
Sep 24 at 16:21
add a comment |
up vote
1
down vote
up vote
1
down vote
I did several umount commands and it worked well for me. For some reason, the folder has been mounted several times by openvz, so I had to umount it several times to be able to remove it.
I did several umount commands and it worked well for me. For some reason, the folder has been mounted several times by openvz, so I had to umount it several times to be able to remove it.
answered Sep 24 at 15:28
Alex
1417
1417
where do you mean to put the comment?
– Alex
Sep 24 at 16:19
Sorry, my fault. You can also mark this post as answer.
– abu_bua
Sep 24 at 16:21
add a comment |
where do you mean to put the comment?
– Alex
Sep 24 at 16:19
Sorry, my fault. You can also mark this post as answer.
– abu_bua
Sep 24 at 16:21
where do you mean to put the comment?
– Alex
Sep 24 at 16:19
where do you mean to put the comment?
– Alex
Sep 24 at 16:19
Sorry, my fault. You can also mark this post as answer.
– abu_bua
Sep 24 at 16:21
Sorry, my fault. You can also mark this post as answer.
– abu_bua
Sep 24 at 16:21
add a comment |
up vote
0
down vote
$ umount /directory/
=> umount(/directory/): Resource busy -- try 'diskutil unmount'
So I tried with
diskutil unmount /directory/
and it works for me.
New contributor
add a comment |
up vote
0
down vote
$ umount /directory/
=> umount(/directory/): Resource busy -- try 'diskutil unmount'
So I tried with
diskutil unmount /directory/
and it works for me.
New contributor
add a comment |
up vote
0
down vote
up vote
0
down vote
$ umount /directory/
=> umount(/directory/): Resource busy -- try 'diskutil unmount'
So I tried with
diskutil unmount /directory/
and it works for me.
New contributor
$ umount /directory/
=> umount(/directory/): Resource busy -- try 'diskutil unmount'
So I tried with
diskutil unmount /directory/
and it works for me.
New contributor
edited Nov 22 at 16:51
abu_bua
3,05381023
3,05381023
New contributor
answered Nov 22 at 16:37
Steve Tuo
1
1
New contributor
New contributor
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1077999%2frm-rf-does-not-work-device-or-resource-busy%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Add
sudo
and see if it removes it!– George Udosen
Sep 24 at 12:41
Please replace
TheFilename
with the folder name (keep the surrounding quotes) inenv DIR="TheFilename" fgrep "$( df --output=source "$DIR" | tail -1 )" /etc/mtab
, run that in a terminal, and edit your question to include the output.– Chai T. Rex
Sep 24 at 12:49