Mount/share script for non-array drives


Recommended Posts

 

SO... I feel your pain, but you can probably put a few lines in your

/boot/config/smb-extra.conf file like these and see if your BSOD stop:

 

[global]

    security = USER

 

Joe L.

 

Thanks, I'll give this a try.  But will this affect unRAID (free version) shares?

It is a samba option.  It has nothing to do with unraid specifically.  I do not know if it will work in isolation, but that specific file, if it exists, is designed for you to add options for your samba configuration.

 

Google "samba configuration" for all kinds of options.  Some will work some will not.  If nothing else, try a different version of unRAID as I think the samba version was updated in the last version or so.  Are you on 4.5.3?

 

Joe L.

Link to comment
  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

 

SO... I feel your pain, but you can probably put a few lines in your

/boot/config/smb-extra.conf file like these and see if your BSOD stop:

 

[global]

    security = USER

 

Joe L.

 

Thanks, I'll give this a try.  But will this affect unRAID (free version) shares?

It is a samba option.  It has nothing to do with unraid specifically.  I do not know if it will work in isolation, but that specific file, if it exists, is designed for you to add options for your samba configuration.

 

Google "samba configuration" for all kinds of options.  Some will work some will not.  If nothing else, try a different version of unRAID as I think the samba version was updated in the last version or so.  Are you on 4.5.3?

 

Joe L.

 

Yes, I'm on 4.5.3.  With the bug being somewhat random and occasional it's difficult to just try things and get a sense of the outcome. 

 

I'm looking for a more determinate answer.  I know this sounds pushy but I'm not trying to be that way.  I understand it's a Win7 bug, but it's also an incompatibility with unRAID (free version at least).  I'd like to get a pretty strong opinion from someone here (you're the experts after all) how to avoid the problem either by a concrete "use the Plus or Pro" version or some code workaround that very likely is a fix.  And if unRAID free version is incompatible with Win7, then potential users should be warned in the Wiki such that they can't download the free version without having seeing the warning.  This doesn't just affect Win7.  It affects the reputation of unRAID.  All you need is for casual "unRAID causes Win7 to BSOD" to jump onto a few forums and it's really difficult to pull that back. 

 

And about the MS bashing.  In my opinion, half of ALL forum postings everywhere tend to be garbage snipings about linux, MS, Mac, etc that's all negative and don't provide any value and just serve to clog up threads.  Noone wants to dig though that stuff to find the valuable information.  One reason I was encouraged to try unRAID is the forum here isn't full of that crap and people here are very helpful.  Pet peeves are for the lounge.

Link to comment

Did you write down any of the information that was displayed on that blue screen?

Are you able to reproduce the problem?

 

 

I didn't write any of it down.  I'm not going to try to reproduce it

 

 

Unfortunately you jumped to take my comment out of context before I was finished with that posting.  Please re-read my posting.

Link to comment

Did you write down any of the information that was displayed on that blue screen?

Are you able to reproduce the problem?

 

 

I didn't write any of it down.  I'm not going to try to reproduce it without some planning.  BSOD's aren't good for the client machine and mine isn't some test machine that I don't care about.  It took two reboots for my client to boot normally again. 

 

At the time I was testing some mount and share commands for a script I was writing.

 

The conditions were

  1. I manually mounted a drive and added the mount point to my /boot/config/smb-extra.conf file. 

  2. Using explorer on Win7, I browsed the share - files/folders appeared as expected

  3. I manually removed the smb-extra  mv smb-extra.conf smb-extra.conf.save

  4. rebooted unRAID machine.

  5. Using explorer on Win7, I browsed the share again - just to be sure it was gone

  6  BSOD

 

So, just thinking about the possible combination of events it might be useful to test out these possible scenarios for the free version and the Plus version with security set to user.

 

Possible scenarios to test:

A. Maybe Win7 still had a memory of that share location.  Maybe if I had rebooted Win7 before step 5 the BSOD might not happen.

B. Maybe the same issue will arise if someone removes a share in unRAID that had been browsed in Win7 and then browse again in Win7.

C. Repeating my original steps with unRAID free version and Plus version with security set to user. 

 

Anybody feel like testing this with me?

Link to comment

Ok, I followed my steps 3 times and got 3 BSOD's.  I have attached a picture.

 

