Author Topic: Problem with Generic Windows Share  (Read 2809 times)

rwilson131

  • Veteran
  • ***
  • Posts: 118
    • View Profile
Problem with Generic Windows Share
« on: August 12, 2007, 09:03:20 pm »
I have a freenas box which I have used since starting with PlutoHome without problems, but starting with RC1 and with this latest release 704.  I can not get the share mounted. I have been digging to try and get to the bottom of this and I have found something that I need clarification on. I have found some SQL code that seems wrong to me, but as I am not a SQL person. I was hoping someone else with more experience would confirm this or point me in the proper direction.

Code: [Select]
/etc/auto.PlutoStorageDevices
is the script that controls the mounting of all things storage (as best as I can tell)

you can test the code by running the following:

Code: [Select]
sudo /etc/auto.PlutoStorageDevices 91( please change 91 to the device Number of your Storage Device)

with the original SQL mentioned below it returns no information, but by making the changes below it returns the following

Code: [Select]
-fstype=cifs,username=XXXXXXX,password=XXXXXXX,dir_mode=0777,file_mode=0777 ://192.168.80.253/NAS

and the media stored is accessible.

So here is the code in question:at line 109 of /etc/auto.PlutoStorageDevices

Code: [Select]
## Get the ip address of the parent (computer or nas that has the share)
                Q="     SELECT
                                Parent.IPAddress
                        FROM
                                Device Child
                                LEFT JOIN Device Parent ON Parent.PK_Device = Child.FK_Device_ControlledVia
                        WHERE
                                Child.PK_Device = '$StorageDevice'
                        LIMIT 1
                "

However if you take this code and run it in phpmyadmin for the StorageDevice (91) created by Linuxmce for the NAS Share it always returns the Core IPAddress which is obviously not he IPAddress of the FreeNAS box controlling the shares.

If I change the script as follows: (change Parent to Child in the first SELECT line)

Code: [Select]
## Get the ip address of the parent (computer or nas that has the share)
                Q="     SELECT
                                Child.IPAddress
                        FROM
                                Device Child
                                LEFT JOIN Device Parent ON Parent.PK_Device = Child.FK_Device_ControlledVia
                        WHERE
                                Child.PK_Device = '$StorageDevice'
                        LIMIT 1
                "

It returns the correct address and it appears to fix the problem, but I was hoping someone smarter than I, could confirm that this is indeed correct or am I just getting lucky with this switch.

Thanks
Rob

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Problem with Generic Windows Share
« Reply #1 on: August 12, 2007, 09:31:56 pm »
I suspect that the SQL statement is correct, but that the structure in the database might not be set up properly.  I don't know these things for sure, as I'm still finding my way around.  But I would reckon the NAS should be the parent of the share, and I suppose the NAS then has the core as it's parent. 

How are the shares organized in the "devices-tree" of the web-admin now?  Are they "child-devices" of the core, or NAS?  Maybe you can try deleting the devices in the web-admin and then add them manually, first the NAS to the core (or perhaps top level) then the shares to the NAS.  Anyway that is what I think, I could be wrong of course.
"Change is inevitable. Progress is optional."
-- Anonymous


rwilson131

  • Veteran
  • ***
  • Posts: 118
    • View Profile
Re: Problem with Generic Windows Share
« Reply #2 on: August 13, 2007, 01:32:44 am »
I have tried both ways,  if the shares are listed as a child under the core then the original SQL statement returns the core IP if the shares are not a child device then the SQL statement returns NULL.  If NULL is returned then the next step of /etc/auto.PlutoStorageDevices is to PING the IP addressed returned, but if it is NULL then the script fails. other wise it PINGs  the core which works, but obviously the Share is not found and dmesg is loaded with CIFS errors.

I was going to look at the way the Shares are created and if the Parent IP was the IP address of the machine itself then the original SQL would return the correct IP address.

I did not have this problem until RC1 and I also now have it in 704,  I am going to try  a couple of more things to see if I can found out the issue.

Thanks,
Rob

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Problem with Generic Windows Share
« Reply #3 on: August 13, 2007, 02:44:59 am »
Is 91 in your case the device number of the NAS, or the share?
"Change is inevitable. Progress is optional."
-- Anonymous


rwilson131

  • Veteran
  • ***
  • Posts: 118
    • View Profile
Re: Problem with Generic Windows Share (Solved)
« Reply #4 on: August 13, 2007, 03:29:32 am »
I found the problem, the original SQL is correct.  The Share were listed as a device, but not the box.  There is a Device Template for File/Media Servers.  I created the device and then move the shares under the new device and reloaded the router and the devices are working properly. 

Thanks for your help.  I know that I was doing something wrong.  The problem that I due see is that the orbiter asks to use the FreeNAS box as a file server, but when I select yes, the device was not created.  I had added the Shares myself, so the automatic detection seems to be not added the File Server Device as the orbiter states.  I have it working so I am going to give it a rest for now, but I may look at the reason for the device not being added in the future.
 
