[SOLVED] cache drive missing from Samba shares


Recommended Posts

I had an issue where I ran out of memory and I think unRAID killed Samba. I did a Samba stop and Samba start, and at some point attempted to use unMenu to stop the array.

 

After rebooting, the cache drive mounts, and I can still access is via telnet, all the files are present, but it appears empty over Samba.

 

Syslog attached.

 

Thanks in advance for your help,

 

Neil.

syslog-2011-04-09.txt

Link to comment

I had an issue where I ran out of memory and I think unRAID killed Samba. I did a Samba stop and Samba start, and at some point attempted to use unMenu to stop the array.

 

After rebooting, the cache drive mounts, and I can still access is via telnet, all the files are present, but it appears empty over Samba.

 

Syslog attached.

 

Thanks in advance for your help,

 

Neil.

You'll probably need to reboot to get it back showing as usual.
Link to comment

I had an issue where I ran out of memory and I think unRAID killed Samba. I did a Samba stop and Samba start, and at some point attempted to use unMenu to stop the array.

 

After rebooting, the cache drive mounts, and I can still access is via telnet, all the files are present, but it appears empty over Samba.

 

Syslog attached.

 

Thanks in advance for your help,

 

Neil.

You'll probably need to reboot to get it back showing as usual.

 

I've rebooted three times. I will try again.

Link to comment

You'll need:

find /mnt/cache -type f -exec chmod 644 {} \;

 

Unfortunately, that made no difference, even after rebooting.

 

This may display the problem better -- I can copy files from the cache drive to a drive in the array over telnet and open them fine over samba once they are on the other drive, but can't access them directly on the cache drive over samba:

 

2le2t14.jpg

 

I've also tried accessing them from 3 different Windows machines, in case it was a client issue -- it's not.

Link to comment

Post the output of

ls -l /mnt/cache/Backups/

 

root@MICRO:/mnt/cache# ls -l /mnt/cache/Backups/
total 178786
-rwxrwxrwx 1 root root 60327668 2011-03-21 18:37 Firefox\ 3.6.14\ (en-US                                                                                                                             )\ -\ 2011-03-21.pcv*
-rwxrwxrwx 1 root root 55216833 2011-03-29 18:34 Firefox\ 3.6.14\ (en-US                                                                                                                             )\ -\ 2011-03-21.rar*
-rwxrwxrwx 1 root root 67347021 2011-03-31 16:40 Firefox\ 4.0\ (en-US)\                                                                                                                              -\ 2011-03-31.pcv*

 

I'm guessing it's a problem with how samba is mounting the cache drive.

 

The cache drive is 320GB, so this is wrong:

 

2lmq5jc.jpg

Link to comment

root@MICRO:/mnt/cache# ls -l /mnt/cache/Backups/
total 178786
-rwxrwxrwx 1 root root 60327668 2011-03-21 18:37 Firefox\ 3.6.14\ (en-US                                                                                                                             )\ -\ 2011-03-21.pcv*
-rwxrwxrwx 1 root root 55216833 2011-03-29 18:34 Firefox\ 3.6.14\ (en-US                                                                                                                             )\ -\ 2011-03-21.rar*
-rwxrwxrwx 1 root root 67347021 2011-03-31 16:40 Firefox\ 4.0\ (en-US)\                                                                                                                              -\ 2011-03-31.pcv*

 

I'm guessing it's a problem with how samba is mounting the cache drive.

 

The cache drive is 320GB, so this is wrong:

 

2lmq5jc.jpg

 

Yep it's the way Samba is mapping the file permissions to Windows file attributes (I really need to write a wiki article on this!).  Background on what is happening is available here.

 

Note the below commands will reset the permissions for ALL files and directories on your cache drive.  If that is not acceptable (ie some directories/files need different permissions) you need to know that before running those commands as there is no undo and modify the commands as appropriate...

 

To fix current files:

for files:

find /mnt/cache/ -type f -exec chmod 700 {} +

for dirs:

find /mnt/cache/ -type d -exec chmod 711 {} +

 

I'm not sure what caused the file permissions to get changed on your drive, this usually crops up when mounting a drive via CIFS/SMB on the unRaid server and copying files over.  Anyway once you run those commands above the file permissions should look like

