rm -fr not deleting stuff

iceblink iceblink at seti.nl
Tue Feb 24 12:07:30 UTC 2015

On 2015-02-24 00:17, Karl Auer wrote:
> Got a weird one here.
> Not entirely an Ubuntu question, but it is Linux. I have a Synology 
> NAS,
> and I wanted to delete some old backup directories off it. I create
> backup directories using rsync, hard-linking to unchanged files in
> previous backups. This reduces the size of each backup by re-using an
> existing copy if a file hasn't changed. Read the man page for rsync and
> look at the --link-dest option.
> Anyway, when I tried removing a backup using rm -fr dirname it deleted
> heaps of files out of the directory and its many subdirectories, but
> also issued lots of messages about being unable to delete directories
> because they were not empty.

Synology uses Busybox instead of the rm binary.
Busybox may have some limitations, though I haven't found any in Google.

Another possible problem is that your NAS probably uses some sort of 
RAID, and so it may be that the link to the inode is gone on one disk 
but not yet on another disk, so Linux thinks the hardlink still exists 
and cannot delete the directory.

Doesn't sound like a huge problem though?

Best regards,

More information about the ubuntu-users mailing list