Thanks.

Rob

barrett

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problem with Generic Windows Share
« Reply #5 on: August 13, 2007, 04:15:30 am »
Can you describe exactly what you did?

I'm still having trouble getting it right.

Thanks.

rwilson131

  • Veteran
  • ***
  • Posts: 118
    • View Profile
Re: Problem with Generic Windows Share
« Reply #6 on: August 13, 2007, 05:27:03 am »
Okay,

I thought that I had it fixed.  I am definitely closer, but I am running into a permission problem I believe.  I can ls -asl the files from /mnt/device/91/public/data/audio and all of the files are present via a ssh terminal, but not visible in the orbiter. Then I noticed different permissions from a device that is visible from the orbiter.

The share is being mounted with the following permissions

root:root

whereas the RAID I have mounted has the following permissions (which is shown in media on orbiters)

root:public

It will not let me change the ownership.  Even as root it states that I do not have permission.  I deleted and tried to start over, but even though the orbiter asks me if I want to use the box as a File Server, no device is created.  I can create the device manually, but it always ends up with the wrong permissions.  I originally thought that I fixed the issue, but soon realized that I did not as the media was not present in the orbiter, but I could list the directories from a ssh terminal.  I am going to dig a little deeper, but surely someone has gotten a file server up and running without much difficulty.

Any additional help would be appreciated, as my wife is about to kill me. 

As soon as I can confirm a working setup I will post to solution, but right know I can get it running with the exception of seeing the media in the orbiter. 

Thanks,

Rob

barrett

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problem with Generic Windows Share
« Reply #7 on: August 13, 2007, 05:47:53 am »
Interesting.

Its one of those things where I think "hey this will/should work now" then I get disappointed

Have you tried using NFS on the freenas box?

I tried getting that to work and it sort of saw an NFS share but still nothing.

Are we the only ones trying to use freenas? ha

Anyone have suggestions?

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Problem with Generic Windows Share
« Reply #8 on: August 13, 2007, 07:06:54 am »
Did you synchronize the media directories?  That should enter the media into the database.

web-admin > Files & Media > Media Files Sync > videos (in the tree) > Resynchronize
"Change is inevitable. Progress is optional."
-- Anonymous


rwilson131

  • Veteran
  • ***
  • Posts: 118
    • View Profile
Re: Problem with Generic Windows Share
« Reply #9 on: August 19, 2007, 04:49:39 pm »
I just wanted to give an update.  I have the shares mounted and visible on all of my MD's, but I had to do it manually. 

Every time the router is reloaded, I am asked if I want to use the Fileserver, every time I say yes, but a device for the machine was never created.

The fix was actually simple, but it involved setting up a device manually. 

1. Log onto the Webadmin site
2. scroll to the bottom on the left menu and click on "show devices tree" link
3. click on "CORE"
4. the device template will open in the right hand window.
5. Along the top of the template click the link "Create Child Device"
6. Click the button "Pick Device Template"
7. A new window will pop up.
8. Change the second drop down box to File\Media Server the click button labeled "Apply Filter" (this filters the third drop down box to only the device which meet the criteria listed in the top two drop down boxes.)
9. Select File Server and click "Pick Device Template"
10. Now you will be taken back to the original page, with a nearly complete device template for a File Server
11. Change the Description
12. Scroll to the bottom and add the username and password and check the check box if you want the box password protected.
13. Click Save ( now you have added the machine, Now we have to add the shares on the machine)

Adding Shares to the File\Media Server we just created above

1.  Now that the Machine is saved, click "Create Child Device" (same place as before)
2. Click the button "Pick Device Template"
3. A new window will pop up.
4. Change the second drop down box to Network Storage the click button labeled "Apply Filter" (this filters the third drop down box to only the device which meet the criteria listed in the top two drop down boxes.)
5. Select Windows Share and click "Pick Device Template"
6. Now you will be taken back to the original page, with a nearly complete device template for a Window Share
7. Change the Description
8. Scroll to the bottom of the page, as this is where we need to make some changes.
9. PK_Users is a drop down list.  I have alway selected Pluto's Structure, you may try additional options, but basically this sets up the directory structure under public like LinuxMCE wants it.
10. add Correct Share Name, username, password
11. under file system put in "cifs"
12 check the appropriate check boxes for your situation and then press the save button.


Now you need to reload the router and you should have access to the media.  If you do not immediately see the media listed on the orbiter, you need to perform the media file sync listed in the previous post.  I had to run the media sync from the top directory "public" otherwise it gave me an error, but from the top directory it ran fine.

I hope this helps.  The only residual problem is that every time the router is reloaded it asks me if I want to use my machine as a file server. I just select yes, and it is fine until the next time the router reloads.

Thanks,

Rob

