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.

*SOLVED* can't create file - unraid 6.11.5

Featured Replies

Hello, I have a curious problem with my array.

Windows was giving a very odd "directory is invalid" error when trying to write to a specific folder in the array.

I worked backwards, and found the same problem exists inside the Unraid terminal, through /mnt/user.

 

touch 1.txt

gives the error:

touch: cannot touch '1.txt': Not a directory

 

The filename really doesn't matter.  All writes to this folder fail with this error.  Including subfolders of this folder (at least those I've tested).

 

However, the above works just fine if I access the drive directly /mnt/disk2 (which is the only disk this folder exists on).  touch creates the file, and I can rm it just fine.

 

I followed the xfs_repair instructions with the array in maintenance mode, on all the drives in the array.  None seemed to give any errors, and I did not end up with a lost+found folder.

 

Since I narrowed the apparent problem down to disk2, I ran xfs_repair -L as well on it, and it didn't seem to indicate any error, but the problem still exists.

 

There are NO errors showing in the unraid log.  Bouncing the server did not change anything.

 

Short SMART is not showing any errors.

 

I'm going to run extended SMART here soon.

 

I'm puzzled why I can write to the folder through /mnt/disk2, but not through /mnt/user.  Implies something is wrong with a mapping somewhere?

 

I'm now at a loss as to how to fix this problem. 

 

Help! :)

Thanks.

Edited by CGR21

Solved by CGR21

  • Community Expert

Attach diagnostics to your NEXT post in this thread.

 

Also, what do you get from command line with this?

ls -lah /mnt

 

  • Author

Here are the diagnostics.  Thanks for the clue to include it! :)

 

ls -lah /mnt shows:

 

total 0
drwxr-xr-x 11 root   root  220 Jan  9 16:51 ./
drwxr-xr-x 21 root   root  440 Jan  9 17:42 ../
drwxrwxrwx 11 nobody users 186 Jun  5  2022 disk1/
drwxrwxrwx  9 nobody users 119 Sep 20  2020 disk10/
drwxrwxrwx  8 nobody users 132 Jul 21  2020 disk2/
drwxrwxrwx  9 nobody users 148 Jul 22  2020 disk3/
drwxrwxrwx  7 nobody users  93 Jul 23  2020 disk4/
drwxrwxrwx  8 nobody users 132 Jul 27  2020 disk5/
drwxrwxrwx  8 nobody users 133 Sep 20  2020 disk6/
drwxrwxrwx  1 nobody users 186 Jun  5  2022 user/
drwxrwxrwx  1 nobody users 186 Jun  5  2022 user0/

 

 

Edited by CGR21
removed diagnostics

  • Community Expert

I'm not entirely sure I understand what you are saying. Do you mean there is a specific user share you can't write to?

 

What do you get from command line with this?

ls -lah /mnt/user

 

  • Author

Extended SMART test on the drive completed without errors.

 

Yes, I'm unable to write to one specific folder, and all folders under that folder, when writing to it through the array's mapping.

 

root@NAS:/mnt/user/HeartsCenter/HeartsCenter/3-Week-Full-Sync/Sanctuary Video/2015# touch somefile
touch: cannot touch 'somefile': Not a directory
root@NAS:/mnt/user/HeartsCenter/HeartsCenter/3-Week-Full-Sync/Sanctuary Video/2015# 

 

'touch' demonstrates it.  What does "Not a directory" mean, and what is causing it?

 

This folder only exists on drive #2.  I can only CD to it on drive 2.  The below is disk1:

 

root@NAS:/mnt/user/HeartsCenter/HeartsCenter/3-Week-Full-Sync/Sanctuary Video/2015# cd /mnt/disk1/HeartsCenter/HeartsCenter/3-Week-Full-Sync/"Sanctuary Video"/2015
bash: cd: /mnt/disk1/HeartsCenter/HeartsCenter/3-Week-Full-Sync/Sanctuary Video/2015: No such file or directory
root@NAS:/mnt/user/HeartsCenter/HeartsCenter/3-Week-Full-Sync/Sanctuary Video/2015# 

 

