USB drives and NTFS on FileServer appliance?

msemsel's picture

I'll admit to being a complete newbie, so feel free to point me to the documentation.  I have an external USB drive that I've connected to my new Fileserver appliance, but I'm not sure of two things:

I've mounted the drive to a new folder at /media/external .  On my XP laptop, I can see the FileServer, but can't see that mounted drive.

Assuming I can make that drive visible, what steps do I take to make that mount occur automatically if I reboot my Fileserver appliance?

Thanks and regards,

Mark

 

liraz's picture

A few tips

You should be able to configure everything without too much hassle through Webmin. Under System you have "Disk and network filesystems" where you configure mounts/paths. The Webmin module for Samba should allow you to export that directory as a network share.

Regarding NTFS support you'll probably need this:

apt-get install ntfs-3g
There's a nice tutorial about NTFS support on the Ubuntu community documentation which you may find helpful:

https://help.ubuntu.com/community/MountingWindowsPartitions/ThirdPartyNT...

Good luck and tell us how it goes!

msemsel's picture

NTFS and external USB Drives on FileServer

By golly, a little bit of fumfering and I actually got the dang thing to work!  Thanks for your suggestions - they definitely pointed me in the right direction.  That's worth at least two beers.

I'll have to guess that the Domain server includes the FileServer appliance.  Am I reading that correctly?

Mark

 

JedMeister's picture

Nice work! As for your question...

They both use Samba but by my understanding the config for fileserver/PDC is different (no doubt Liraz or Alon will be along shortly to correct me and/or elaborate).

I'm guessing that you would be able to use the PDC to serve files too (assuming that Samba is capable of doing both at once), or even vice-versa. But how you would actually go about that may be involved. I suggest you have a read over on the Samba website. For interest and relevance remember TKL fileserver/PDC is Ubuntu 8.40 under the hood using Samba v3.0.28a - from Ubuntu 8.04 repos.

Some other quick links that may be useful for a bit of background on Samba if you're keen: What is Samba? & Samba on Wikipedia

Good luck!


liraz's picture

You got it

The domain server and file server appliances both use Samba but the configuration is a bit different, because the use case is different. They do include a few of the same components but you can't say that one includes the other because they're both built from Core.

The domain controller does support network attached storage for users because its so easy to provide that with Samba, but it's not configured out of the box for communal / public storage and it doesn't include the file server's web based file manager.

red_x88's picture

how to access Webmin

@Liraz Siri

I am totally new to here.

I just finished installing the Turnkey Fileserver. I can now see the fileserver through a windows network and access xtplorer. 

I am trying to configure it further.. and how would I access this Webmin? Do I have to install it??

Thanks and regards,

Aris

msemsel's picture

Re: how to access Webmin

Hi Aris,

Webmin is part of the Fileserver installation, and it listens on port 12321.  If you can find the IP address of your new appliance on your local network, you'll be golden.

I found it via my router's web page (192.168.1.100, but your router's IP might be different).

For me, the Fileserver's IP address is 192.168.1.9 , so my link to Webmin is:

https://192.168.1.9:12321

Hope this helps.

 

Mark

 

red_x88's picture

Re: how to access Webmin

Hi Mark,

I can access my Webmin now! I'll be hanging around this forum for more questions. I'm sure I still got much to learn.

Thanks you so much!

Aris

red_x88's picture

how to add samba users

Hi mark,

I was able to configure my fileserver using Webmin. Now I am trying to add samba user which I cant find where.

Under Samba Windows File SharingSamba Users, I dont see "add samba user" anywhere. Now I tried to create a samba group and I stumblec with the Unix group field which I dont understand.

Can you enlighten me on this?

Thanks and regards,

JedMeister's picture

You need to add Linux user

then the new user will need to be added as a samba user. I think TKL Fileserver is set to automatically sync linux users to smaba users but there is a webmin button to manually do it too.


From newbie for newbie

Hi ..

I'm also a samba newbie.

I found that basicaly the samba user and group IS unix/linux group.

So you have to do unix user/group management

I found that the easiest path is :

1. Plan what groups you will need on your system, i.e :

- grp_accounting

- grp_marketing

2. When add a new user :

a. Set the "shell" as /bin/flase