teedge77

  • Addicted
  • *
  • Posts: 591
    • View Profile
Re: Problem with Generic Windows Share
« Reply #10 on: August 19, 2007, 05:40:05 pm »
I know I must be doing something wrong. I get this error when i try to synchronize media.

sudo -u root /usr/pluto/bin/UpdateMedia -d "/home/public/data"01   08/19/07 10:25:14.456      Cannot find self in maplock! (0x80b07b4) (>2) alarm: AlarmManager.cpp:102  <0xb6ba6b90>
ready to dump locks using logger: 0x80b0858
05   08/19/07 10:25:14.456      Dumping 1 locks <0xb6ba6b90>
05   08/19/07 10:25:14.456      finished check for exceptions <0xb6ba6b90>
05   08/19/07 10:25:14.456      OL: (0x80b07b4) (>1) alarm AlarmManager.cpp l:87 time: 10:25:14a (0 s) thread: 3065673424 Rel: Y Got: Y <0xb6ba6b90>

Any ideas? What should I be putting for share names? Can i just put "TV" or do i need some other sort of structure for it? Do i need to change the "/home/public/data" directory? I was assuming it would go to a database that would put it there. Is there another error report i should post? Thanks for any help.
AMD Athlon 64 X2 6000+
Asus M2V Via AM2 ATX
Lite-On LH-20A1S SATA DVD Burner
80GB  SATA-150
EVGA GeForce 7300 GT 512MB DDR2 PCI Express
Sound Blaster Audigy SE
Kingston 2 GB PC6400 DDR2 800MHz
Ultra X-Finity 800-Watt
ZCU000
Cisco 7970
TDM400P

rwilson131

  • Veteran
  • ***
  • Posts: 118
    • View Profile
Re: Problem with Generic Windows Share
« Reply #11 on: August 19, 2007, 08:55:00 pm »
Try going up to the next directory higher.

As far as Share names, it should match exactly the share given by the device offering the share.

I my case I have a FREENAS server with the following shares:

MOVIES and NAS

Make sure they match exactly.


teedge77

  • Addicted
  • *
  • Posts: 591
    • View Profile
Re: Problem with Generic Windows Share
« Reply #12 on: August 19, 2007, 09:43:46 pm »
Yeah, they match. I also tried the higher directory.

On an orbiter, when i click on media, then click the core it says offline. Is there something else i should be doing to make it online or is that just because theres no tuner?
AMD Athlon 64 X2 6000+
Asus M2V Via AM2 ATX
Lite-On LH-20A1S SATA DVD Burner
80GB  SATA-150
EVGA GeForce 7300 GT 512MB DDR2 PCI Express
Sound Blaster Audigy SE
Kingston 2 GB PC6400 DDR2 800MHz
Ultra X-Finity 800-Watt
ZCU000
Cisco 7970
TDM400P

teedge77

  • Addicted
  • *
  • Posts: 591
    • View Profile
Re: Problem with Generic Windows Share
« Reply #13 on: August 19, 2007, 10:58:33 pm »
Ok. Well i searched again on Wiki. I found one for setting up a file server. This time i managed to have it find the file server...all the shares...and i can choose them to rip CDs/DVDs. I still cannot get media to sync from there though. I still get the same error. Do i need any special structure inside the Windows shares?
AMD Athlon 64 X2 6000+
Asus M2V Via AM2 ATX
Lite-On LH-20A1S SATA DVD Burner
80GB  SATA-150
EVGA GeForce 7300 GT 512MB DDR2 PCI Express
Sound Blaster Audigy SE
Kingston 2 GB PC6400 DDR2 800MHz
Ultra X-Finity 800-Watt
ZCU000
Cisco 7970
TDM400P

teedge77

  • Addicted
  • *
  • Posts: 591
    • View Profile
Re: Problem with Generic Windows Share
« Reply #14 on: August 20, 2007, 03:20:16 am »
OK.I think i have it....except....i dont know how to do it, so i will have to learn more about linux. my question is....can i mount an NTFS share to a folder? if so....i believe i need to mount a folder inside the /public/data/XXX folder to the share. Then LinuxMCE should be able to scan it and put the IDs in the database....right? Am i making things too complicated? Does that seem like it would work....i read the Wiki about setting up files shares and want to make sure i understood it correctly.

Here's the Wiki i was using....its the bottom that i got this from....hope i understood it correctly.

http://wiki.linuxmce.com/index.php/How_are_media_files_organized%3F
AMD Athlon 64 X2 6000+
Asus M2V Via AM2 ATX
Lite-On LH-20A1S SATA DVD Burner
80GB  SATA-150
EVGA GeForce 7300 GT 512MB DDR2 PCI Express
Sound Blaster Audigy SE
Kingston 2 GB PC6400 DDR2 800MHz
Ultra X-Finity 800-Watt
ZCU000
Cisco 7970
TDM400P