OpenWrt Forum Archive

Topic: Please help me get a network share working on a usb monted hdd

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I can not get a network share to work for the life of me.

Here is my problem:

http://img835.imageshack.us/img835/1869/55915105.gif

Using ubuntu, I prepared an 8gb hdd  by formating it with ext4. The only thing on it is a lost&found folder and a home folder. I put some test media (pics,vids) in the home folder.

Then I successfully got my router to mount the usb hdd

http://img543.imageshack.us/img543/1186/64966161.gif

but I do not know what to use as the path in the luci network shares tab.

I have tried everything I could think of /dev/sda, /dev/sda1, /media/8gb_hdd/home, and so forth.

http://img163.imageshack.us/img163/3834/95383202.gif

The only share that works is the tmp example share.


Packages Installed:

kmod-ledtrig-usbdev
kmod-usb-core
kmod-usb-ohci
kmod-usb-storage
kmod-usb-storage-extras
kmod-usb2
kmod-fs-ext4
kmod-fs-mbcache
kmod-fs-msdos
kmod-fs-ntfs
luci-app-samba
samba3
block-mount

I SSH'ed into my router and I am able to browse the usb hdd contents.

http://img713.imageshack.us/img713/9357/85749866.gif

However I still am not able to access the share from nautilus or windows explorer.

The only share I can access, is the tmp share.

Here is my samba file from /etc/config

http://img560.imageshack.us/img560/9758/samba.gif

As you can see, both tmp and Media4 are setup identically but only the tmp share works.

Here is my smb.conf from etc/samba

[global]                                                                                                                                                     
        netbios name = openwrt                                                                                                                               
        workgroup = workgroup                                                                                                                                
        server string = openwrt                                                                                                                              
        syslog = 10                                                                                                                                          
        encrypt passwords = true                                                                                                                             
        passdb backend = smbpasswd                                                                                                                           
        obey pam restrictions = yes                                                                                                                          
        socket options = TCP_NODELAY                                                                                                                         
        unix charset = ISO-8859-1                                                                                                                            
        preferred master = yes                                                                                                                               
        os level = 20                                                                                                                                        
        security = share                                                                                                                                     
        guest account = nobody                                                                                                                               
        invalid users = root                                                                                                                                 
        smb passwd file = /etc/samba/smbpasswd                                                                                                               
                                                                                                                                                             
[homes]                                                                                                                                                      
        comment = Home Directories                                                                                                                           
        browseable = no                                                                                                                                      
        read only = no                                                                                                                                       
        create mode = 0750                                                                                                                                   
                                                                                                                                                             
[tmp]                                                                                                                                                        
        path = /tmp                                                                                                                                          
        read only = no                                                                                                                                       
        guest ok = yes                                                                                                                                       
        create mask = 0777                                                                                                                                   
        directory mask = 0777                                                                                                                                
                                                                                                                                                             
        guest ok = yes                                                                                                                                       
        create mask = 0777                                                                                                                                   
        directory mask = 0777                                                                                                                                
                                                                                                                                                             
[Media5]                                                                                                                                                     
        path = /media/8gb_hdd/home                                                                                                                           
        read only = no                                                                                                                                       
        guest ok = yes                                                                                                                                       
        create mask = 0777                                                                                                                                   
        directory mask = 0777

I could really use some help, I can't figure this out.

I did my best to follow the directions here:

http://wiki.openwrt.org/doc/howto/cifs.server

The only thing I didn't follow was:

openwrt.org/doc wrote:

3. In your firewall open tcp 135:139 and tcp 445 from your LAN. Following example may not work for you (set the right interface -i )

1. iptables -I INPUT -j ACCEPT -i eth0.1 -p tcp -m multiport –dports 135:139
2. iptables -I INPUT -j ACCEPT -i eth0.1 -p tcp –dport 445

I didn't follow it because I don't know what that means, or what to edit. My firewall file from etc/config looks like this:

config defaults
        option syn_flood        1
        option input            ACCEPT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

config zone
        option name             lan
        option input    ACCEPT
        option output   ACCEPT
        option forward  REJECT

config zone
        option name             wan
        option input    REJECT
        option output   ACCEPT
        option forward  REJECT
        option masq             1
        option mtu_fix  1

Can somebody please tell me what is wrong and how to fix it?

Thanks in Advance.

(Last edited by Keypel on 16 May 2011, 06:03)

Samba is a tricky program to figure out.  I spent weeks till i finally got mine setup correctly with problems left and right with my wndr3700.