b. set the Primary group as one of defineed group , i.e : grp_accounting

c. if you want that this person will also able to "read" shr_marketing , then set the secondary group grp_marketing.

3. When creating share (i.e:shr_accounting)

a. set the limiting ON , valid group : grp_accounting, grp_marketing

b. set the "create group" to grp_accounting

c. set the read-write group to grp_accounting

d. set the read-only group to grp_marketing

 

cmiiw

-bino-

dude4linux's picture

/bin/false

Bino,

On the line where you said

a. Set the "shell" as /bin/flase

I think you meant

a. Set the "shell" as /bin/false

You had me going there for a minute

Information is free, knowledge is acquired, but wisdom is earned.
red_x88's picture

Mounting drives

@JedMeister & Bino Oetomo

Thanks guys! your post really helped me alot.

Now I want to add another hard drive on my machine chich will be a repository for the users. Each user that I created on the machine as a corresponding folder on that hard drive.

How would I mount the hard and change the share folder of the users?

Thanks and regards,

Aris

JedMeister's picture

You will probably need to mount it

Most Desktop Linux Distros these days auto mount new media (eg new HDD, USB stick, etc) but I'm pretty sure that Ubuntu Server 8.04 (which is what TKL is under the hood) doesn't. You can have a read about mount here in the Ubuntu Documentation.

Basically you will need to work out what device your new drive is using

fdisk -l

Prob easiest way is to run this command before hooking up drive, then connect drive and run it again.

Then you will need to mount it like so (assuming your new HDD is sdb)

mount /dev/sdb1 /mnt

Good luck


red_x88's picture

User directories

Thanks JedMeister!

I was able to mount it. Now how would I point the User's home directory to a folder in that hard?

Thanks and regards,

Aris

JedMeister's picture

Try Webmin

This is not something that I have done before in Linux (I'm still pretty noobish with it myself) but a quick google suggests that it can be defined when setting up user accounts or changed for existing users using the usermod command. If you're keen to learn CLI then do some googling around that (just remember that TKL is Ubuntu Server 8.04 under the hood).

Probably the easiest way to do that though is through Webmin (which as Liraz suggested earlier in this thread, can also be used to mount devices). Webmin is accessed via https://your-tkl-server-name-or-ip:12321. If you have a look in Webmin under System>>Users & Groups it should be pretty obvious.


red_x88's picture

Not accessible

Hi again,

I am currently having a problem with the samba shares. I was able to create a share which is already available for windows clients how ever they cannot access the shared folders.

Thanks and regards,

Aris

JedMeister's picture

Hi again!

What do you mean by that? That users can access the share but not the sub-folders within the share?

Assuming that is what you meant I suspect you have problems with permissions.

From my experience as a Windows Admin I can say that to open a file/folder (on a Win box), permissions are required at the share level, but also at the file level. The (probably lazy way) I was taught to do this is to set permissions at the share level to give all users full control, and use user and group permissions to allow/disallow the required access level. Then any shares you don't want other people browsing you hide - you still use file permissions to to set access level.

Obviously Linux is different but my experience with the TKL Fileserver has led me to believe that Samba operates in a similar way (which makes sense). I have set up my Fileserver almost almost like I would a Win Server. It seems that Linux doesn't allow you to hide shares (well not that I've found) but it also won't show you shares unless you have access to them (at a share level). So there's no need to hide shares - you just don't allow access! End result looks similar.

Anyway, sorry to waffle. I use Samba share permissions to control what users see (and have read access to) and normal Linux user & group account (file) permissions to allow write access.

If you wish to do similar to me, set Samba share permissions to read/write for all (I use Webmin). Then you can either use chmod at the command line or Webmin File Manager. Webmin: Tools>>File Manager - browse to the share you wish to access, select the file/folder (in the right pane), click Info (in the toolbar). Don't forget to set it to "all folders and sub-folders" (if appropriate).

Hope that helps!


red_x88's picture

Still not accessible

Hi JedMeister!

I created a user named aris and when I access fileserver on my windows workstation with the user aris, I saw a shared folder also named aris. I figured out that it is my default home directory (am I right?) but the problem is that I cant access it - it says "You might not have permission to use this network resource".

I also mounted an NTFS filesystem on /mnt/ntfs and added a new share through Webmin. The shared directory also appeared in the my windows workstation however it is not also accessible (same error message as above).

