• 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
118 (0.26/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
319 (0.65/day)
Processor R7 1700 non-X @ 4.0 GHz
Motherboard Gigabyte AORUS Gaming 5
Cooling Noctua
Memory 32 GB 3200 MT/s CL16
Video Card(s) Sapphire Vega 64
Storage 2x 500 GB SSD, 2x 3 TB HDD
Case Silverstone FT02
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
118 (0.26/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
319 (0.65/day)
Processor R7 1700 non-X @ 4.0 GHz
Motherboard Gigabyte AORUS Gaming 5
Cooling Noctua
Memory 32 GB 3200 MT/s CL16
Video Card(s) Sapphire Vega 64
Storage 2x 500 GB SSD, 2x 3 TB HDD
Case Silverstone FT02
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
118 (0.26/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
319 (0.65/day)
Processor R7 1700 non-X @ 4.0 GHz
Motherboard Gigabyte AORUS Gaming 5
Cooling Noctua
Memory 32 GB 3200 MT/s CL16
Video Card(s) Sapphire Vega 64
Storage 2x 500 GB SSD, 2x 3 TB HDD
Case Silverstone FT02
Software Manjaro Linux, W10 if I have to
And did you try rmdir?
 
Joined
Aug 26, 2019
Messages
118 (0.26/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
14,920 (2.91/day)
Location
Mid-Atlantic
System Name Desktop
Processor i5 7500 Kaby Lake
Motherboard AsRock MicroATX Z170M Extreme4
Cooling Stock
Memory 2x 16 Gb Gskill Ripjaws 2400
Video Card(s) AMD Radeon 5700
Storage Samsung 970 EVO 1 TB m.2 NVMe + Samsung 860 EVO 2 TB SATA3 SSD
Display(s) LG 34GK950F-B 34" 21:9 Ultragear WQHD Nano IPS Curved Gaming Monitor with Radeon FreeSync 2
Case Corsair Carbide 400C
Audio Device(s) On Board
Power Supply Seasonic SSR-650GD Flagship Prime Series 650W Gold
Mouse Logitech G900 Chaos Spectrum
Keyboard Corsair K63 Wireless
Software Windows 10
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
118 (0.26/day)
Bash, Gnome terminal in Ubuntu. Bash, Xfce terminal in Slackware.
 
Joined
Aug 26, 2019
Messages
118 (0.26/day)
Easy Rhino, is there something you'd recommend I'd try?
 
Top