0

I am unable to delete a directory even as root. The command rm -rf kdyiyv.pif returns nothing. Then I tried the command, touch kdyiyv.pif for which there was an error: touch: setting times of 'kdyiyv.pif/': Input/output error

I also tried, strace rm -rf kdyiyv.pif

Output of the "strace" is:

execve("/bin/rm", ["rm", "-rf", "/media/Kira/kdyiyv.pif"], [/* 38 vars */]) = 0
brk(0)                                  = 0x8f2f000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7786000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=53732, ...}) = 0
mmap2(NULL, 53732, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7778000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@n\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1421892, ...}) = 0
mmap2(NULL, 1431976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x110000
mprotect(0x267000, 4096, PROT_NONE)     = 0
mmap2(0x268000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x157) = 0x268000
mmap2(0x26b000, 10664, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x26b000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7777000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb77778d0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0x268000, 8192, PROT_READ)     = 0
mprotect(0x8053000, 4096, PROT_READ)    = 0
mprotect(0xb86000, 4096, PROT_READ)     = 0
munmap(0xb7778000, 53732)               = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=8580848, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7577000
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0x82e) = 0xb7785000
brk(0)                                  = 0x8f2f000
brk(0x8f50000)                          = 0x8f50000
close(3)                                = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
lstat64("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fstatat64(AT_FDCWD, "/media/Kira/kdyiyv.pif", {st_mode=S_IFDIR|0700, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/media/Kira/kdyiyv.pif", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fcntl64(3, F_GETFD)                     = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
fstat64(3, {st_mode=S_IFDIR|0700, st_size=0, ...}) = 0
fcntl64(3, F_GETFL)                     = 0x18800 (flags O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) 
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
fcntl64(3, F_DUPFD, 3)                  = 4
fcntl64(4, F_GETFD)                     = 0
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 2 entries */, 32768)   = 48
getdents64(3, /* 0 entries */, 32768)   = 0
close(3)                                = 0
unlinkat(AT_FDCWD, "/media/Kira/kdyiyv.pif", AT_REMOVEDIR) = -1 ENOENT (No such file or directory)
close(4)                                = 0
close(0)                                = 0
close(1)                                = 0
close(2)                                = 0
exit_group(0)                           = ?
3
  • Your dir is not present, the strace ouput said: unlinkat(AT_FDCWD, "/media/Kira/kdyiyv.pif", AT_REMOVEDIR) = -1 ENOENT (No such file or directory)
    – cuonglm
    May 31, 2013 at 4:27
  • What filesystem is this on? It's possible that you'd not be allowed to delete things on a remote filesystem. May 31, 2013 at 4:27
  • Also, I've seen issues similar to this when manipulating NTFS drives - something doesn't update right in the file tables, and you end up with things like files/folders that show up in ls but are not really there. Have to fix the drive/filesystem with windows. May 31, 2013 at 12:49

1 Answer 1

4

Since your path is '/media/Kira' I am going to assume this is on some removable USB drive. You should not ignore the 'Input/output error' and look at the output of dmesg.

You should probably remove and reconnect the USB device. And possible restart the computer if that in itself does not help.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .