TurnKey Linux Virtual Appliance Library

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 Siri'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!

Mark Semsel'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

 

Jeremy Davis'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 Siri'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.

Aris Moratalla'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

Mark Semsel'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

 

Aris Moratalla'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

Aris Moratalla'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,

Jeremy Davis'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/false

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-


John Carver'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.

Aris Moratalla'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

Jeremy Davis'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

Aris Moratalla'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

Jeremy Davis'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.

Aris Moratalla'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

Jeremy Davis'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!

Aris Moratalla'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

Aris Moratalla'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

Jeremy Davis'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).

Aris Moratalla'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

Aris Moratalla'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

Jeremy Davis'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.

Liraz Siri's picture

TKLBAM was released last week

In case anyone reading this thread missed it, here's the announcement.

Aris Moratalla's picture

"File Exists" problem on TKL Fileserver

hi guys!

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

Thanks!

Aris

Jeremy Davis'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).

Aris Moratalla'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!

Aris Moratalla's picture

TLK Fileserver Hostname

 Hi Jed!

I am trying to change the hostname of the TKL File Server. So I edited these files: /etc/hostname and /etc/hosts then rename fileserver to fileserver2 (just for this example) then I executed the commands /etc/init.d/hostname.sh stop and /etc/init.d/hostname.sh start. I also change netbios name = FILESERVER2 in the config file from webmin. Then rebooted the appliance.
 
Now I tried to ping both fileserver and fileserver2 from a windows workstation; both commands gave me a reply from the same IP.
 
Thanks in advance!
 
Aris
Liraz Siri's picture

/etc/hosts is internal

It only effects hostname lookups on the local machine. Other machines (e.g., your Windows box) won't be able to lookup the machine based on a hostname defined in /etc/hosts. NETBIOS is different though. It broadcasts the name to other Windows machines on your LAN.
Aris Moratalla's picture

error when executing "apt-get update"

Hi Jed and Liraz!

I am getting these errors while executing the command "apt-get update".

root@file-server:/etc/apt/sources.list.d# apt-get update 
Err http://archive.ubuntu.com hardy-security Release.gpg 
Could not resolve 'archive.ubuntu.com
 
Thanks in advance!
 
Aris
Jeremy Davis's picture

Looks like DNS resolution issue to me

Check that you have internet access and/or a clear path to the DNS server you are using. If that suspicion doesn't help head you in the right direction, then perhaps explain a little more about your setup and/or post the result of

cat /etc/resolv.conf

Aris Moratalla's picture

got it

Hi Jed!

Apparently I have wrong nameservers. I edited the file and replaced with the correct one.

By the way, congrats on TKLBAM! It will surely make a great impact on all TKL Appliance.

I hope I can use this locally. lol

Thanks Jed!

Aris

Jeremy Davis's picture

Cool!

In case you didn't realise nameserver = DNS server (DNS - Domain Name Service). While obviously manually editing the file worked, you could have used Confconsole instead. Glad its sorted though.

Aris Moratalla's picture

TKL Config Backup

We are very lucky that we have you guys!

Is there a way I can backup my TKL's config in case I want to migrate into a better machine?

I already read about the TKLBAM, I still cant afford it, but I'm trying to sort in out with my bosses. 

 

Thanks Jed!

Aris

Jeremy Davis's picture

TKLBAM can be used locally but...

A lot of the advantages and easy config etc are tied to the (TKL) Hub so its not as neat and user friendly. Here is the relevant section of the TKLBAM FAQ on the wiki. Hopefully at some point it may be possible to host a local Hub but until then this is your only option for local TKLBAM backups.

As for cost, don't let that hold you back! S3 costs are tiny! Currently they charge $0.15/GB/mth for most areas (ie $2.25/GB/year!). Data transfer in & out is currently free (although some data transfer will be chargable from 1st Nov 2010). Have a look at the full Amazon pricing details here. So unless you have a huge amount of data, its quite cheap!

Liraz Siri's picture

You can use TKLBAM without using Amazon S3

For example, you can store the backups to the local filesystem if you like. See my post on this subject here.

Aris Moratalla's picture

no APIKEY - tklbam not initialized

Hi Liraz,

 
I am getting this error when executing the following:
 
root@fileserver:~# tklbam-backup --address file:///mnt/tklbam/backup
Traceback (most recent call last):
  File "/usr/bin/tklbam-backup", line 253, in <module>
    main()
  File "/usr/bin/tklbam-backup", line 186, in main
    hb = hub.Backups(registry.sub_apikey)
  File "/usr/lib/tklbam/hub.py", line 168, in __init__
    raise Error("no APIKEY - tklbam not initialized")
hub.Error: no APIKEY - tklbam not initialized
 
How do I create/initialize this API key?
 
Thanks in advance!
 
Aris
Liraz Siri's picture

Create an account with the TurnKey Hub

You can get the API KEY from the user profile after you create an account. The Hub is still in private beta but ask for an invite and I'll grant it to you ASAP.

Aris Moratalla's picture

another error

Hi Liraz,

