Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Unable to delete a folder because "Invalid or incomplete multibyte or wide character"

Featured Replies

I have a folder on my Unraid server for the movie 8 1/2. Except I it's seemed to be named something strange because whenever I do anything to modify that folder through the terminal I get the error "Invalid or incomplete multibyte or wide character".

 

How can I delete this folder and all the contents?

 

image.png.49255f17e621534bbe1c38104f2535a0.png

Solved by bmartino1

  • Community Expert
  • Solution

This issue occurs because the folder name contains invalid or non-UTF-8 characters, which the Linux terminal cannot interpret correctly. Here's how you can safely delete the folder and its contents:

 

Steps to Delete the Folder

1. Use the ls Command with Escape Characters

Run the ls -b command to display non-printable characters in the folder name:

 

ls -b /mnt/user/Movies/

 

This will reveal the exact folder name, replacing invalid characters with escape sequences (e.g., \275).

 

2. Use the Inode Number

Every file and folder has a unique inode number. You can delete the folder by referencing its inode.

Find the inode number:

ls -li /mnt/user/Movies/

 

This will display a list with inode numbers. Look for the inode of the problematic folder.

Delete the folder using the inode:

find /mnt/user/Movies/ -inum <inode_number> -exec rm -rf {} +

Replace <inode_number> with the actual inode number of the folder.

 

3. Use Wildcards Carefully

If the folder name starts with "8" or another unique prefix, you can try using a wildcard:

rm -rf /mnt/user/Movies/8*

*However, this method should be used with caution to avoid accidentally deleting other folders.

 

4. Use rmdir with Tab Completion

Sometimes, the rmdir command works better for problematic folders:

Type rmdir /mnt/user/Movies/8 and press Tab to let the shell auto-complete the name.

If the folder is empty, it will be deleted. If it has contents, you'll need to use rm -rf as described above.

5.My Recomendation...use mc
IF mc/rm didn't work stop the array:
 

6. Verify Filesystem Integrity
If none of the above works, there could be a corruption issue. Run a filesystem check on the disk containing the folder:

Stop the array in Unraid.
Go to Main > Devices and select the disk containing the folder.
Run a filesystem check/repair (e.g., XFS repair).

  • Author

This file is really stubborn. Or I'm really stupid.

First I tried solution 3, wildcards:

rm -rf 8*

deleted anything that started with an 8 and didn't give that same error but that file still seems to be there.

 

Second I tried solution 2, using the Inode Number:

But 

-li | less

shows the file has no lnode number:
image.png.bf7715522e05b940a2ce783b82233b24.png


Next option 4, rmdir with tab completion;
Typing

rmdir 8 + tab

does not auto complete anything. It's like the file isn't there at all.

Option 1 I also tried but the escape commands as shown by

ls -b 8*

make it seem like the file doesn't exist.
image.png.c8ff1ef2a506e3eb3acb7ac275c56792.png

 

 

 

Your 5th recomendation (use mc)

 would that be midnight commander? I've tried to delete it with FileZilla which seems to be somewhat similar. But this method shows the file isn't there at all:
image.png.ce2bc8e05ddb2d34c1de594875774221.png


Since none of those worked I went to do a Filesystem Integrity check but the file doesn't seem to be on the share at all. Browsing the index through the Unraid GUI shows the file not there:
image.png.0ec376a33968e261b7b690df34d153bb.png


Any other suggestions or idea what I'm doing wrong?

  • Community Expert

Try checking filesystem on all disks, if they are xfs run it without -n

  • Author

Checking and repairing each disk seems to have done the trick.

 

Thank you so much!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.