here are a few things to try.

add:  host msdfs = no          to smb.conf global section
remove the 'Homes' section.  I do not use it and mine is fine, worth a shot.
do:  chmod -R 777 /media/8gb_hdd        maybe its an access permission samba does not have.

In the end just try everything you see and see what happens.  its a pain.  wish i could be of more help.

Made some progress today. I got my usb hdd share viewable from Ubuntu, WinXP, and my Xbox.

The only thing I did different was I used ext3 instead of ext4 when formating the usb hdd. I have no idea if that had anything to do with my problem or not but I'm just happy the share is now viewable. Also, Instead of changing workgroup to 'workgroup', I just left it as 'OpenWrt'. Again,  I have no idea if that had anything to do with the original problem.

Still having problems though. This it has to do with permissions.

With the tmp share, I can create and delete folders and files but with the usb hdd share I can only view whatever is already there and can't modify, create, del, etc.

Any help would be great.

(Last edited by Keypel on 17 May 2011, 03:38)

Keypel wrote:

Made some progress today. I got my usb hdd share viewable from Ubuntu.

Don't you have to always have the Ubuntu server up running to waste electricity just to serve your Windows and XBox systems? Can' you just get an inexpensive NAS, i.e. Hitachie SimpleNET NAS Head USB 2.0 Portable Dongle - SNET $18.99, etc., that will consume less than 5 Watts of electricity? Currently, the Hitachie SimpleNET NAS Head USB 2.0 Portable Dongle - SNET isn't supported under OpenWRT yet; however, it should provide a good NAS for your need.

mazilo wrote:

Don't you have to always have the Ubuntu server up running to waste electricity just to serve your Windows and XBox systems? Can' you just get an inexpensive NAS, i.e. Hitachie SimpleNET NAS Head USB 2.0 Portable Dongle - SNET $18.99, etc., that will consume less than 5 Watts of electricity? Currently, the Hitachie SimpleNET NAS Head USB 2.0 Portable Dongle - SNET isn't supported under OpenWRT yet; however, it should provide a good NAS for your need.

ah... but I already have a bad ass power saving nas up and running. Currently running freenas (based off of freeBSD) on a Zotac main board. 1.6ghz, 2gb ram, and a gigabit Ethernet port. Comsums very little power and is fan less. I could never figure out how to get OpenWrt to run on the x86 hardware so I gave up and bought a dir-825.

As far as those cheap-o $18 nas dongles, I have one. Those things are not that great. Wouldn't even give it away.

Anyways, I figure why run both a nas and OpenWRT when OpenWRT is capable of doing both!! I want to be able to run both samba and OpenVPN. Hopefully my 680ghz dir-825 will be fast enough to run both at full speed.

As far as the original problems go, I think it was caused because I allowed ubuntu to take ownership of the file system when I formated the drive? Anyways, everything is working now. Is ext4 ok for my dir-825? or should I be using ext3?

(Last edited by Keypel on 17 May 2011, 04:59)

Keypel wrote:
mazilo wrote:

Don't you have to always have the Ubuntu server up running to waste electricity just to serve your Windows and XBox systems? Can' you just get an inexpensive NAS, i.e. Hitachie SimpleNET NAS Head USB 2.0 Portable Dongle - SNET $18.99, etc., that will consume less than 5 Watts of electricity? Currently, the Hitachie SimpleNET NAS Head USB 2.0 Portable Dongle - SNET isn't supported under OpenWRT yet; however, it should provide a good NAS for your need.

ah... but I already have a bad ass power saving nas up and running. Currently running freenas (based off of freeBSD) on a Zotac main board. 1.6ghz, 2gb ram, and a gigabit Ethernet port. Comsums very little power and is fan less. I could never figure out how to get OpenWrt to run on the x86 hardware so I gave up and bought a dir-825.

As far as those cheap-o $18 nas dongles, I have one. Those things are not that great. Wouldn't even give it away.

Anyways, I figure why run both a nas and OpenWRT when OpenWRT is capable of doing both!! I want to be able to run both samba and OpenVPN. Hopefully my 680ghz dir-825 will be fast enough to run both at full speed.

As far as the original problems go, I think it was caused because I allowed ubuntu to take ownership of the file system when I formated the drive? Anyways, everything is working now. Is ext4 ok for my dir-825? or should I be using ext3?

I believe ext3 is preferred.

The discussion might have continued from here.