Author Topic: Using the Core as a fileserver for the family  (Read 3982 times)

charlie1953

  • Regular Poster
  • **
  • Posts: 22
    • View Profile
Using the Core as a fileserver for the family
« on: August 12, 2008, 10:06:00 am »
I am new to lmce and only have a basic understanding of linux although I have been a keen user of ubuntu for a number of years.
I have boggled my brain searching for an answer to this so I hope I have not missed anything really basic.

I have successfully got a hybrid machine installed and working.
After initial installation I added a 1T internal hard drive which the core picked up and I told it to use the LMCE file structure.

I have been adding media to this disk and the core has successfully detected it and added it to its database.

I have copied the media to the following shares using my ubuntu samba client:
smb://192.168.80.1/public/audio/WDC_WD10EACS-00D%20(sda1)-CORE%20%5B70%5D
smb://192.168.80.1/public/videos/WDC_WD10EACS-00D%20(sda1)-CORE%20%5B70%5D

It all works like a charm.

Now for my problem.
I wanted to set up a share on the core for the family to use for documents, spreadsheets, accounting files etc. This is so I can decommission my old file server which is getting dated.
So, using the kde desktop on the core I copy all the files from my old fileserver to here:
smb://192.168.80.1/public/documents/WDC_WD10EACS-00D%20(sda1)-CORE%20%5B70%5D/

The problem is that when I do this I cannot get write access to the directory from the vista or ubuntu samba clients.
I have tried every combination of owner:group including root:root, root:public, charlie:charlie, root:charlie and the permissions are drwxr-xr-x (755) on the directories and -rwxr--r-- (744) on the files. My samba clients all connect as user charlie.

While writing this I have stumbled upon a work-around so for me a solution from the gurus is not important. However, I spent so much time on the problem that I figured I can save a headache or two so I will post anyway.

My simple work around is to create and populate the directory from the samba client machine not the core. (As I did with the media (yes, I know, that should have been a clue 2 days ago))
This results in directories and files with owner/permissions of charlie:charlie and drwxr-xr-x (755) and -rwxr--r-- (744).
Even though I used chown to duplicate this from the core, I could not get it to work. Perhaps the problem was not related to owner or permissions. ???
An explanation would give me closure....

charlie1953

  • Regular Poster
  • **
  • Posts: 22
    • View Profile
Re: Using the Core as a fileserver for the family
« Reply #1 on: August 18, 2008, 02:07:29 pm »
For other linux noobs out there here are some more tips I have learned ...

When creating and using directories on the core pay attention to owner:group and permissions. If you create directories from the kde desktop the owner is linuxmce, group public and permissions seem to be drwxr-xr-x (755). This probably makes perfect sense to a normal linux user but if you are used to Windows it can be confusing. Especially because when you link to the lmce samba share using your user name (in my case charlie) then you are actually using the samba user charlie but your linux username is pluto_charlie. Therefore files and directories created via the samba share get owner=pluto_charlie and group=public. When you shh into the server and log in as linuxmce - obviously any files or directories created get user=linuxmce. After I had been messing about trying to set up my fileserver I had random ownerships and permissions and had copied about 20G of files from my old fileserver. I put everything under the /public/documents folder of my second internal harddrive (which had a symbolic link created by lmce from the lmce main drive public/documents folder) ......

that was a BIG MISTAKE....

Dont use the lmce file structure to store your non-media files. The forum and wiki are full of advice about how to get your data into lmce (ie by putting it into the data/public/audio or data/public/videos file structure so it gets "discovered" automatically. However, if you don't want stuff to get "discovered" and displayed on lmce then DONT put it in this file structure. (not even the documents directory as it will even get "discovered" there.) This caused all the kids crappy mp3 downloads and phone pics to appear in lmce - thousands of them - with no tags so they were completely unstructured.

So I learned how to use chown and chmod to set ownership to charlie_pluto:public and permissions to 777 recursively on the "documents" folder containing all my files. Then I learned how to create a symbolic link using the "ln" command in the public/data folder (which is shared as "pubilc" by samba). I pointed this symlink to a folder that I created on the second drive OUTSIDE of the lmce file structure called "family".

Now I have copied all the non-media files to the "family" folder and it shows up in the "public" samba share from all the ubuntu and XP and vista PC in the house.

Use the admin page "media Files Sync" to browse to where the files were moved from and click the check box "Show files who are missing from disk" (sic) and you get the ability to delete from database.

With all the junk gone out of lmce's database I can now start adding attributes to my media collection which is now much more manageable.

I hope this will be of assistance to someone - i'm sure someone can suggest better ways to do this but this has worked for me.

regards and thanks to all who have contributed to this great project.
Charlie

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Using the Core as a fileserver for the family
« Reply #2 on: August 18, 2008, 02:25:33 pm »
The LMCE structure is intended for storing LMCE media, so yes it is a good idea not to put other stuff in there. However, that doesn't mean you can't tell it to use the LMCE structure on a new drive, as it will just create that folder structure, but you can still create other folder structures in parallel and potentially share them out.

Also, if you were on the core itself and trying to copy files to it, why not just navigate to the real folders under /home/public/data/video|audio etc, you won't have any difficulty writing to those...

Finally, you might want to keep your media and files on another machine anyway, so that you can rebuild your LMCE machine whenever you want without messing around moving all your data off again....

royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: Using the Core as a fileserver for the family
« Reply #3 on: August 18, 2008, 11:56:46 pm »
Finally, you might want to keep your media and files on another machine anyway, so that you can rebuild your LMCE machine whenever you want without messing around moving all your data off again....

Or at least on a separate drive in your core.  This let's you use the DVD installer (which reformats the target drive) to upgrade or reinstall without erasing your data.  I also suggest that your media drive be a different size or brand from your system drive so you can easily recognize the system drive when running the DVD installer.  Example, system drive = 40GB, media drive = 1TB.  Also if you are the really cautious type, you can unplug the media drive, boot to make sure you unplugged the correct one, then install...


charlie1953

  • Regular Poster
  • **
  • Posts: 22
    • View Profile
Re: Using the Core as a fileserver for the family
« Reply #4 on: August 19, 2008, 05:26:07 am »
Thanks for that Roy and Colin - yes I have all my media and other data on a separate 1T disk (hence the symlinks mentioned).

I notice from the forums that people tend to build and rebuild their systems a lot but I am happy to say that I still have my original build (6 weeks later). I removed my old ClarkConnect firewall, plugged in the target hardware for the core with 2 nics and installed from the DVD. It was up and running in about an hour and has been as robust and stable as any other linux server I have used. I had to bring it down to install the 1T internal drive but all my tweaking and copying of data to set up the media directories and the fileserver directories have been achieved without even a reboot! (My Vista PC on the other hand suffers at least twice a week from some sort of freeze requiring a hard boot.)

The point is that I have found the core to be stable enough to be used as a firewall/fileserver for the home if you can use a second PC for mucking about on.

I have successfully added my desktop PC as an MD just by booting off the LAN. So I can now play around with the MD and work on the WAF while I rip my media and clean up the media database by adding missing info.

All the gear I have used was what I had on hand - the only thing I bought specifically for lmce was a Fiire Chief. When I get the time I will dig out all the specs and post them for reference.

When the WAF is sorted I will start buying the bits for an MD in the living room.

royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: Using the Core as a fileserver for the family
« Reply #5 on: August 19, 2008, 06:05:41 am »
Actually my system has been extremely stable (I haven't done an install since RC2 came out).  Most of multiple installing was during the last beta period.  It is good to have your hardware ready for the next release cycle :)

Have fun,
Roy