Linux cannot remove no such file or directory

Issue:

I have a file sitting on an NTFS partition that I am unable to delete or move. I am able to view the file. This is also preventing me from reading that directory while inside Windows. I get the error; «The file or directory is corrupted and unreadable» when trying to access this directory while inside Windows.

[root@ziggurat var]# ls -al .piw\?PageNum\=0 -rw-r--r-- 0 ttucker root 2016 Jan 28 08:56 '.piw?PageNum=0' [root@ziggurat var]# rm -i .p* rm: remove regular file '.piw?PageNum=0'? y rm: cannot remove '.piw?PageNum=0': No such file or directory [root@ziggurat var]# mv .piw\?PageNum\=0 derp mv: cannot move '.piw?PageNum=0' to 'derp': No such file or directory 

If I try to edit the file with vim I see «.piw?PageNum=0» [Permission Denied] at the bottom left. If I try to modify the permissions I get the following error:

[root@ziggurat var]# chmod 777 .piw\?PageNum\=0 chmod: cannot access '.piw?PageNum=0': Input/output error 

More information:

This is a second drive which contains one partition. The partition was created inside Windows 10. This partition does not contain my Windows C Drive — this drive is completely separate from my Linux root and Windows oot partitions.

[root@ziggurat var]# pwd /mnt/storage/ttucker/var [root@ziggurat var]# df -h /mnt/storage/ Filesystem Size Used Avail Use% Mounted on /dev/sda1 932G 197G 736G 22% /mnt/storage [root@ziggurat var]# fdisk -l /dev/sda Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: 91985B34-E4D8-4F7B-ABF4-7F2E27482077 Device Start End Sectors Size Type /dev/sda1 2048 1953523711 1953521664 931.5G Microsoft basic data 

Even more information:

While inside Windows I am not able to switch into the var directory. I receive the message: The file or directory is corrupted and unreadable. I am able to view and modify anywhere else in the drive. The file was initially created, likely, with a botched wget command. The file is there and I can cat it to STDOUT . The contents are HTML from a US Patent webpage.

[root@ziggurat var]# cat .piw\?PageNum\=0   Patent Images . clipped for brevity .  
[root@ziggurat var]# pacman -Ss ntfs extra/ntfs-3g 2016.2.22-1 [installed] NTFS filesystem driver and utilities [root@ziggurat var]# uname -a Linux ziggurat 4.9.6-1-ARCH #1 SMP PREEMPT Thu Jan 26 09:22:26 CET 2017 x86_64 GNU/Linux 

Final note:

Update

I chmod 777 ‘d the var dir. Then ran chown -R root:root var , received this error: chown: changing ownership of ‘var/.piw?PageNum=0’: Input/output error . then . looking in the dir:

[root@ziggurat var]# ls -ltra ls: cannot access '.piw?PageNum=0': Input/output error total 3116333 -. ? ? ? ? ? '.piw?PageNum=0' -rw-r--r-- 1 ttucker root 250910 Jan 28 08:56 0.pdf . 

Second Update:

After running the chown on the directory mentioned above I then rebooted into Windows. During the Windows load it stated that it was checking the drive for consistency (or something of that language) Anywho. it works now. The file is gone and I am able to read it in Windows.

Читайте также:  Read from command line linux

Additional information which may be helpful to others:

I have two drives with the same files on them; an internal backup drive and an external backup drive. Both are NTFS and both var dirs could not be accessed in Windows. After resolving the issue with the internal drive I found that deleting the «goofy» named files resolved the issue on the external drive as well. Example:

-rwxrwxrwx 1 root root 2016 Dec 31 22:31 '.piw?PageNum=0' -rwxrwxrwx 1 root root 8379 Dec 31 22:32 '.piw?PageNum=0&docid=01111111&IDKey=DE3F91CB19BB%0D%0A&HomeUrl=http%3A%2F%2Fpatft.uspto.gov%2Fnetacgi%2Fnph-Parser%3FSect1%3DPTO1%2526Sect2%3DHITOFF%2526d%3DPALL%2526p%3D1%2526u%3D%25252Fnetahtml%25252FPTO%25252Fsrchnum.htm%2526r%3D1%25' 

For some reason, perhaps because I did not run ntfsfix , on the external drive I was able to just delete those two «problem files» and then read that directory in Windows. Thanks all!

Источник

Cannot remove : No such file or directory

I just ran some self-written program in which I make files and fill them with stuff. However, I did something wrong (or at least, not as intended) with the name generation and now there are four files stuck in the folder which cannot be removed as they ‘do not exist’. Outputs of commands: ls -li :

ls: cannot access één: No such file or directory ls: cannot access wetenschap­pen.: No such file or directory ls: cannot access verantwoor­delijk: No such file or directory ls: cannot access woord wordt: No such file or directory total 0 ? -. ? ? ? ? ? één ? -. ? ? ? ? ? woord wordt ? -. ? ? ? ? ? verantwoor­delijk ? -. ? ? ? ? ? wetenschap­pen. 
rm: remove regular file `één'? y rm: cannot remove `één': No such file or directory rm: remove regular file `woord wordt'? y rm: cannot remove `woord wordt': No such file or directory rm: remove regular file `verantwoor­delijk'? y rm: cannot remove `verantwoor­delijk': No such file or directory rm: remove regular file `wetenschap­pen.'? y rm: cannot remove `wetenschap­pen.': No such file or directory 
rm: cannot remove `folder': Directory not empty 
find: cannot delete `./één': No such file or directory find: cannot delete `./wetenschap­pen.': No such file or directory find: cannot delete `./verantwoor­delijk': No such file or directory find: cannot delete `./woord wordt': No such file or directory 