Amazingly here is a google search discussing this very stop code regarding Samba shares and the security = share.  

http://social.answers.microsoft.com/Forums/en-US/w7repair/thread/fac35fde-7e6e-4a75-b60b-82048ca0c78f

 

Since I don't have the Plus version I can't test if it actually will resolve this issue.  So, again, does anyone with the Plus or Pro version want to volunteer to test this?

crash2.jpg.bb81eb176affdaa65315a821141c0666.jpg

Link to comment

Ok, I followed my steps 3 times and got 3 BSOD's.  I have attached a picture.

 

Amazingly here is a google search discussing this very stop code regarding Samba shares and the security = share.  

http://social.answers.microsoft.com/Forums/en-US/w7repair/thread/fac35fde-7e6e-4a75-b60b-82048ca0c78f

 

Since I don't have the Plus version I can't test if it actually will resolve this issue.  So, again, does anyone with the Plus or Pro version want to volunteer to test this?

I can't try it, because I don't have windows-7.

 

But did you try creating the config/smb-extra.conf file and putting in it the line to change security to "user" as I described in this post: http://lime-technology.com/forum/index.php?topic=5695.msg53563#msg53563

 

You can then run the

testparm

command to verify it is recognized correctly.

 

 

Joe L.

Link to comment

I have both Win7 and an unRAID Pro license, but I'm hesitant to test this as I don't want to break my currently working system...

 

What would testing this involve?

 

Awesome.  Hang on a bit and I'll try to recap all the details.  I'm trying something Joe suggested first.

Link to comment

Ok, I followed my steps 3 times and got 3 BSOD's.  I have attached a picture.

 

Amazingly here is a google search discussing this very stop code regarding Samba shares and the security = share.  

http://social.answers.microsoft.com/Forums/en-US/w7repair/thread/fac35fde-7e6e-4a75-b60b-82048ca0c78f

 

Since I don't have the Plus version I can't test if it actually will resolve this issue.  So, again, does anyone with the Plus or Pro version want to volunteer to test this?

I can't try it, because I don't have windows-7.

 

But did you try creating the config/smb-extra.conf file and putting in it the line to change security to "user" as I described in this post: http://lime-technology.com/forum/index.php?topic=5695.msg53563#msg53563

 

You can then run the

testparm

command to verify it is recognized correctly.

 

 

Joe L.

 

I added the global setting to my smb-extra.conf file.

1. When I try to browse the the new share or my existing array shares it wants a user/password.  Where/how do I set that?  I'm using the free version.

 

 

 

root@Queeg:/boot/config# testparm

Load smb config files from /etc/samba/smb.conf

rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)

Processing section "[3LJ2TV1A]"

Processing section ""

Processing section "[disk1]"

Processing section "[disk2]"

Processing section "[backup]"

Processing section "[Cloister]"

Processing section "[Crashplan]"

Processing section "[Movies]"

Processing section "[Public]"

Processing section "[Queeg]"

Processing section "[scutter]"

Processing section "[Video]"

Processing section "[ftproot]"

Processing section "[lost+found]"

Loaded services file OK.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

 

[global]

       workgroup = RED_DWARF

       server string = Media server

       null passwords = Yes

       passdb backend = smbpasswd

       guest account = root

       syslog = 0

       syslog only = Yes

       unix extensions = No

       load printers = No

       printcap name = /dev/null

       disable spoolss = Yes

       show add printer wizard = No

       local master = No

       force user = root

       create mask = 0711

       directory mask = 0711

       guest only = Yes

       guest ok = Yes

       use sendfile = Yes

       map hidden = Yes

       map system = Yes

       msdfs root = Yes

 

[3LJ2TV1A]

       path = /mnt/disk/3LJ2TV1A

 

 

       path = /boot

       create mask = 0777

       directory mask = 0777

       map archive = No

       map hidden = No

       map system = No

       browseable = No

       browsable = No

 

[disk1]

       path = /mnt/disk1

       read only = No

       browseable = No

       browsable = No

 

[disk2]

       path = /mnt/disk2

       read only = No

       browseable = No

       browsable = No

 

[backup]

       path = /mnt/user/Backup

       read only = No

 

[Cloister]

       path = /mnt/user/Cloister

       read only = No

       browseable = No

       browsable = No

 