I already created an account and I was able to initialize the API key.

Now I tried following your instructions from here. Then I executed the following command and I got this hub error.

 

root@file-server:~# tklbam-backup --address file:///mnt/fileserver/backup/backup
Traceback (most recent call last):
  File "/usr/bin/tklbam-backup", line 253, in <module>
    main()
  File "/usr/bin/tklbam-backup", line 188, in main
    conf.profile = get_profile(hb)
  File "/usr/bin/tklbam-backup", line 121, in get_profile
    new_profile = hb.get_new_profile(turnkey_version, profile_timestamp)
  File "/usr/lib/tklbam/hub.py", line 202, in get_new_profile
    response = self._api('GET', 'archive/timestamp/', attrs)
  File "/usr/lib/tklbam/hub.py", line 180, in _api
    return API.request(method, self.API_URL + uri, attrs, headers)
  File "/usr/lib/tklbam/hub.py", line 123, in request
    raise Error(c.response_code, name, description)
hub.Error: (404, 'BackupAccount.NotFound', 'Backup Account does not exist')
 
Thanks!
Aris
Liraz Siri's picture

Follow the instructions on the Hub

Oh right. The Hub checks whether or not you enabled cloud storage on Amazon S3 even if you don't plan to use it. Just follow the instructions on the TurnKey Hub to enable cloud storage first.

I said local storage was possible I didn't say it was easy! :)

Aris Moratalla's picture

AWS account error

Hi Liraz,

I got this error when adding Amazon EC2 Account.

Your aws account isn't signed up for the EC2 service. Click help to see step 2.

I need a credit card information for step 2. I dont have that yet.

Liraz Siri's picture

You don't need to setup an Amazon EC2 account

Though it wouldn't hurt. You need to follow the instructions for enabling Backups. The wizard in the TurnKey Hub explains everything. Unfortunately you still need a credit card for that even though you don't be paying anything if you don't use cloud storage.
Aris Moratalla's picture

back on nameservers

Hi Liraz,

I'll get back to this as soon as I got the credit card.

Back on the nameserver, I edited and saved the /etc/resolv.conf file yesterday.

I found out today the content was back to the old nameserver after I reboot the appliance.

Did I edited the wrong file?

Thanks!

Aris

Liraz Siri's picture

DNS is managed by resolvconf package

I propose you configure nameservers through the confconsole or manually edit /etc/network/interfaces. See resolvconf man page for details.

BTW, that's why there's a warning in /etc/resolv.conf:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

Jeremy Davis's picture

Beat me to it!

But really I should have twigged to that when Aris first mentioned editing resolv.conf. Oh well...

Aris Moratalla's picture

nameservers solved

Got that one solved.

Thank you so much guys for your tireless support!

More power to all!

Aris

Aris Moratalla's picture

file access issue

Hi Jed/Liraz!

I am having a problem an excel file on the TKL Fileserver.

Whenever I try to open and save a file on a windows workstation, I am getting this error:

filename cannot be accessed. The file may be read-only, or you may be trying to access a read-only location. Or, the server the document is stored on may not be responding.

The error has the Retry and Cancel options. When I choose Cancel, I get this prompt:

the document was saved successfully, but excel cannot re-open the file because of a share violation... with just an OK option.

When I try to save again, the Save-As window will appear but I cannot overwrite the file.. The first error message will appear again.

Thanks!

Aris

Jeremy Davis's picture

Perhaps we should rename "Aris' Fileserver support thread? :)

I'm inclined to suggest that you start a new thread because this one is getting pretty long and convoluted. I know it is still vaguely related to the original post (in as much as its to do with TKL Fileserver appliance). And this question is probably more closely related to the original post than some of the other comments on this thread. But ideally 'new issue - new thread'. Sorry I'm partitally to blame cause I keep answering and haven't suggested this ssoner).

Anyway perhaps next time you have an issue, rather than post here again, perhaps start a new thread in the support forum (unless its directly related)? That way others who are searching the forum don't have to wade through heaps of irrelevant stuff to find their answer. It's also a bit rude to Mark (the OP - Original Poster/Person) as he probably gets an email from the forum evrytime you post on his thread (although I'm guessing by now he's probably cancelled his subscribtion) even though much of the discussion is irrelevant to what he was posting about. If its the same TKL Fileserver appliance you could include a link back to this thread if it will help with background info.

Anyway to your problem:
It sounds to me like the logged in user has read only rights (probably Samba/share permissions) to the specified folder/location. Have a look at Webmin and double check the file share under Samba Server. If everything looks as it should do, then restart the Samba Server (there's a button in Webmin to do this) and log in your user again (in Windows). If the problem presists then you may want to also check Linux file permissions (you can use 'Info' in the file manager). Make sure that 'this folder and all sub folders and files' (or similar wording) are enabled and the user permissions are correct. If it is a group shared folder situation make sure that the group membership of all your users is allowed read/write permissions. Double check that the user is a member of

Perhaps read back through the earlier posts on this thread regarding permissions if you need a refresher. Hope thats of some use.

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

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)