Quick Tips

Setup Samba Shares With FreeNAS - A 5 Minute Tutorial

|


After reading some tweets between Beq and Freenas on Twitter recently, I thought it would be a great idea to write a quick tutorial on setting up a basic Samba (CIFS/SMB) tutorial for anonymous access. I had gone through similar problems when I first started using FreeNAS. The process is very similar the one I used for Data Recovery Using FreeNAS. Note that I am running this setup and keeping it on as a LiveCD setup. All these settings will be lost upon a reboot. You can save the settings to a Floppy or a USB drive.


Bootup and Install
  • I Boot up with the LiveCD.
  • Configure the IP address via DHCP (option 2)
  • I go to another machine for the WebGUI to do additional configuration.
  • From the WebGUI, I login with the default admin/freenas account.
  • Then I setup the Disks - steps are below.


Adding the Disk
  • Disks - Management - Add Choose the Disk.
  • In my case it is ad8.
  • I give the description as HD (Hard Disk)
  • I leave everything else default, leaving the Preformatted file system as UFS (GPT and Soft Updates). Click Save
  • Now Click Apply Changes
  • You should see the status of the Disk as Online

Format The Disk

  • If this is a new disk (to FreeNAS) you should format it.
  • Choose the Disk you setup in the above step
  • Choose the File System.
  • Give it a Label (optional)
  • Click Format Disk

Mount the Disk
  • Disks - Mount Point - Management - Add mount point
  • I Choose the Disk I configured above
  • I choose EFI GPT as the partition, since I am using the entire disk for data storage.
  • Filesystem: I choose UFS
  • Sharename: I call it Windows. You can call it anything you want.
  • I leave everything else as the default and click Add
  • save the changes by clicking Apply Changes
  • Status should go to OK

Setup Samba (CIFS/SMB) Services
  • Go to Services - CIFS/SMB
  • On the Settings tab, make sure you check off Enable
  • Choose Anonymous for Authentication (you can change this once you get it all working)
  • Give it a NetBIOS name and Workgroup of your choosing
  • I left all settings as the default. Click Save and Restart

Setup Samba (CIFS/SMB) Shares
  • On the Shares tab, Click on the Add Share icon (plus sign)
  • Give your Samba Share a name and put a comment in so you know what it is.
  • Choose the Path. This should be /mnt/mountpoint. Where the mountpoint is what you setup in the Mount The Disk step's Share name. In my case it would be called Windows. THIS STEP IS VERY IMPORTANT!
  • Click the Add button.
  • Click Apply changes
From Your windows machine, or any machine that can access a Samba share, I go to the folder \\freenasIP - You should see your available Samba share now.

I know all the mounts and share names and all the other steps can be very confusing if you have never set up FreeNAS before. It was confusing to me until I did it a few times. I hope this has helped you get your FreeNAS system up and running. Let me know your thoughts on this process and if this tutorial helped you at all. To read more about FreeNAS see My other FreeNAS posts:
You can buy the Learning FreeNAS: Configure and manage a network attached storage solution book if you are looking for a good reference book.

For additional links to tips and tricks follow me on Twitter. If you would like to contribute to FrugalNYC or FrugalTech in any way (guest posts, articles, ideas, interesting links, advice, financial assistance, or anything else), feel free to contact me via email. Click here to add this to your RSS reader or Subscribe to FrugalTech by Email.

14 comments:

danu said...

Thanks
Good article

www.datarecoverydownload.blogspot.com

FrugalNYC said...

Thanks Danu.
Glad you like it!

Thanks for visiting and for the comment.

Anonymous said...

FrugalTech thanks for the tips and how to's they have been helpful. I am in a jam though with the smb/cifs right now. I put in this freenas server at the office and as anonymous it works great, but when I try to do local user and restrict folders I am stuck. I have read everything and tried all I know to, but several problems continue. I setup my sharename as fileserver and mnt points correctly to that name. I can access the server and see the shares but so can everyone else, even when restricted access is given. Also if you copy a file to one folder it copies to the others as well. I simply need to be able to setup a public folder for all and several private folders for accounting and management as well as private individual folders for different users...can you suggest a solution ?

Thaks rick@fccinvest.com

FrugalNYC said...

Hi Anonymous,

One limitation I've seen with FreeNAS is the ability to do both Anonymous access and user credentials at the same time. I had the same problem when I first started to use FreeNAS.

My suggestion to your problem is to use a general account for anonymous/open access. Setup individual accounts for departments/individual users. You should setup subdirectories under the general share. The main share folder should be restricted and the subdirectories, you can setup proper access to each individual account. Hope this helps.

Fredrik said...

Hi, how do you set user-permissions when you have created your share? i want all visitors to the share to have full access.

Please get back to me on the supplied information.

Best regards ,Fredrik

FrugalNYC said...

@Fredrik

This may be a good article for your reference

http://www.packtpub.com/article/local-user-management-in-freenas

You should create a group (always a good idea for preparing for future growth) and then give rights to the group. Then add local accounts and add to the group. The article above goes into detail. Hope that helps.

Richard Fernandez said...

Nice tutorial.
I have been going thru many tutorials on freenas configuration, and it is very confusing. Yours is a little better. I have learned some things. And that's what is important.
Thanks.

FrugalNYC said...

Hi Richard,

I'm glad to hear you like this tutorial and that it has helped you more than others. I aim to make things easier for others :)

Very happy to have your encouraging comment.

Anonymous said...

Yet Another "Anonymous" but..I just wanted to let you know that this is a great straightforward piece. The logic of freeNas setups is **not** obvious, but setup can be done easily and straightforwardly. Personally I got stuck over partition numbers because I was trying to do it the so-called obvious way. Thanks for your help!

I think that this (slightly updated to reflect the current state of the s/w and webGUI) should be contributed to freeNAS/sourceforge as a "This is how you get started quickly piece" - needed at some time by all of us!

FrugalNYC said...

Hi "Anonymous", would have been great to know who you are ;)

Glad to hear my walkthrough helped you get up and running. Thanks for the compliment, how do I go about adding something to sourceforge document? Would love to do that!

Anonymous said...

good article helped me allot thanks!

FrugalNYC said...

Hi Anonymous,

Glad this article helped you with FreeNAS :)
I love my FreeNAS system!

Anonymous said...

Just a minor question here!
I've configured AD and checked the log, here you can see the users that have been imported, but how do you assign the users to the share or even add groups to the SMB shares within Freenas. Because the system looks very promising.

Hope you can tell more on how to set up permissions and rights on the share using both AD-groups and AD-users.
Thanks!

FrugalNYC said...

@Anonymous

The easiest way I can think of is to create local groups and assign AD groups/users to those groups.

Hope that helps.

Post a Comment