[Crashplan]

       path = /mnt/user/Crashplan

       read only = No

       browseable = No

       browsable = No

 

[Movies]

       path = /mnt/user/Movies

       read only = No

 

[Public]

       path = /mnt/user/Public

       read only = No

 

[Queeg]

       path = /mnt/user/Queeg

       read only = No

       browseable = No

       browsable = No

 

[scutter]

       path = /mnt/user/Scutter

       read only = No

       browseable = No

       browsable = No

 

[Video]

       path = /mnt/user/Video

       read only = No

       browseable = No

       browsable = No

 

[ftproot]

       path = /mnt/user/ftproot

       read only = No

       browseable = No

       browsable = No

 

[lost+found]

       path = /mnt/user/lost+found

       read only = No

Link to comment

I have both Win7 and an unRAID Pro license, but I'm hesitant to test this as I don't want to break my currently working system...

 

What would testing this involve?

 

The back story:

My original intentions were to write a script to automatically mount and share non-array drives at boot time.  I have some archive drives (mostly ntfs) that I will want to make available periodically.  Mostly I'll do that by plugging in a usb drive but for this particular drive I installed it in unRAID on the IDE port.  I don't want to convert those drives to reiser.  But when I plug one in, I'd like to be able to browse it on the same share every time (for sanity sake).  It would be easy to automatically make the share name from the drives serial number so that is my plan for now.  

 

Recreating the BSOD:

I manually run a short script I made that mounts my drive.  Then I add the samba share to the smb-extra.conf file (which doesn't exist prior to that).  I open file explorer on Win7 and browse the share - all is well.  I close the Win7 explorer window.  Then I simulate removing the drive by deleting the smb-extra.conf file and rebooting unRAID.  I open the explorer on Win7 again and enter the samba share - Win7 BSOD.

 

Why the Plus or Pro test is needed:

The reported BSOD is said to occur only when Samba security = SHARE.  The free version uses security=SHARE.  Plus and Pro can be configured to use security=USER.

 

The mounting script:

### Setting up the out-of-array disk

serialnumber="3LJ2TV1A"

partnum="1"

 

diskX="/dev/disk/by-id/*_$serialnumber"

partitionX="$diskX-part$partnum"

mountName=$serialnumber

 

# set its read-ahead to 1024...

blockdev --setra 1024 $diskX

# set its spin-down timer to 30 min of idle...

hdparm -S241 $diskX

# enable its IRQ unmasking (can improve performance)...

hdparm  -u1 $diskX

# create a mount point for it...

mkdir -p /mnt/disk/$mountName

# mount the partition ...

#mount $diskX /tmp/mnt/$serialnumber

mount -r -o umask=111,dmask=000 -t ntfs $partitionX /mnt/disk/$mountName 2>&1

 

### Done.

 

The smb-extra.conf entry:

 

[3LJ2TV1A]

 path = /mnt/disk/3LJ2TV1A

 read only = Yes

 

 

Link to comment

Hmm... Do you have open file explorer in separate process enabled? If not, it might help to keep the crash to only the new process and not the entire system. To enable it, navigate to the following location:

 

Windows Explorer, Alt - Tools, Folder Options, View tab, Advanced Settings, "Launch folder windows in a separate process" checked

 

Link to comment

Hmm... Do you have open file explorer in separate process enabled? If not, it might help to keep the crash to only the new process and not the entire system. To enable it, navigate to the following location:

 

Windows Explorer, Alt - Tools, Folder Options, View tab, Advanced Settings, "Launch folder windows in a separate process" checked

 

 

Not sure if I'm doing this correctly.  But in Win7 there is an explorer icon on the tray.  If  I click on it a menu pops up and Windows Explorer is one of them.  When I highlight that and choose properties then I see an Advanced button.  Clicking that I see two checkboxes.  One says Run as Administrator - unchecked.  The other is grayed out but says "Run in separate memory space" and is checked.

Link to comment

Ok, I followed my steps 3 times and got 3 BSOD's.  I have attached a picture.

 

Amazingly here is a google search discussing this very stop code regarding Samba shares and the security = share.  

http://social.answers.microsoft.com/Forums/en-US/w7repair/thread/fac35fde-7e6e-4a75-b60b-82048ca0c78f

 

Since I don't have the Plus version I can't test if it actually will resolve this issue.  So, again, does anyone with the Plus or Pro version want to volunteer to test this?

I can't try it, because I don't have windows-7.

 

But did you try creating the config/smb-extra.conf file and putting in it the line to change security to "user" as I described in this post: http://lime-technology.com/forum/index.php?topic=5695.msg53563#msg53563

 

You can then run the

testparm

command to verify it is recognized correctly.

 

 

Joe L.

 

I added the global setting to my smb-extra.conf file.

1. When I try to browse the the new share or my existing array shares it wants a user/password.  Where/how do I set that?  I'm using the free version.

 

 

 

root@Queeg:/boot/config# testparm

Load smb config files from /etc/samba/smb.conf

rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)