-rwx------

and similar for directories.

 

Windows can't get network drive sizes right to save its life.  MS should just give up on showing the number considering it is wrong 99.9999999% of the time :P

Link to comment

Post the output of

testparm -s

 

If the permissions changed when you ran the find commands, samba should be exposing the files, if the permissions didn't change you got other problems.

 

Official support is via email, Limetech monitors the boards some but it you want official support you have to request it.

Link to comment

Post the output of

testparm -s

 

If the permissions changed when you ran the find commands, samba should be exposing the files, if the permissions didn't change you got other problems.

 

Official support is via email, Limetech monitors the boards some but it you want official support you have to request it.

 

I checked the permissions afterwards, they did change, but cache is still appearing empty.

 

I know most of the people helping out here are unpaid unRAID users, but someone from Limetech should come here occasionally to provide support when those users are stumped. This is not an unofficial forum, it's hosted on the lime-technology.com domain.

testparm.txt

Link to comment

Map hidden and map system are both enabled so having the file perms set to 777 would definitely cause the files on the cache share to be exposed as hidden files to a windows box.  Try mounting the cache/Backups share as a drive on the windows box

net use x: \\MICRO\cache\Backups

then get the attributes of some of the files

attrib Firefox*

and post the result.  I'm guessing your going to see something like

A  SH        Z:\newfile.txt

showing the hidden and system flags set.  You shouldn't need to restart samba for the permissions to change but you do need to refresh your view (F5) if you had the share open in an explorer window.

Link to comment


X:\>net use y: \\MICRO\cache\Backups
System error 55 has occurred.

The specified network resource or device is no longer available.


X:\>net use y: \\MICRO\cache
The command completed successfully.


X:\>dir y:
Volume in drive Y is cache
Volume Serial Number is 0453-043D

Directory of Y:\

07/04/2011  09:12    <DIR>          .
10/04/2011  08:06    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  439,262,756,864 bytes free

 

 

Link to comment

You got me.  Even with the smbd process being terminated abnormally, the config shouldn't have gotten jacked and since you've removed the world execute bit there's no reason for samba to mark the files as hidden.  Hopefully someone else has another idea.  I am curious to know what the problem ends up being...

Link to comment

Your server is having trouble with the share config files

 

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Backup cache drive_files.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Buffalo.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Cyrus (2010) Blu-ray.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Keith Richards - Life part1.mp3.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Movies (DVD).cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Movies (HD DVD).cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Movies (HD).cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Music (Blu-ray).cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Music (DVD).cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Music (HD).cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/P.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/P-new.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Popcorn Hour.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Recycled.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/TV.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/TV (DVD).cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/Transmission.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/True Grit (1969) Blu-ray.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/cache.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/iTunes Backup.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/removed from Unstoppable.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/sabnzbd before 6.cfg: No such file or directory - assigning defaults

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/share.cfg: No such file or directory - assigning defaults

 

Did you create a cache.cfg file yourself?

 

Do you have a user share, ie a top level directory on any data disk, that is called cache?

 

You're also doing things like storing "True Grit (1969) Blu-ray" in the top level of a disk which creates a user share.

 

Peter

 

Link to comment

Your server is having trouble with the share config files

 

Apr  9 19:48:20 MICRO emhttp: get_config_idx: fopen /boot/config/shares/cache.cfg: No such file or directory - assigning defaults

 

Did you create a cache.cfg file yourself?

 

Do you have a user share, ie a top level directory on any data disk, that is called cache?

 

You're also doing things like storing "True Grit (1969) Blu-ray" in the top level of a disk which creates a user share.

 

Peter

 

That was it! Well done. There was a folder on the cache drive called "cache". I deleted it and stopped and started the array and all is well. Thanks!

 

There are a load of user shares that are created because they are on the cache drive. Is there a way of excluding the cache drive from user shares? I couldn't see anything in the settings.

 

Link to comment

There are a load of user shares that are created because they are on the cache drive. Is there a way of excluding the cache drive from user shares?

No, in fact, its primary role in life is to merge its contents, including new top level folders as new user-shares.

About all you can do is set each of those "new" user shares as not exported, or hidden on the user-shares page.

 

Joe L.

Link to comment

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.