NSLU2-Linux
view · edit · print · history

HowTo.CreateASingleSambaShareFor2Harddisks History

Hide minor edits - Show changes to markup

May 05, 2006, at 08:55 PM by StormLogiX --
Changed lines 122-123 from:

Now you don't have to reboot or anything after this. Just browse your network using Windows "My Network Places", find the NSLU2 and map the the folder "share" to a drive letter of your liking.

to:

You don't have to reboot or anything after this. Just browse your network using Windows "My Network Places", find the NSLU2 and map the the folder "share" to a drive letter of your liking.

April 24, 2006, at 08:49 PM by StormLogiX -- added chmod 555 /share/public
Changed lines 4-6 from:

This is so you be able to mount both harddisk in Windows ("Map Network Drive") by using only one drive letter. So you will only need to map 1 drive letter for both harddisks attached to port 1 and 2 on the NSLU2.

to:

This is so you be able to access both harddisk in Windows ("Map Network Drive") by using only one samba share. So you will only need to map 1 network drive letter for both harddisks attached to port 1 and 2 on the NSLU2.

Changed line 32 from:
  1. Now you must change ownership and access of this directory to match those of the other two predefined folders (or you will not be able to access this directory using smb):\\
to:
  1. Now you must change ownership of this directory to match those of the other two predefined folders (or you will not be able to access this directory using smb):\\
Changed lines 34-38 from:

chown admin:everyone /share/public
chmod a+rwx,o-w /share/public

  1. Now create symbolic links to the directories that you want to share. In our case it is the public share on both harddisks (but you can put links to anything else you like):\\
to:

chown admin:everyone /share/public

  1. After that we should change the access rights of this directory to read-only. This necessary because the /share/public directory is not actually on a harddisk but merely a directory on the linksys, so we need to prevent samba users from writing anything to this directory.\\
Added lines 39-43:

chmod 555 /share/public

  1. Now we create symbolic links to the directories that you want to share. In our case it is the public share on both harddisks (but you can put links to anything else you like):
    \\
Changed lines 50-51 from:
  1. After that we just have to add this to the samba configuration. For this we will create a new file /etc/samba/user_smb.conf. This file is parsed automatically by the Linksys firmware just after parsing the default /etc/samba/smb.conf and has the advantage that it will not get overwritten if you change something using the web interface:\\
to:
  1. After that we have to add some lines to the samba configuration. But rather than writing to the default samba config /etc/samba/smb.conf, we will create a new file /etc/samba/user_smb.conf. This file is loaded automatically by the Linksys firmware right after loading the default /etc/samba/smb.conf. This file has the advantage that it will not get overwritten if you change something using the web interface:\\
April 21, 2006, at 09:34 PM by StormLogiX -- just some formating
Changed line 41 from:

ln -s /share/hdd/data/HDD_1_1_1 /share/public/disk1 (use this instead if you are using 6.8 Firmware with a NTFS disk in USB1? - see below)\\

to:

ln -s /share/hdd/data/HDD_1_1_1 /share/public/disk1 *) \\

Deleted lines 42-44:
  1. After that we just have to add this to the samba configuration. For this we will create a new file /etc/samba/user_smb.conf. This file is parsed automatically by the Linksys firmware just after parsing the default /etc/samba/smb.conf and has the advantage that it will not get overwritten if you change something using the web interface:\\
Added lines 44-47:
  • ) use this instead if you are using 6.8 Firmware with a NTFS disk in USB1 (see below)
  1. After that we just have to add this to the samba configuration. For this we will create a new file /etc/samba/user_smb.conf. This file is parsed automatically by the Linksys firmware just after parsing the default /etc/samba/smb.conf and has the advantage that it will not get overwritten if you change something using the web interface:
    \\
Changed lines 75-78 from:

NEW: I have Unslung 6.8 with the Boot Disk (the one with the 'ADMIN' partition) plugged into the Disk2 USB socket and a second disk, formatted as NTFS, plugged into the Disk1 USB socket.
With this configuration the NSLU2 now automatically itself creates the /etc/samba/user_smb.conf file and uses that to add the sharing definition for the NTFS disk which it calls 'HDD_1_1_1'.
You cannot remove the HDD_1_1_1 share by simply deleting the relevant lines as the NSLU2 will put them back on the next reboot.
Changing the '[HDD_1_1_1]' to '[DISK 1]' will tidy up the share tempoarily, but the NSLU2 will put the [HDD_1_1_1] share lines back in the file on the next reboot.@@\\