I checked Webmin and I saw the Security under those shares says - "Read/write to all known users".

Thanks and regards,

Aris

red_x88's picture

Finally I got it!

Hi JedMeister!

Finally, I was able to solve my problems. Apparently, the folder with the same name as of the user, is just a link to the user's home directly. and the user's home directory was not yet set. so I executed usermod -d user /pathto/user/home/dir for each user and wallah! Users can now access their home directories.

Thanks you so much for your support guys! I'll be back if I will stumble into another problem.

Cheers!

Thanks and regards to all!

Aris

JedMeister's picture

Glad you got it sorted

Nice work. For interest sake, Webmin should auto assign home folders by default when you set up a new user account. I'm pretty sure I used Webmin for most of my setup, and it all went incredibly smoothly!

Obviously you worked out that you were correct in thinking the folder with the user name was the home folder. However I wasn't aware that they were only links. I guess it makes sense but you learn something new every day!

Also how did you go with your NTFS drive? Did it work? I wouldn't have thought Linux would be able to write file permissions to NTFS. If that's the case it may be a security issue (unless you use Samba permissions). I know that Linux ignores Windows filre permissions (I assume that's across NTFS drives but I've only tested it with XP/2003).


red_x88's picture

on NTFS Drive

Hi JedMeister!

You are right. Webmin really came in handy for me for most of the configuration. I'm glad it the setup went well (though I had some trial and errors).

As for the NTFS drive... I got Liraz Siri's tip on installing ntfs-3g and ntfs-config. Then I remounted the NTFS drive using ntfg-3g, created new shares using Webmin, restarted samba and the drive is now accessible.

As for the home folders, I ran a usermod -d user /path/to/userfolder/on/the/ntfs/drive for each user and they now have access to their home folders.

I'm glad everything come out right.

Thanks and regards Jed!

Aris

red_x88's picture

Convert/Compile TKL File Server for Virtual Machine

Hi JedMeister!

It's me again.

Is it possible to compile or convert my TKL File Server for deployment on a viltual machine?

Thanks in advance.

Aris

JedMeister's picture

Hi there, sorry I missed this, hope I'm not too late

Just realised that I'd missed this question. Yes it is possible but there are a myriad of different ways and which one is best will depend on your usage scenario. If you are only wanting to syncroonise content, then the easiest way would be to wait for the release of TKLBAM (TKL Backup And Migration - not yet released but not far away now, get a taste here) a handy tool that Alon & Liraz have developed to transfer data from one TKL appliance to another. If you have made customisations then creating a TKLPatch to share with the community may be a good way to go (if you think your customisations may be useful to others). Failing that, there are a few more ideas on this thread here.


red_x88's picture

"File Exists" problem on TKL Fileserver

hi guys!

I'm having this "File Exists" problem. I cannot delete empty folders.

Thanks!

Aris

JedMeister's picture

What have you tried?

rm -rf foldername

should work. (-r = recursive, just in case there is something in there such as a hidden file & -f = force) although be very careful because it will just delete it, no second chances!

If that still doesn't work, perhaps try rebooting (or as Liraz points out over here fuser could acheive the same ends with no reboot required).


red_x88's picture

About Locale

Hi JedMeister!

I am already using rm -rf foldername but still not successfull.

I found out that the folders I am trying to delete are really not empty when I booted the drive under windows. These folders contain files with filename with special characters (', &, ñ, Ñ). These files are not visible in TKL Fileserver due to its current locale which is en_GB.UTF8. I managed to installed the en_US.UTF-8 locale.

Set locale (adjust your language accordingly).

 

Set locale (adjust your language accordingly).
apt-get update
apt-get -y install language-pack-en
locale-gen en_US.UTF-8
/usr/sbin/update-locale LANG="en_US.UTF-8" LANGUAGE="en_US.UTF-8" LC_ALL="en_US.UTF-8" LC_CTYPE="C"
 
Next edit /etc/environment and define your environmental variables:
LANG="en_US.UTF-8"
LANGUAGE="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LC_CTYPE="C"
 

And there it is. All files are visible now. Problem with the "File Exists" during deleting folders is now solved.

Thanks you so much Jed!

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options