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.

SMB on Windows and different usernames (followed by a rookie's random questions)

Featured Replies

A sharing of some knowledge to get rid of my Noob status. (And then I go off on a tangent with some daft rookie questions...)


Edited to note: I am re-writing this post a bit to add other gems of Samba wisdom. I'm a Windows networking guru... so lets solve some old puzzles in Unraid.

@Frank1940 this one is for your Samba FAQ

I see people complaining that they don't like how they can only login with one username using SMB from their windows box.

Complain no more as there is an easy trick. Just give your server multiple names. Now you can login with different users.

Yeah, we all know the trick that you can login wih server name or IP address.

\\unserver\share

\\192.168.1.13\share

These are treated as different users, so you can login with different accounts.

But some of you like using names. There is a simple hack for that.

On your Windows box, open the file c:\windows\system32\drivers\etc\hosts and add a few lines.

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost
192.168.1.13		unserver
192.168.1.13		different
192.168.1.13		banana
192.168.1.13		ostrich

Yeah, you need to save this file with admin rights, blah blah, toggle the read-only flag. If you don't know how to do that then don't mess with system files 😁

And no, you don't even need to restart either computer for this to work.

To use the above, just open File Explorer and type in \\different\ and login with some valid credentials. Or map a network drive if you still live in the world of Win95.

What I have done in the above example is tell the Windows PC where to find four different computers called unserver, different, banana and ostrich. And to Windows this means they are four different computers. So you can store four different sets of credentials.

Obviously change the IP address to suit your server. Above assumes your server is on 192.168.1.13

Waffle below...

Personally I like to have my file server as a read-only server on my network. Don't like accidentally deleting stuff. Or being held ransom by a ransom virus encrypting things. So I login with a "read only" user most of the time.

Then some days I want to suddenly login as a user with write access, but can't be bothered to restart my windows box to do that. This is where the above trick comes into play. Especially as you can edit that hosts file at any time and add more names.

Edited to add another solution to an old puzzle...

Unraid is weird. I learnt something new today.

All my Windows PCs in this house use different user names. In the Windows to Windows world if Fred tried to click on \\Win7Server\ from the network neighbourhood, the Windows PC would throw up a login window as Fred was unknown to the Win7 box. I could then login with Known Credentials for the Win7 box. Even though Fred knocked at the door, I could login as Charlie with Charlie's WIn7 password.

Try that with Unraid and you just plain get Rejected. You can see the Unraid server in network neighbourhood, but you'd be rejected.

To fix. Go to Unraid, give Fred an account but NO rights to anything. Just an account. Just let Unraid know that Fred is legit.

Now go back to your Win10 machine and attempt to connect. NOW you will get acknowledged by the Unraid box and it asks you for credentials. Now you can login as a known user, but not need to be Fred. You can login as Charlie now.

Notice I did not restart ANYTHING here. Just added the Fred account on Unraid, then stepped back to the Win10 box and tried again.

Now here is an odd thing. If you now tick the box on the Windows box to Remember the username and password you connect to Unraid with (Charlie) you can go onto Unraid and delete fred. Now you have taught the Windows box to approach Unraid as Charlie with known good credentials it will be forever happy.

TODO: I will turn this into a better FAQ at some point... I have knowledge and solutions to share...

Edit: Forgive me for piling off tangent with a heap of random rookie questions later in this thread... we all have to learn somewhere...

Edited by Batter Pudding

Very interesting. I can see how this approach works. I do have couple of questions. Can you set up different credentials for each server name (unserver, different, etc.) in credential manager and have credential manager handle the login when you decide to use a different name? And, if you are using it for elevation of privileges, how do you turn it off (or logoff) when you are done?

1 hour ago, Batter Pudding said:

Personally I like to have my file server as a read-only server on my network. Don't like accidentally deleting stuff. Or being held ransom by a ransom virus encrypting things. So I login with a "read only" user most of the time.

Then some days I want to suddenly login as a user with write access, but can't be bothered to restart my windows box to do that. This is where the above trick comes into play. Especially as you can edit that hosts file at any time and add more names.

I use this practice also. But I get write permission by going to my Unraid server and changing the permission for my Share Access user to read-write for the session when I am working on the file system. When I am done, I change it back to read-only. (I have Share Access Login name that I use only for my PC. A super SMB user account in its own way. All the other PC's on the network use a second Share Access user login name that has read-only privileges. The other advantage to my scheme is that I only have to change the particular Share that I need to work on to have read-write access. All the other shares are still read only.)

  • Author

I wanted to be able to flip between users. So experimented with an idea that worked for me. Triggered by half reading your new SMB post.

As a test, I just added it to the hosts file and tried to login. Didn't bother with Credential Manager. Though no doubt if I ticked the box to remember the details it would have done so. To Windows it is a different SMB machine.

The idea was to forget credentials when logging out of the PC. Though I'll also just look for a "drop connection" option too as that can be rigged to a desktop script if I put my mind to it.

I'm just messing around with options on this new server build trying to find a way to make it as flexible as the old Windows box was. I'm want to avoid having to keep logging into UNRAID to change folder rights. Looking for minimal options to reproduce the more flexible abilities of MS SMB. Not being able to make a share to a sub folder has borken part of my work flow that I am looking for simple answers to, whilst doing other experiments along the way.

I have stupidly confusing needs. I want a "standard" read-only user for all round the house for media access (music films) but I need my main login on my desktop to have write access to some work folders every day, but other folders "on demand". Just a mad overlapping of oddities as that is how my head works.

My aim is a "normal" user on my PC who stays logged in, details in credential manager. And then an alternate user who logs into a "different" server who gets full write access, but credentials don't get stored. So I can logout from them once I have finished the task. When I rip a new CD I want to add it to the server, but don't want permanent write access to the whole of the Music folders.

On my old setup I could give myself write rights to a folder slap in the middle of my media server file tree. This I now cannot do unless hacking around with LNKs. I also don't want to move folders around as I have had enough of hacking SQL databases today to update the paths for KODI as it is.😁

I'm just rearranging things to fit Unraid's rules, whilst using the excuse to improve things..

I'm replacing a server so old it is running an ABit motherboard with a Core 2 Quad CPU in it... and when was the last time you heard of ABit? Thought it was about time to retire the 20 year old Win7 box I was using as a media server. 😂 (Obviously none of the hard drives are that old)

  • Author

Okay.... that didn't take long. There is likely a neater answer, but I can dump the temp connection by just restarting the workstation service from a command prompt. Quicker than rebooting the PC, but same effect on the network. If I dropped that into a script I kill all the SMB connections.

net stop workstation
net start workstation

Quick experiments also seem to not have disrupted anything else I was doing. Left other explorer windows open to different servers (with cached credentials) and editing docs. Just forgotten the connection I had not ticked the box to remember. (Will test more later...)

Edited by Batter Pudding

  • Author
17 hours ago, Frank1940 said:

I didn't follow this through as it didn't quite fit. I also didn't quite trust the access rights thing. So went for a simpler option more fitting to Unraid's share rules.

One of the reasons I had "shares of sub-folders" is how I had KODI setup. I had been trying to maintain old paths with minimal change. Something that I had to abandon once I learnt no !! in share names. I have now simplified that setup by using less shares and longer UNC paths for KODI. Lots of search/replace editing of the SQL databases needed, but now things are running okay. Just have three audio, tv and film shares and KODI can work within that. Sources used to have a SMB share each, now instead they are just using longer UNC paths.

On my main PC the "sub-folder" share I used to use is much better handled now by using two different user SMB accounts to the same server. I liked to "drop in" newly ripped CDs directly into a single folder. This works so much better with my "different" server/user hack and just restarting the Workstation service. Wish I had found that before, it is such a simple trick. As they say "Necessity is the mother of invention"

  • Author

LOL!! Doing some housekeeping today. Shuffling stuff from 20 year old server to my PC. From old server to new unraid server. And from my PC to the new Unraid. All via SMB. Connecting to the new server using two separate names at the same time as I swap between my read only and write access users. And DAMN is this thing fast.

I don't think I had realised how old and junk the old machine had got. Watching stuff move at KB/s transfer rates... and then on Unraid watching 120MB/s transfers. 😁

Best the old box wants to do today is 11MB/s. Data is moving literallly ten times as fast across my network now. Likely a lot to do with the upgraded disk controllers.

And this is direct to array - no fancy Cache drive in place yet (cos ain't worked out how to get that to work as Manual is clearly out of date for v7)

13 minutes ago, Batter Pudding said:

And this is direct to array - no fancy Cache drive in place yet (cos ain't worked out how to get that to work as Manual is clearly out of date for v7)

Start here:

https://forums.unraid.net/topic/146155-confused-with-primary-and-secondary-storage/

And this screenshot may help. I have not used cache pools and I have only a single cache drive so there are only two choices for Mover action: As I understand it, there are more options if you have more pools.

image.png

My Unraid setups are still mostly NAS oriented. I use ony one working Docker container at this point-- mysql for the centralized KODI database.

Hope this helps some.

  • Author
12 minutes ago, Frank1940 said:

Hope this helps some.

I can't even get to that point. Can't see how to assign the M2 drive as a cache drive. Assume I'd stop the array, and then assign it like I would a Partiy or Array drive. Nope, nothing.

Try and make sense of the help file: https://docs.unraid.net/legacy/FAQ/cache-disk/ and can't find the "Disks" page

On the "Main" page where I handle all the other devices there is no hint.

I see it listed as an Unassigned Disk Device... but no way to elevate it to being the cache.

I also see the Share page with errors about a missing cache. (I assume a default warning) If I try and locate the page you show I cannot select "Cache" in 1,2,3

I know I am missing something dumb simple here.

My other Unraid box is only backup running urBackup, so never setup a cache there.

Though my copying today I wonder if I even need to bother with a Cache drive. That was copying 10 times faster than my old server direct to the array. 😁

19 minutes ago, Frank1940 said:

My Unraid setups are still mostly NAS oriented. I use ony one working Docker container at this point-- mysql for the centralized KODI database.

This is also my target. Number one job here is a NAS for music\film\tv storage for KODI. Old system was just files on a Win7 box accessed from separate Devices via SMB.

Have almost completed that migration and will soon be able to shutdown\scrap the old box permantly.

Task I will do soon is setup MySQL on this new server and attempt to import my old database. Main KODI is just a default Windows install, but I am pretty comfy with using DB Browser for SQLite. So think it i probably time for a full SQL server database.

Google is my goto option when look for something about Unraid. This is an example of what their new AI search does:

image.png

The box on the right contains links from the 'arrowed' link symbol. I am not real sure what the defaults are on a new install of Unraid regarding pool vs cache. IF 'cache' is not showing up, you may have to add it by clicking on 'Add pool' and so naming it. Search terms are important with Google:

image.png

  • Author

Still hitting the language barrier. Is the Cache added as a "New pool"?

That "AI" is also describing something that does not exist. It looks like it is cloned from the normal manual as it says "go the Disks tab". That is lifted from the standard help page and I still can't work out where my DIsks Tab is. 🙂

The second screen shot is talking about BTRFS, ZFS and multi-device pools. Not something I thought I was dealing with here

image.png

My stopped array. Under Unassigned Devices I have "Dev1" which I am due to add as a Parity drive once I have a day to spare to do the parity calcs. That's easy.

And Dev2 is the M2 ready to add as a Cache drive.

Do I hit "Add Pool"? I thought I was adding the Cache to the current array?

Edited by Batter Pudding

  • Author

I assume part of my problem is I read all the docs for version 6, and I think something has now changed for version 7.

As I remember, A 'Cache' drive is considered in the 'new' setup to be a 'Pool'. I think when you name the pool, you can call it 'Cache' and assign only one device to it. (If you assign two devices, you can have a parity protected 'Pool' but you are restricted as to the formatting options.) Let me ping @JorgeB as he is a real expert on pools.

Edited by Frank1940

  • Author

🤣All this talk of "pools" is making me nervous. Especially around electrical kit.

I am getting more confident now I just need to press that "Add Pool" button and busk from there... I assume the array would then know what to do with it.

I'm gonna hit the button and let you know if anything explodes.

  • Author

Well, it ain't obvious but clicking "Add Pool" offers to name the pool "Cache"

image.png

So I added it there:

image.png

Looks like I now have a Cache... but still never found the "Disks" Tab. Instructions need an update I think.

Array restarted, Cache formatted, now gotta work out how to tie it in correctly. But that just needs some reading.

Far more importanly I got rid of that Noob tag for the forum.

Edited by Batter Pudding

Caching is set at the User Share level, not the disks level. It is set up when you set a pool as primary storage and the array (or another pool with v7) ans secondary storage annd mover direction ans pool->array), and the pool names are irrelevant when doing this.

The term ‘cache disk’ probably reveres to the fact the default name for the first pool created is ‘cache’. However this is historical and there is no requirement for any pool to have that name.

  • Author

I was just getting lost here: https://docs.unraid.net/legacy/FAQ/cache-disk/ as it was talking of a Disks Tab.

I thought the Cache was part of the Array. Likely an old memory when I half read about it years ago when setting up my first Unraid.

Now I understanding the idea of how this is separate to the Array as there can potentially be multiple arrays in v7.

Literally creating the thing was where my confusion mostly lay.

Got it now.

If upload a lot of data that you overflow the cache, Don't assign cache as primary (1) until the array has its initial load.

image.png

Then make Array secondary. (2) And set up mover to move future data from cache to array. (3)

4 hours ago, Batter Pudding said:

Though my copying today I wonder if I even need to bother with a Cache drive. That was copying 10 times faster than my old server direct to the array. 😁

As soon as you assign a parity drive that will drop in about half! You can recover a good part of the by changing the following setting to 'Reconstruct write'. This will spin up all drives during 'wriite' operations. (it is trade-off, speed vs power saving issue..)

image.png

  • Author

I moved the main bulk of the data in by mounting the NTFS disks in the Unraid box and direct copied. Without Parity or Cache in place yet. And likely to keep the shares without Cache as this is mainly going to be a read-only music server.

Parity will be introduced once all the files in place, and then I'll let that rebuild itself as I know the maths will take a while..

Cache is more for the other stuff I'll start playing with at a later date. This box is over powered \ over spec'd as I am going to play with a few other features alongside the NAS. But first I just wanted to get the NAS settled into place.

  • Author

Even when the Parity "halves the transfer speed" I am still a long way up on my old system.

A cache question. If the cache is in play, and the UPS spots a power outage, how long does the flush take for "Mover" to move the cache data to the array? And can the Shutdown procedure make this happen?

I have a UPS that is around 40mins. So I'd want to make sure the cache was flushed in case of shutdown.

1 hour ago, Batter Pudding said:

A cache question. If the cache is in play, and the UPS spots a power outage, how long does the flush take for "Mover" to move the cache data to the array? And can the Shutdown procedure make this happen?

I have a UPS that is around 40mins. So I'd want to make sure the cache was flushed in case of shutdown.

Mover speeds can never exceed what copy straight to the array can achieve. Cache is intended to speed up writes from the client to the Unraid server. (Moving large numbers of small files directly to the array can slow to single digit speeds at times due to the File overhead cause by Unraid's Share handling software.) Mover by default runs in the middle of the night to move files from the cache to the array when most folks are not using the server. (That is what is considered to the normal setup!) IF you need a protection for cached files, then you should be looking at a multi-disk pool with parity protection. (That was partially the reason why pools were added. BTW, most folks are looking for the opposite of what you are. They want active files in the pool and the dormant files moved to secondary storage (array). That feature is not currently available...)

  • Author

I was getting confused. I thought the cache was totally volatile to a shutdown. So did an experiment and happy now that data is still there after a power cycle. I guess I was getting confused with the "if the cache drive fails the files are lost" issue. Which is hopefully a rare case.

The big feature I enjoy of Unraid is how loosing one drive can be recovered just by adding one new drive back in. Parity is nice. I am not worried about speed, I am concerned about safety of data. To me a speed boost of the cache feels like a potential weak spot for storage so am carefully considering which SMB shares will use it.

Thanks for answering these daft questions. I try and find answers in the forums, but sometimes those threads are hundreds of pages long and forget to mention the "obvious" stuff.

  • Author

Argh! Now stuffed something up and possibly naffed a disk. Is there a chkdsk /f equivalient?

Or do I give up now and just rebuild from the source...

(Sod's law parity is not yet in place of course... heat had delayed me from running that yet)

Okay.. found checkdisk... lets see what happens

Edited by Batter Pudding

  • Author

Thanks. That is what I needed (and found it about sixty seconds before your link posted). Good this happened now in the early days as I know how to recover now.

All is good to go again. Back up and running. It ran a check, zeroed a log, ran another check and all seems good again.

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.