Showing posts with label NAS. Show all posts
Showing posts with label NAS. Show all posts

Saturday, 21 February 2009

Can't See my FSG3 Shares on Mandriva

Following the installation of Mandriva Linux on my desktop PC, I have been unable to simply access shares on my FSG3 Network Storage box.

I use the browse shares, but the contents of the FSG3 always appear empty. I can mount the share manually, by typing:
smb://media/sharename
But I can't browse all of the shares. On looking at the smb.conf file (which is located on the FSG3 in the /usr/local/samba/lib directory, it is clear that it doesn't actualy have any specified ones (unless you are the administrator).

I have therefore modified the /usr/local/samba/lib/smb.conf file to include a 'HOME' section, as shown below.
[global]
workgroup=LOCAL
netbios name=media
server string=Freecom StorageGateway
security=user
encrypt passwords=Yes
null passwords=Yes
admin users=admin
disable spoolss=Yes
max log size=50
socket options=TCP_NODELAY SO_RCVBUF=65536 SO_SNDBUF=65536
use mmap=Yes
use sendfile=Yes
lock directory=/ramdisk/samba

[FSG]
comment=Admin access to entire disk
path=/home
writeable=Yes
browseable=No
valid users=admin
create mode=0666
directory mode=0777

[HOME]
comment=Home directories
path=/home
writeable=Yes
browseable=Yes
create mode=0664
directory mode=0775
Following this update, the server is re-started:
/etc/init.d/samba stop
/etc/init.d/samba start
I can now browse to smb://media/home, and see all of the user areas. Note that unix file and directory permissions still apply, and that you have to be logged in as the correct user, and be in the correct group.

Saturday, 15 September 2007

My Windows Vista Machine cannot access my NAS Shares

After falling over in the house, and pushing my crutches through the screen of my laptop, I’ve replaced it with another one - this is running Vista.

The very first problem I encountered was that I couldn’t see any of the network shares that I used to see on my old XP machine. After a lot of searching, it seems that Microsoft have beefed up the network file sharing security, and made Vista incompatible with old file sharing system security features by default.

There is a registry hack to re-enable this old mode (Using regedit to set the LMcompatibilityLevel to 1).

I have since found that my PC is very slow copying files on the network - to copy 400 files, totalling just 1Mb from a zipfile onto a network drive took 50 (yes Five Zero) minutes.

The real solution is to upgrade the server software at the other end to be compatible. I’m running samba on a Freecom Network Storage Box (FSG3), and upgrading to the latest firmware, which includes samba version 3, has allowed these shares to be seen again.

This may not be the end - at the moment, the machine seems to be running OK.

There is a hotfix available from Microsoft (Knowledge Base Article 931770 - The copy process may stop responding when you try to copy files from a server on a network to a Windows Vista-based computer), but I’ve not applied it at the moment….

Sunday, 9 September 2007

Running a DNS Server on an FSG3 Network Storage Box

I have a NAS box in the house, which is used to store my music and video. In the house, also, I have an internet radio / media player, and a networked satellite receiver, and of course, a webserver which recognises several different names (virtual hosts) to direct the access to different directories.

I want to be able to refer to these devices by name, rather than IP address, but I don’t want to go around hacking hosts files on every machine - the solution is to use a named server, and point all the machines in the house towards it. This has the advantage that I can override the internet recognised domain (e.g. trumpton.org.uk), to divert the address locally.

I have just upgraded my FSG3 to the latest kernel (2.6).

Firstly, I needed the name server (in a package called bind), and a dependant package (openssl). I downloaded bind_9.3.4-1_armeb.ipk and openssl_0.9.7m-2_armeb.ipk, and installed them on the FSG3 with the ipkg command.

Next, I created the name server files. Rather than storing them in the default /opt directory, I have decided to install them into /home/named - this means that the files will be retained following any firmware upgrade (on this particular device).

Note that in these files, a semicolon indicates the start of a comment, not the end of a line. If there are no comments, no semicolons are needed.

The first file is named.conf:

options {
pid-file “/home/named/named.pid”;
directory “/home/named”;
port 53;
};

// Internet Root Servers
zone “.” {
type hint;
file “root.zone”;
};

// Local Host Loopback
zone “0.0.127.in-addr.arpa” {
type master;
file “db.local”;
};

// Local network Addresses
zone “local” {
type master;
file “local.network”;
};

// Local netork Reverse Addresses
zone “14.168.192.in-addr.arpa” {
type master;
file “rev.local.network”;
};

// trumpton.org.uk
zone “trumpton.org.uk” {
type master;
file “trumpton.org.uk”;
};

