• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Unable to delete a weird directoryish

Joined
Aug 26, 2019
Messages
558 (0.33/day)
After more than a decade of apathy and negligence, I'm finally cleaning up and organizing the data in my life e.g. running fslint on my venerable NAS (Debian with mdm), finishing getting rsnapshot setup, et al.

One step was moving data from an external HDD to my NAS. While cleaning up said data now on my NAS, I encountered a directoryish that I can't delete despite every trick I know. Note where it said it's a directory and not a directory in the command output. Odd, right? Thoughts on how i can get it deleted?
Bash:
# ls
'Fran?ois Couperin'
#ls -lah
ls: 'Fran?ois Couperin': No such file or directory
total 0
drwxr-xr-x+ 3 jdoe jdoe 0 Nov  4 02:11  .
drwxr-xr-x+ 3 jdoe jdoe 0 Nov  3 11:40  ..
drwxr-xr-x  3 jdoe jdoe 0 Aug 15  2014 'Fran?ois Couperin'
# ls -il
ls: 'Fran?ois Couperin': No such file or directory
total 0
239210 drwxr-xr-x 3 jdoe jdoe 0 Aug 15  2014 'Fran?ois Couperin'
# find . -inum 239210 -exec rm -i {} \;
rm: cannot remove './Fran?ois Couperin': Is a directory
find: ‘./Fran?ois Couperin’: Not a directory

Note: I can cd into it. The below result is upon running ls -lah after cding into it.
Bash:
# cd Fran\?ois\ Couperin/
.../Music/Fran?ois Couperin# ls -lah
ls: cannot open directory '.': No such file or directory
 
Last edited:
Joined
Jul 26, 2019
Messages
418 (0.24/day)
Processor R5 5600X
Motherboard Asus TUF Gaming X570-Plus
Memory 32 GB 3600 MT/s CL16
Video Card(s) Sapphire Vega 64
Storage 2x 500 GB SSD, 2x 3 TB HDD
Case Phanteks P300A
Software Manjaro Linux, W10 if I have to
I suspect the torrent had an illegal character. Did you try using quotes around the name? What filesystem is it?
 
Joined
Aug 26, 2019
Messages
558 (0.33/day)
Filesystem is jfs.

François Couperin was a baroque composer. Origin was a CD rip as that was my only music medium in that era. If it matters, it was originally on a Fat32 partition on the external drive before I brought it over to my jfs NAS yesterday. (I regularly used 4 different OSes any given day at the time, hence the use of Fat32.) Edit: My music listening was done on a MBP though. I just now wondered if maybe OSX has better support for ç or some such, but in testing just now, I was able to touch and rm a ç named file without issue. Sadly I cannot check and see how well I can intereact with the original directory on the external HDD's Fat32 partition, as after copying everything over to the NAS, I zeroed it out.

Didn't try quotes as I was just using autocomplete via tabbing. Tried just now, to no avail. (Same result with "" as well.)

Bash:
# ls
'Fran?ois Couperin'
# rm -r 'Fran?ois Couperin'
rm: cannot remove 'Fran?ois Couperin': No such file or directory
# rm -r 'Fran\?ois\ Couperin/'
rm: cannot remove 'Fran\?ois\ Couperin/': No such file or directory
# rm -r 'Fran\?ois\ Couperin'
rm: cannot remove 'Fran\?ois\ Couperin': No such file or directory

P.s. As a side note, mv does not work either.
 
Last edited:
Joined
Jul 26, 2019
Messages
418 (0.24/day)
Processor R5 5600X
Motherboard Asus TUF Gaming X570-Plus
Memory 32 GB 3600 MT/s CL16
Video Card(s) Sapphire Vega 64
Storage 2x 500 GB SSD, 2x 3 TB HDD
Case Phanteks P300A
Software Manjaro Linux, W10 if I have to
Filesystem is jfs.

François Couperin was a baroque composer. Origin was a CD rip as that was my only music medium in that era. If it matters, it was originally on a Fat32 partition on the external drive before I brought it over to my jfs NAS yesterday. (I regularly used 4 different OSes any given day at the time, hence the use of Fat32.)