to:

NEW: I have Unslung 6.8 with the Boot Disk (the one with the ADMIN partition) plugged into the Disk2 USB socket and a second disk, formatted as NTFS, plugged into the Disk1 USB socket. With this configuration the NSLU2 now automatically itself creates the /etc/samba/user_smb.conf file and uses that to add the sharing definition for the NTFS disk which it calls HDD_1_1_1. You cannot remove the HDD_1_1_1 share by simply deleting the relevant lines as the NSLU2 will put them back on the next reboot. Changing the [HDD_1_1_1] to [DISK 1] will tidy up the share tempoarily, but the NSLU2 will put the [HDD_1_1_1] share lines back in the file on the next reboot.\\

Changed lines 77-78 from:

Solution - Create two duplicate share definitions for [HDD_1_1_1] and append 'browsable=no' to the first leaving the second intact. The NSLU2 seems happy with that. (It doesn't work if you add it to the second). And don't forget the different step 5 above
My /etc/samba/user_smb.conf file looks like this:\\

to:

Solution - Create two duplicate share definitions for [HDD_1_1_1] and append browsable=no to the first leaving the second intact. The NSLU2 seems happy with that. (It doesn't work if you add it to the second). And don't forget the different step 5 above.
My /etc/samba/user_smb.conf file looks like this:\\

Added line 86:

\\

Added line 89:

\\

Added line 92:

\\

Changed lines 94-95 from:

socket options = TCP_NODELAY SO_KEEPALIVE IPTOS_LOWDELAY SO_SNDBUF=65535 SO_RCVB\\

to:

socket options = TCP_NODELAY SO_KEEPALIVE IPTOS_LOWDELAY SO_SNDBUF=65535 SO_RCVBUF=65535
\\

Added line 103:

\\

Deleted lines 109-110:
April 21, 2006, at 08:24 AM by thekitehunter -- Revised for 6.8 firmware with NTFS disks
Changed lines 41-44 from:

ln -s /share/flash/data/public /share/public/disk2

to:

ln -s /share/hdd/data/HDD_1_1_1 /share/public/disk1 (use this instead if you are using 6.8 Firmware with a NTFS disk in USB1? - see below)
ln -s /share/flash/data/public /share/public/disk2

Deleted lines 72-74:
  1. Moreover, I found this somewhere in the wiki and found it to be usefull to increase reading and writing speed, but I haven't benchmarked it in an scientific way:\\
Added lines 74-91:

NEW: I have Unslung 6.8 with the Boot Disk (the one with the 'ADMIN' partition) plugged into the Disk2 USB socket and a second disk, formatted as NTFS, plugged into the Disk1 USB socket.
With this configuration the NSLU2 now automatically itself creates the /etc/samba/user_smb.conf file and uses that to add the sharing definition for the NTFS disk which it calls 'HDD_1_1_1'.
You cannot remove the HDD_1_1_1 share by simply deleting the relevant lines as the NSLU2 will put them back on the next reboot.
Changing the '[HDD_1_1_1]' to '[DISK 1]' will tidy up the share tempoarily, but the NSLU2 will put the [HDD_1_1_1] share lines back in the file on the next reboot.

Solution - Create two duplicate share definitions for [HDD_1_1_1] and append 'browsable=no' to the first leaving the second intact. The NSLU2 seems happy with that. (It doesn't work if you add it to the second). And don't forget the different step 5 above
My /etc/samba/user_smb.conf file looks like this:

[DISKS]
valid users=@"administrators",@"everyone"
comment = For everyone
path=/share/public
read only = yes
write list= @"administrators",@"everyone"
[ADMIN 2]
browsable=no
[DISK 2]
browsable=no@@\\

Added lines 93-111:

socket options = TCP_NODELAY SO_KEEPALIVE IPTOS_LOWDELAY SO_SNDBUF=65535 SO_RCVB
[HDD_1_1_1]
valid users=@"administrators",@"everyone"
comment = For everyone
path=/share/hdd/data/HDD_1_1_1
read only = yes
write list= @"administrators",@"everyone"
browsable=no
[HDD_1_1_1]
valid users=@"administrators",@"everyone"
comment = For everyone
path=/share/hdd/data/HDD_1_1_1

  1. Moreover, I found this somewhere in the wiki and found it to be usefull to increase reading and writing speed, but I haven't benchmarked it in an scientific way:

    [global]\\
April 17, 2006, at 10:30 PM by StormLogiX -- typo
Changed line 45 from:
  1. After that we just have to add this to the samba configuration. For this we will create a new file /etc/samba/user_smb.conf. This file is parsed automatically by the Linksys firmware just after parsing the default /etc/samba/smb.conf and has the advantage that it will not get overwritten if you cange anything using the web interface:\\
to:
  1. After that we just have to add this to the samba configuration. For this we will create a new file /etc/samba/user_smb.conf. This file is parsed automatically by the Linksys firmware just after parsing the default /etc/samba/smb.conf and has the advantage that it will not get overwritten if you change something using the web interface:\\
April 17, 2006, at 10:15 PM by StormLogiX -- first version
Added lines 1-84:

Create A Single Samba Share For 2 Harddisks

This is so you be able to mount both harddisk in Windows ("Map Network Drive") by using only one drive letter. So you will only need to map 1 drive letter for both harddisks attached to port 1 and 2 on the NSLU2.

Note:

This presumes that you have unslung 6.8 installed on your nslu2

Steps:

  1. Login to the NSLU2 using SSH or Telnet.
  2. Change to the /share directory:

    cd /share
  3. This directory contains two automatically created directories for mounting the harddisks attached on port 1 and 2:
    /share/hdd is for harddisk on port 1
    /share/flash is for harddisk on port 2
    Usually the default samba configuration will share /share/hdd as "DISK 1" and /share/flash as "DISK 2" automatically. The idea of this howto is to create your own share which will internally contain links to both /share/hdd and /share/flash.
    For this purpose we will create a new directory under /share and call it e.g. "public":

    mkdir /share/public
  4. Now you must change ownership and access of this directory to match those of the other two predefined folders (or you will not be able to access this directory using smb):

    chown admin:everyone /share/public
    chmod a+rwx,o-w /share/public
  5. Now create symbolic links to the directories that you want to share. In our case it is the public share on both harddisks (but you can put links to anything else you like):

    ln -s /share/hdd/data/public /share/public/disk1
    ln -s /share/flash/data/public /share/public/disk2
  6. After that we just have to add this to the samba configuration. For this we will create a new file /etc/samba/user_smb.conf. This file is parsed automatically by the Linksys firmware just after parsing the default /etc/samba/smb.conf and has the advantage that it will not get overwritten if you cange anything using the web interface:

    vi /etc/samba/user_smb.conf

    --insert--

    [share]
    valid users=@"administrators",@"everyone"
    comment=The share for everyone
    path=/share/public
    read only=yes
    write list=@"administrators",@"everyone"
  7. Optionally, if you want to disable the ugly built-in predefined shares by Linksys (ADMIN # and DISK #), you can add this to the user_smb.conf:

    [ADMIN 1]
    browsable=no

    [ADMIN 2]
    browsable=no

    [DISK 1]
    browsable=no

    [DISK 2]
    browsable=no
  8. Moreover, I found this somewhere in the wiki and found it to be usefull to increase reading and writing speed, but I haven't benchmarked it in an scientific way:

    [global]
    socket options = TCP_NODELAY SO_KEEPALIVE IPTOS_LOWDELAY SO_SNDBUF=65535 SO_RCVBUF=65535

Outcome

Now you don't have to reboot or anything after this. Just browse your network using Windows "My Network Places", find the NSLU2 and map the the folder "share" to a drive letter of your liking.

Under "share" you should see folders which internally links to the share on both of your attached harddisks.

view · edit · print · history · Last edited by StormLogiX.
Based on work by StormLogiX and thekitehunter.
Originally by StormLogiX.
Page last modified on May 05, 2006, at 08:55 PM