strace -o out rm -f — * : Contents of out How can I remove these files?
Important to note is that I do not have root access, so I would prefer an option which does not require that.

Читайте также:  Linux запуск прокси сервера

Источник

rm: cannot remove ‘file’: No such file or directory

I need to delete some files under Linux, but when I try to do so, I always get the same error: rm: cannot remove ‘file’: No such file or directory . The problem is that the said files are visible with every file manager and with ls , and I can even open it with their respective applications (i.e. I can open and read text files with Kate, images with Gwenview, and so on); so I can’t understand why when I try to delete them, they are marked as non-existent. If it is helpful, these are backup files, they are on a removable NTFS hard-disk and they are all inside the folder of a failed backup task; they were created by Back in Time: this program works by comparing subsequent backups and hardlinking when files are not changed in order to save space; I suppose this has something to do with the current problem. How can I delete these files? I tried to use rm -f without any success (even with sudo ). They are still there and they are still non-existent; even under Windows, I was unable to delete them; what else can I try to do? P.S. I’ve already asked advice to Schrodinger’s Cat, with no success. Here is a sample of the names of these files:

rcb-ScrollBarH_bar_focus.png rcb-separator_vertical.png ScrollBarNib.png thumbborder-thin-black.png rcb-ScrollBarV_bar_focus.png scrollbarh_bar_focus.png scrollbarv.png thumbborder-thin.png 

I’ve edited my question as requested; however, it doesn’t seem that these filenames contain any strange character.

Источник

Issue:

I have a file sitting on an NTFS partition that I am unable to delete or move. I am able to view the file. This is also preventing me from reading that directory while inside Windows. I get the error; «The file or directory is corrupted and unreadable» when trying to access this directory while inside Windows.

[root@ziggurat var]# ls -al .piw\?PageNum\=0 -rw-r--r-- 0 ttucker root 2016 Jan 28 08:56 '.piw?PageNum=0' [root@ziggurat var]# rm -i .p* rm: remove regular file '.piw?PageNum=0'? y rm: cannot remove '.piw?PageNum=0': No such file or directory [root@ziggurat var]# mv .piw\?PageNum\=0 derp mv: cannot move '.piw?PageNum=0' to 'derp': No such file or directory 

If I try to edit the file with vim I see «.piw?PageNum=0» [Permission Denied] at the bottom left. If I try to modify the permissions I get the following error:

[root@ziggurat var]# chmod 777 .piw\?PageNum\=0 chmod: cannot access '.piw?PageNum=0': Input/output error 

More information:

This is a second drive which contains one partition. The partition was created inside Windows 10. This partition does not contain my Windows C Drive — this drive is completely separate from my Linux root and Windows oot partitions.

[root@ziggurat var]# pwd /mnt/storage/ttucker/var [root@ziggurat var]# df -h /mnt/storage/ Filesystem Size Used Avail Use% Mounted on /dev/sda1 932G 197G 736G 22% /mnt/storage [root@ziggurat var]# fdisk -l /dev/sda Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: 91985B34-E4D8-4F7B-ABF4-7F2E27482077 Device Start End Sectors Size Type /dev/sda1 2048 1953523711 1953521664 931.5G Microsoft basic data 

Even more information:

While inside Windows I am not able to switch into the var directory. I receive the message: The file or directory is corrupted and unreadable. I am able to view and modify anywhere else in the drive. The file was initially created, likely, with a botched wget command. The file is there and I can cat it to STDOUT . The contents are HTML from a US Patent webpage.

[root@ziggurat var]# cat .piw\?PageNum\=0   Patent Images . clipped for brevity .  
[root@ziggurat var]# pacman -Ss ntfs extra/ntfs-3g 2016.2.22-1 [installed] NTFS filesystem driver and utilities [root@ziggurat var]# uname -a Linux ziggurat 4.9.6-1-ARCH #1 SMP PREEMPT Thu Jan 26 09:22:26 CET 2017 x86_64 GNU/Linux 

Final note:

Update

I chmod 777 ‘d the var dir. Then ran chown -R root:root var , received this error: chown: changing ownership of ‘var/.piw?PageNum=0’: Input/output error . then . looking in the dir:

[root@ziggurat var]# ls -ltra ls: cannot access '.piw?PageNum=0': Input/output error total 3116333 -. ? ? ? ? ? '.piw?PageNum=0' -rw-r--r-- 1 ttucker root 250910 Jan 28 08:56 0.pdf . 

Second Update:

After running the chown on the directory mentioned above I then rebooted into Windows. During the Windows load it stated that it was checking the drive for consistency (or something of that language) Anywho. it works now. The file is gone and I am able to read it in Windows.

Читайте также:  Последние версии операционной системы linux

Additional information which may be helpful to others:

I have two drives with the same files on them; an internal backup drive and an external backup drive. Both are NTFS and both var dirs could not be accessed in Windows. After resolving the issue with the internal drive I found that deleting the «goofy» named files resolved the issue on the external drive as well. Example:

-rwxrwxrwx 1 root root 2016 Dec 31 22:31 '.piw?PageNum=0' -rwxrwxrwx 1 root root 8379 Dec 31 22:32 '.piw?PageNum=0&docid=01111111&IDKey=DE3F91CB19BB%0D%0A&HomeUrl=http%3A%2F%2Fpatft.uspto.gov%2Fnetacgi%2Fnph-Parser%3FSect1%3DPTO1%2526Sect2%3DHITOFF%2526d%3DPALL%2526p%3D1%2526u%3D%25252Fnetahtml%25252FPTO%25252Fsrchnum.htm%2526r%3D1%25' 

For some reason, perhaps because I did not run ntfsfix , on the external drive I was able to just delete those two «problem files» and then read that directory in Windows. Thanks all!

Источник

Оцените статью
Adblock
detector