Here is disk #2:

 

root@NAS:/mnt/disk2/HeartsCenter/HeartsCenter/3-Week-Full-Sync/Sanctuary Video/2015# cd /mnt/disk2/HeartsCenter/HeartsCenter/3-Week-Full-Sync/"Sanctuary Video"/2015
root@NAS:/mnt/disk2/HeartsCenter/HeartsCenter/3-Week-Full-Sync/Sanctuary Video/2015# 

 

From within there, I can write files just fine with no errors.

 

root@NAS:/mnt/disk2/HeartsCenter/HeartsCenter/3-Week-Full-Sync/Sanctuary Video/2015# touch somefile
root@NAS:/mnt/disk2/HeartsCenter/HeartsCenter/3-Week-Full-Sync/Sanctuary Video/2015# rm somefile

 

I can not write to it through /mnt/user (or /mnt/user0, whatever that is), but I can write to it directly through /mnt/disk2.

 

This problem did not always exist, as the data in this folder was originally written to it through /mnt/user.

 

Thanks.

  • Author

Note: I do NOT use a cache drive.

  • Community Expert

What are permissions and owner on that specific disk2 folder?

  • Community Expert

Have you tried Tools - New Permissions on that user share?

  • Author

The share this folder belongs to is very high in the directory structure: /mnt/user/HeartsCenter.  I can write to other folders, even ../2014, without a problem.

 

I'm trying the New Permissions trick on the share.  It will take a while, as there are many many terrabytes of data there. 

 

I don't think I was using Unraid at version 5, but it shouldn't hurt?

 

Thanks.

  • Community Expert
1 minute ago, CGR21 said:

it shouldn't hurt?

Just don't run it on the appdata share.

  • Author
Just now, trurl said:

Just don't run it on the appdata share.

 

Noted.  I'm only running it on one share, which is arguably the largest.

 

I have also seen random "permission denied" errors through smb in windows, that seem to work the next time I try it.  Never something I can reproduce.

 

I have to wonder if there's an underlying bug in here somewhere.

  • Author

Okay, that ran faster than I thought it would.  7 minutes later it finished.

Still getting 'Not a directory'.

I'm going to move the data from that folder directly from /mnt/disk2 to another /mnt/disk and see if the problem disappears with the folder being removed from the drive.

  • Author

The folder only exists on disk3 now.

The problem moved along with the directory from disk2 to disk3.  I guess that rules out a disk issue.

I'm going to copy it now to disk6, then remove it from disk3, and hope the problem doesn't "copy", only "moves".

 

  • Author
  • Solution

Problem found and fixed!

Somehow a FILE called 2015 existed on disk6 in the same place a FOLDER called 2015 existed on disk3.

Hence "not a directory", although I could CD to the folder.

Thanks for your help.

  • Community Expert

I think disk3 has precedence over disk6 as far as user shares are concerned. Not clear what all the implications of that are though. You would think it shouldn't matter when one is a file and the other is a folder. Normally, you can create a file in a folder, and also create a subfolder there with the same name as that file.

  • Author

In a normal file system, you can not have a folder and a file with the same name in the same location?

root@NAS:/mnt/user/Temp# touch folder
root@NAS:/mnt/user/Temp# ls
folder
root@NAS:/mnt/user/Temp# mkdir folder
mkdir: cannot create directory ‘folder’: File exists
root@NAS:/mnt/user/Temp# 

Clearly it's possible in an unraid type setup if you are accessing the disks directly through /mnt/disk, but I'm not sure why you'd want to, as it clearly confuses the mapper!

I rarely access drives directly; if so it's to move an entire folder structure from one drive to another.  I'm very puzzled as to how this file got created on disk6.

  • Community Expert
5 minutes ago, CGR21 said:

In a normal file system, you can not have a folder and a file with the same name in the same location?

I guess not. I just tried it in Windows in my laptop's Downloads folder and it wouldn't let me.

  • CGR21 changed the title to *SOLVED* can't create file - unraid 6.11.5

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.