The file contains pointers to all of the named configuration files - the options section identifies where files reside, the zone sections identify the forward (i.e. loking up www.trumpton.org.uk) and the reverse (i.e. looking up 192.168.14.1) files. The special zone file ‘.’ has pointers to other servers on the internet for the various naming authorities (RIPE, ARIN etc..).

The ’local’network’ file contains the names for the local (internal) network:

@ IN SOA webserver.local. junkmail.trumpton.org.uk. (
2006012103; serial
28800; refresh, seconds
7200; retry, seconds
604800; expire, seconds
86400 ); minimum, seconds;
NS web.local.;
;
MX 10 web.local.;
;
local. A 192.168.14.1
internet A 192.168.14.1
cam 192.168.14.100
desktop A 192.168.14.101
satbox A 192.168.14.102
nasmedia A 192.168.14.103
netradio A 192.168.14.104

web A 192.168.14.105

The part at the top of the file is used to put a timestamp on the file, and tell other servers on a network how often they should be updated. The list following, gives the names of all of the machines, and their corresponding IP addresses.

Of course, if you have an IP address, and want to know the machine name, you need reverse lookups - that is what the rev.local.network is for:

@ IN SOA webserver.local. junkmail.trumpton.org.uk. (
2006012103; serial
28800; refresh, seconds
7200; retry, seconds
604800; expire, seconds
86400 ); minimum, seconds;
NS web.local.;
;

1 PTR internet.local.
100 PTR cam.local.
101 PTR desktop.local.
102 PTR satbox.local.
103 PTR nasmedia.local.
104 PTR netradio.local.
105 PTR web.local.

The file ‘trumpton.org.uk’ contains the name lookups. Note, however, the MX entries here - these point to my service provider’s mail exchange, as in my case, all mail goes through their servers, and I do not run my own mail server. If I did, these would simply point to ‘trumpton.org.uk’. Note the ‘.’ at the end of a name - if the dot exists, it indicates that this is the end of the name, and if it is missing, the domain specified in the named.conf file for this particular file is appended.

@ IN SOA webserver.local. junkmail.trumpton.org.uk. (
2006012103 ; serial
28800 ; refresh, seconds
7200 ; retry, seconds
604800 ; expire, seconds
86400 ; minimum, seconds
) ;

NS web.local.;
;
MX 10 easymx2.easily.co.uk.;
MX 10 rhea.easily.co.uk.;
;
trumpton.org.uk. A 192.168.14.105
www A 192.168.14.105

Once the files are in place, it’s just a matter of editing the S09named script that was installed in the ipkg to refer to the correct directories, copying it to the /etc/rc directory, and starting it with /etc/rc/S09named start.

Im my case, the ‘pidof’ program was missing. Rather than installin the bundle that includes pidof, I created /bin/pidof

PSLIST=”`ps -ef | grep $1 | grep -v pidof | grep -v grep | cut -c1-5`”
echo “$PSLIST”

Now, the computers on the network need to be pointed at this DNS, rather than the firewall’s one. Usually, it is possible to add at least two entries, mine are:

nameserver 192.168.14.1
nameserver 192.168.14.5

Thursday, 15 March 2007

FSG3 Storage Box and Apache

I'm trying to get the Simplemachines Forum working properly on my FSG-3, with the new 2.6 kernel.

Nearly everything works, except for the graphical verification during registration.

This boils down to the missing 'GD Module' support. The installed version of apache is a mini-version, with a few compiled in modules, and excludes the graphics one.

Unfortunately, the apache in the ipkg feed does not have this feature either, so I begin my quest to cross-compile apache.

I have already got the crosstools installed, and have GCC-3.4.4 with GLIBC-2.3.6 for armeb installed (required for the FSG3v4).

The steps taken are:

  • Download the Apache source
  • Download the GDLib Module
  • Build the APR and APR-UTILS programs and install
  • Configure Apache for cross-compiling
  • Build

Download the Apache source

The Apache HTTPD source can easily be found on the Apache Website.

Download the GDLib Module

...

Build the APR and APR-UTILS programs and install

Apache is a bit stupid when you try and build it for a cross-compiling architecture. If apr and apr-utils are not installed, it will try and compile them for the destination processor, and then complain that they won't execute on the local processor.

It is important to install these apps before configuring Apache.

Ensure that the native machine's gcc is in the path, and:

cd apache-source-directory
su -
( cd srclib/apr ; ./configure --prefix=/usr/local/apr-httpd/ ;
make ; make install )
( cd srclib/apr-util ; ./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/us/local/apr-httpd/ ; make ; make install
)

Configure Apache for Cross-Compiling

Configure HTTPD

cd ../../
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/

Build