Processing section "[3LJ2TV1A]"

Processing section ""

Processing section "[disk1]"

Processing section "[disk2]"

Processing section "[backup]"

Processing section "[Cloister]"

Processing section "[Crashplan]"

Processing section "[Movies]"

Processing section "[Public]"

Processing section "[Queeg]"

Processing section "[scutter]"

Processing section "[Video]"

Processing section "[ftproot]"

Processing section "[lost+found]"

Loaded services file OK.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

 

[global]

       workgroup = RED_DWARF

       server string = Media server

       null passwords = Yes

       passdb backend = smbpasswd

       guest account = root

       syslog = 0

       syslog only = Yes

       unix extensions = No

       load printers = No

       printcap name = /dev/null

       disable spoolss = Yes

       show add printer wizard = No

       local master = No

       force user = root

       create mask = 0711

       directory mask = 0711

       guest only = Yes

       guest ok = Yes

       use sendfile = Yes

       map hidden = Yes

       map system = Yes

       msdfs root = Yes

 

[3LJ2TV1A]

       path = /mnt/disk/3LJ2TV1A

 

 

       path = /boot

       create mask = 0777

       directory mask = 0777

       map archive = No

       map hidden = No

       map system = No

       browseable = No

       browsable = No

 

[disk1]

       path = /mnt/disk1

       read only = No

       browseable = No

       browsable = No

 

[disk2]

       path = /mnt/disk2

       read only = No

       browseable = No

       browsable = No

 

[backup]

       path = /mnt/user/Backup

       read only = No

 

[Cloister]

       path = /mnt/user/Cloister

       read only = No

       browseable = No

       browsable = No

 

[Crashplan]

       path = /mnt/user/Crashplan

       read only = No

       browseable = No

       browsable = No

 

[Movies]

       path = /mnt/user/Movies

       read only = No

 

[Public]

       path = /mnt/user/Public

       read only = No

 

[Queeg]

       path = /mnt/user/Queeg

       read only = No

       browseable = No

       browsable = No

 

[scutter]

       path = /mnt/user/Scutter

       read only = No

       browseable = No

       browsable = No

 

[Video]

       path = /mnt/user/Video

       read only = No

       browseable = No

       browsable = No

 

[ftproot]

       path = /mnt/user/ftproot

       read only = No

       browseable = No

       browsable = No

 

[lost+found]

       path = /mnt/user/lost+found

       read only = No

I would try logging in as "guest"

 

 

Link to comment

Hmm... Do you have open file explorer in separate process enabled? If not, it might help to keep the crash to only the new process and not the entire system. To enable it, navigate to the following location:

 

Windows Explorer, Alt - Tools, Folder Options, View tab, Advanced Settings, "Launch folder windows in a separate process" checked

 

 

I set it as you indicated - still BSOD's the machine.

Link to comment

I believe I got the BSOD worked around thanks to Joe's suggestion with the smb-extra.conf global entry.  I read up on it and found a way to choose security = user but still have all the shares work like security = share, meaning public access with no login required to connect.  

And I got the whole process into a handful of shell scripts that will mount drives at boot time from a list by running them from the go script.  Ugh, learning curve hurts.

 

Currently, the scripts mount the drive by it's serial id which is a little obtuse.  I'd like to extend the scripts to add a friendly name for the share and also would like to either have the scripts auto-determine the filesystem if possible.  In any case, it's on it's way for now.

 

I'll attach my work here in case anyone wants it.

 

 

Edit: 3/22/2010 - updated the zip file with some changes, added a readme.txt with install instructions.

try1.0.zip

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.