Didn't try quotes as I was just using autocomplete via tabbing. Tried just now, to no avail. (Same result with "" as well.)

Bash:
# ls
'Fran?ois Couperin'
# rm -r 'Fran?ois Couperin'
rm: cannot remove 'Fran?ois Couperin': No such file or directory
# rm -r 'Fran\?ois\ Couperin/'
rm: cannot remove 'Fran\?ois\ Couperin/': No such file or directory
# rm -r 'Fran\?ois\ Couperin'
rm: cannot remove 'Fran\?ois\ Couperin': No such file or directory
That's a tough one. Here are some tips that might work, like using a regular expression to catch the dir:

If those do not work and if you still have the original drive I would try fixing the name before copying over...
 
Joined
Aug 26, 2019
Messages
558 (0.33/day)
Good idea in trying a wildcard just in case. Still to no avail though.
Bash:
# rm F*
rm: cannot remove 'Fran?ois Couperin': Is a directory
# rm -r F*
rm: cannot remove 'Fran?ois Couperin': No such file or directory
# rm -rfi F*
rm: descend into directory 'Fran?ois Couperin'? y
rm: cannot remove 'Fran?ois Couperin': No such file or directory
Bash:
# find -maxdepth 1 -name F*
./Fran?ois Couperin
# find -maxdepth 1 -name F* -delete
find: cannot delete ‘./Fran?ois Couperin’: No such file or directory

What I find nutty is when I try to take the direct inode approach.
Bash:
# find . -inum 239210 -exec rm -i {} \;
rm: cannot remove './Fran?ois Couperin': Is a directory
find: ‘./Fran?ois Couperin’: Not a directory
 
Last edited:
Joined
Jul 26, 2019
Messages
418 (0.24/day)
Processor R5 5600X
Motherboard Asus TUF Gaming X570-Plus
Memory 32 GB 3600 MT/s CL16
Video Card(s) Sapphire Vega 64
Storage 2x 500 GB SSD, 2x 3 TB HDD
Case Phanteks P300A
Software Manjaro Linux, W10 if I have to
And did you try rmdir?
 
Joined
Aug 26, 2019
Messages
558 (0.33/day)
Just a quick update.

After some other ineffectual steps and running fsck -f on /dev/md0 i.e. the mdadm raid drive on the NAS, since I was connected into the NAS anyway, I tried to delete the now infamous Fran\?ois\ Couperin while logged into the NAS itself -- and it deleted successfully.

I went to the other problematic files (all same origin of MBP iTunes, saved to Fat32, copied to NAS), and successfully deleted those as well while logged into the NAS.

So all set, though I'm completely baffled as to why I could not delete them via my linux clients.
 

Easy Rhino

Linux Advocate
Staff member
Joined
Nov 13, 2006
Messages
15,436 (2.43/day)
Location
Mid-Atlantic
System Name Desktop
Processor i5 13600KF
Motherboard AsRock B760M Steel Legend Wifi
Cooling Noctua NH-U9S
Memory 4x 16 Gb Gskill S5 DDR5 @6000
Video Card(s) Gigabyte Gaming OC 6750 XT 12GB
Storage WD_BLACK 4TB SN850x
Display(s) Gigabye M32U
Case Corsair Carbide 400C
Audio Device(s) On Board
Power Supply EVGA Supernova 650 P2
Mouse MX Master 3s
Keyboard Logitech G915 Wireless Clicky
Software The Matrix
So all set, though I'm completely baffled as to why I could not delete them via my linux clients.

It depends on what shell environment you were using to execute the rm commands.
 
Joined
Aug 26, 2019
Messages
558 (0.33/day)
Bash, Gnome terminal in Ubuntu. Bash, Xfce terminal in Slackware.
 
Joined
Aug 26, 2019
Messages
558 (0.33/day)
Easy Rhino, is there something you'd recommend I'd try?
 
Top