Sudo rm -rf does not remove a non-empty folder Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionLogin fails from Windows on NTFS-3G Samba ShareHow to delete a NTFS filesystem file whose name contains “:”?rm -rf: cannot remove `/opt/jetty': Directory not emptyWhere is the information about the file system format stored in External Hard DisksIs it possible to mount ~/.ipfs folder to an external drive?Cannot remove directory, operation not supported on NTFSUndeletable folders with random name keeps appearing in secondary driveWrong fs type, bad option, bad superblock on /dev/sdXHow to access external hard drive from Ubuntu Shell and Python codeWindows removed files copied from Linux and ext4 filesystem
Bonus calculation: Am I making a mountain out of a molehill?
What is the longest distance a 13th-level monk can jump while attacking on the same turn?
Should I discuss the type of campaign with my players?
Doubts about chords
What happens to sewage if there is no river near by?
Is the Standard Deduction better than Itemized when both are the same amount?
Stars Make Stars
Models of set theory where not every set can be linearly ordered
Check which numbers satisfy the condition [A*B*C = A! + B! + C!]
What is this single-engine low-wing propeller plane?
Is there a Spanish version of "dot your i's and cross your t's" that includes the letter 'ñ'?
Does accepting a pardon have any bearing on trying that person for the same crime in a sovereign jurisdiction?
How does a Death Domain cleric's Touch of Death feature work with Touch-range spells delivered by familiars?
Is it true that "carbohydrates are of no use for the basal metabolic need"?
Is 1 ppb equal to 1 μg/kg?
Did Kevin spill real chili?
How can players work together to take actions that are otherwise impossible?
Did Xerox really develop the first LAN?
How much radiation do nuclear physics experiments expose researchers to nowadays?
Why is black pepper both grey and black?
Is there a "higher Segal conjecture"?
Right-skewed distribution with mean equals to mode?
What do you call a phrase that's not an idiom yet?
Is the address of a local variable a constexpr?
Sudo rm -rf does not remove a non-empty folder
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionLogin fails from Windows on NTFS-3G Samba ShareHow to delete a NTFS filesystem file whose name contains “:”?rm -rf: cannot remove `/opt/jetty': Directory not emptyWhere is the information about the file system format stored in External Hard DisksIs it possible to mount ~/.ipfs folder to an external drive?Cannot remove directory, operation not supported on NTFSUndeletable folders with random name keeps appearing in secondary driveWrong fs type, bad option, bad superblock on /dev/sdXHow to access external hard drive from Ubuntu Shell and Python codeWindows removed files copied from Linux and ext4 filesystem
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a mounted an external hard disk on /media/pcmagas/Backup disk
containing a folder dimitrios
. When I try to remove it with the following comand:
/media/pcmagas/Backup disk
sudo rm -rf ./dimitrios
I get this error:
rm: cannot remove './dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes': Directory not empty
The mounted disk is ntfs, and I have mounted it into an Ubuntu GNU/Linux system.
When I run ls -l ./dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes
I get the following error:
ls: reading directory './dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes': Input/output error
ubuntu mount rm ntfs
|
show 1 more comment
I have a mounted an external hard disk on /media/pcmagas/Backup disk
containing a folder dimitrios
. When I try to remove it with the following comand:
/media/pcmagas/Backup disk
sudo rm -rf ./dimitrios
I get this error:
rm: cannot remove './dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes': Directory not empty
The mounted disk is ntfs, and I have mounted it into an Ubuntu GNU/Linux system.
When I run ls -l ./dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes
I get the following error:
ls: reading directory './dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes': Input/output error
ubuntu mount rm ntfs
2
This could indicate filesystem corruption or a hardware issue. What doesdmesg
output after getting the I/O error?
– Torin
11 hours ago
Well I reformated the disk after backed up the wanted data.
– Dimitrios Desyllas
10 hours ago
You may want to runbadblocks
on the device since it's possible the disk might have bad sectors
– Torin
10 hours ago
1
Two questions — (a) which filesystem does “Backup disk” use? (b) are there any error messages from the kernel indmesg
,/var/log/kern.log
, the systemd journal, etc.?
– derobert
10 hours ago
1
@DimitriosDesyllas I'd guess you've hit a bug in the NTFS drivers for Linux. If this disk is just for backup from Linux, I'd strongly suggest using ext4, XFS, btrfs, etc. instead of NTFS. If you hadn't reformatted the disk, the next step would have been an fsck. Possibly from a Windows machine.
– derobert
10 hours ago
|
show 1 more comment
I have a mounted an external hard disk on /media/pcmagas/Backup disk
containing a folder dimitrios
. When I try to remove it with the following comand:
/media/pcmagas/Backup disk
sudo rm -rf ./dimitrios
I get this error:
rm: cannot remove './dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes': Directory not empty
The mounted disk is ntfs, and I have mounted it into an Ubuntu GNU/Linux system.
When I run ls -l ./dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes
I get the following error:
ls: reading directory './dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes': Input/output error
ubuntu mount rm ntfs
I have a mounted an external hard disk on /media/pcmagas/Backup disk
containing a folder dimitrios
. When I try to remove it with the following comand:
/media/pcmagas/Backup disk
sudo rm -rf ./dimitrios
I get this error:
rm: cannot remove './dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes': Directory not empty
The mounted disk is ntfs, and I have mounted it into an Ubuntu GNU/Linux system.
When I run ls -l ./dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes
I get the following error:
ls: reading directory './dimitrios/Kwdikas/Javascript/data_map/node_modules/random-bytes': Input/output error
ubuntu mount rm ntfs
ubuntu mount rm ntfs
edited 8 hours ago
0xSheepdog
1,74011025
1,74011025
asked 11 hours ago
Dimitrios DesyllasDimitrios Desyllas
223317
223317
2
This could indicate filesystem corruption or a hardware issue. What doesdmesg
output after getting the I/O error?
– Torin
11 hours ago
Well I reformated the disk after backed up the wanted data.
– Dimitrios Desyllas
10 hours ago
You may want to runbadblocks
on the device since it's possible the disk might have bad sectors
– Torin
10 hours ago
1
Two questions — (a) which filesystem does “Backup disk” use? (b) are there any error messages from the kernel indmesg
,/var/log/kern.log
, the systemd journal, etc.?
– derobert
10 hours ago
1
@DimitriosDesyllas I'd guess you've hit a bug in the NTFS drivers for Linux. If this disk is just for backup from Linux, I'd strongly suggest using ext4, XFS, btrfs, etc. instead of NTFS. If you hadn't reformatted the disk, the next step would have been an fsck. Possibly from a Windows machine.
– derobert
10 hours ago
|
show 1 more comment
2
This could indicate filesystem corruption or a hardware issue. What doesdmesg
output after getting the I/O error?
– Torin
11 hours ago
Well I reformated the disk after backed up the wanted data.
– Dimitrios Desyllas
10 hours ago
You may want to runbadblocks
on the device since it's possible the disk might have bad sectors
– Torin
10 hours ago
1
Two questions — (a) which filesystem does “Backup disk” use? (b) are there any error messages from the kernel indmesg
,/var/log/kern.log
, the systemd journal, etc.?
– derobert
10 hours ago
1
@DimitriosDesyllas I'd guess you've hit a bug in the NTFS drivers for Linux. If this disk is just for backup from Linux, I'd strongly suggest using ext4, XFS, btrfs, etc. instead of NTFS. If you hadn't reformatted the disk, the next step would have been an fsck. Possibly from a Windows machine.
– derobert
10 hours ago
2
2
This could indicate filesystem corruption or a hardware issue. What does
dmesg
output after getting the I/O error?– Torin
11 hours ago
This could indicate filesystem corruption or a hardware issue. What does
dmesg
output after getting the I/O error?– Torin
11 hours ago
Well I reformated the disk after backed up the wanted data.
– Dimitrios Desyllas
10 hours ago
Well I reformated the disk after backed up the wanted data.
– Dimitrios Desyllas
10 hours ago
You may want to run
badblocks
on the device since it's possible the disk might have bad sectors– Torin
10 hours ago
You may want to run
badblocks
on the device since it's possible the disk might have bad sectors– Torin
10 hours ago
1
1
Two questions — (a) which filesystem does “Backup disk” use? (b) are there any error messages from the kernel in
dmesg
, /var/log/kern.log
, the systemd journal, etc.?– derobert
10 hours ago
Two questions — (a) which filesystem does “Backup disk” use? (b) are there any error messages from the kernel in
dmesg
, /var/log/kern.log
, the systemd journal, etc.?– derobert
10 hours ago
1
1
@DimitriosDesyllas I'd guess you've hit a bug in the NTFS drivers for Linux. If this disk is just for backup from Linux, I'd strongly suggest using ext4, XFS, btrfs, etc. instead of NTFS. If you hadn't reformatted the disk, the next step would have been an fsck. Possibly from a Windows machine.
– derobert
10 hours ago
@DimitriosDesyllas I'd guess you've hit a bug in the NTFS drivers for Linux. If this disk is just for backup from Linux, I'd strongly suggest using ext4, XFS, btrfs, etc. instead of NTFS. If you hadn't reformatted the disk, the next step would have been an fsck. Possibly from a Windows machine.
– derobert
10 hours ago
|
show 1 more comment
2 Answers
2
active
oldest
votes
In order to solve the problem you should do:
rsync
any folder that you want to keep in the hard disk back to your computer's hard disk.- Then format it, you can use the
gparted
gui program to do so if you have anXOrg
installed GNU/Linux system. - Move back the folders you kept.
I know its a bit hacky but for desktop use did the job in my case.
add a comment |
'rm' command is used to remove files only and directories that are not empty
use 'rmdir' to remove directories to remove dir's which are empty
2
The-r
flag onrm
removes empty directories too
– Torin
10 hours ago
1
The OP correctly used therm
command to remove non-empty directories. Your answer is incorrect.
– 0xSheepdog
9 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2funix.stackexchange.com%2fquestions%2f512618%2fsudo-rm-rf-does-not-remove-a-non-empty-folder%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
In order to solve the problem you should do:
rsync
any folder that you want to keep in the hard disk back to your computer's hard disk.- Then format it, you can use the
gparted
gui program to do so if you have anXOrg
installed GNU/Linux system. - Move back the folders you kept.
I know its a bit hacky but for desktop use did the job in my case.
add a comment |
In order to solve the problem you should do:
rsync
any folder that you want to keep in the hard disk back to your computer's hard disk.- Then format it, you can use the
gparted
gui program to do so if you have anXOrg
installed GNU/Linux system. - Move back the folders you kept.
I know its a bit hacky but for desktop use did the job in my case.
add a comment |
In order to solve the problem you should do:
rsync
any folder that you want to keep in the hard disk back to your computer's hard disk.- Then format it, you can use the
gparted
gui program to do so if you have anXOrg
installed GNU/Linux system. - Move back the folders you kept.
I know its a bit hacky but for desktop use did the job in my case.
In order to solve the problem you should do:
rsync
any folder that you want to keep in the hard disk back to your computer's hard disk.- Then format it, you can use the
gparted
gui program to do so if you have anXOrg
installed GNU/Linux system. - Move back the folders you kept.
I know its a bit hacky but for desktop use did the job in my case.
edited 3 hours ago
answered 10 hours ago
Dimitrios DesyllasDimitrios Desyllas
223317
223317
add a comment |
add a comment |
'rm' command is used to remove files only and directories that are not empty
use 'rmdir' to remove directories to remove dir's which are empty
2
The-r
flag onrm
removes empty directories too
– Torin
10 hours ago
1
The OP correctly used therm
command to remove non-empty directories. Your answer is incorrect.
– 0xSheepdog
9 hours ago
add a comment |
'rm' command is used to remove files only and directories that are not empty
use 'rmdir' to remove directories to remove dir's which are empty
2
The-r
flag onrm
removes empty directories too
– Torin
10 hours ago
1
The OP correctly used therm
command to remove non-empty directories. Your answer is incorrect.
– 0xSheepdog
9 hours ago
add a comment |
'rm' command is used to remove files only and directories that are not empty
use 'rmdir' to remove directories to remove dir's which are empty
'rm' command is used to remove files only and directories that are not empty
use 'rmdir' to remove directories to remove dir's which are empty
answered 10 hours ago
QasimQasim
3013
3013
2
The-r
flag onrm
removes empty directories too
– Torin
10 hours ago
1
The OP correctly used therm
command to remove non-empty directories. Your answer is incorrect.
– 0xSheepdog
9 hours ago
add a comment |
2
The-r
flag onrm
removes empty directories too
– Torin
10 hours ago
1
The OP correctly used therm
command to remove non-empty directories. Your answer is incorrect.
– 0xSheepdog
9 hours ago
2
2
The
-r
flag on rm
removes empty directories too– Torin
10 hours ago
The
-r
flag on rm
removes empty directories too– Torin
10 hours ago
1
1
The OP correctly used the
rm
command to remove non-empty directories. Your answer is incorrect.– 0xSheepdog
9 hours ago
The OP correctly used the
rm
command to remove non-empty directories. Your answer is incorrect.– 0xSheepdog
9 hours ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2funix.stackexchange.com%2fquestions%2f512618%2fsudo-rm-rf-does-not-remove-a-non-empty-folder%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
-mount, ntfs, rm, ubuntu
2
This could indicate filesystem corruption or a hardware issue. What does
dmesg
output after getting the I/O error?– Torin
11 hours ago
Well I reformated the disk after backed up the wanted data.
– Dimitrios Desyllas
10 hours ago
You may want to run
badblocks
on the device since it's possible the disk might have bad sectors– Torin
10 hours ago
1
Two questions — (a) which filesystem does “Backup disk” use? (b) are there any error messages from the kernel in
dmesg
,/var/log/kern.log
, the systemd journal, etc.?– derobert
10 hours ago
1
@DimitriosDesyllas I'd guess you've hit a bug in the NTFS drivers for Linux. If this disk is just for backup from Linux, I'd strongly suggest using ext4, XFS, btrfs, etc. instead of NTFS. If you hadn't reformatted the disk, the next step would have been an fsck. Possibly from a Windows machine.
– derobert
10 hours ago