How-to set a Linux NFS server-client share

gorski

Well Known Member
Messages
1,553
Here's what I did, quickly described:

1) On Synology DS210j NAS, I created the shared folders [I will mention them later on].

2) Then, I activated NFS [Linux streaming protocol, as opposed to Windows, CIFS].

3) I also created a user AZboxHD [with all the details, as you will see, including the password]. Otherwise all else is done from admin account, with a password. One needs to give rights to that user [Write/Read according what your needs are, in various folders].

4) Each Shared Folder needs to be edited -> NFS Privileges. Here I gave them to my AZbox HD in the form of its IP address [192.168.x.x].

Even though I have a admin account with username/password to log in - it is then not necessary, when you do the

5) Settings in Priority Manager:

NFS_MOUNT=1


REMOTE_IP=192.168.x.x


CHECK_PATH=/DATA/movie -> this is because I have no HDD attached to my AZbox HD, otherwise [if you do have an internal or external USB HDD] BuyukBang tells me one should create a new, different folder from the default one and then the CHECK_PATH and the following lines differ slightly.

Here are mine [for DS210j NAS, which is seen as having "volume1" as its storage capacity + the Sharing Folders, as you can see below = video, music, photo and TVrecord]:

Code:
 NFS[1]="mount -t nfs -o nolock,rsize=8192,wsize=8192 192.168.x.x:/volume1/video /DATA/movie"
 NFS[2]="mount -t nfs -o nolock,rsize=8192,wsize=8192 192.168.x.x:/volume1/music /DATA/music"
 NFS[3]="mount -t nfs -o nolock,rsize=8192,wsize=8192 192.168.x.x:/volume1/photo /DATA/picture"
 NFS[4]="mount -t nfs -o nolock,rsize=8192,wsize=8192 192.168.x.x:/volume1/TVRecord /DATA/recordfile"
5a) Here are my other settings from his PM 1.8 Beta, that I am testing [you must do your own, according to your setup and needs/preferences!!!]:

Code:
#!/bin/sh
 # PRIORITY MANAGER V1.8 BY BUYUKBANG
 #---------------------------------------------------------------------------------------#
 PRIORITY_MANAGEMENT=1
 KILL_TV_EMU=0 
 #---------------------------------------------------------------------------------------#
 HIDDEN_CHN_LST_PASS=00000
 #---------------------------------------------------------------------------------------#
 DOM_SPEED=1
 #---------------------------------------------------------------------------------------#
 UPGRADE_BUSYBOX=1
 #---------------------------------------------------------------------------------------#
 CRON=0
 #---------------------------------------------------------------------------------------#
 SWAPPER=1
 SWAPSIZE=204800            # ==> SIZE OF SWAP FILE IN BYTES.
 SWAPDEVICE=/DATA/usb1/sda1
                            # ==> CHOOSE DEVICE, WHERE TO CREATE SWAPFILE
                            # FOR INTERNAL HDD DISK SET SWAPDEVICE AS  : /DATA/hdb1
                            # FOR USB1 HDD/FLASH DISK SET SWAPDEVICE AS: /DATA/usb1/sda1
                            # FOR USB2 HDD/FLASH DISK SET SWAPDEVICE AS: /DATA/usb2/sda1
 #---------------------------------------------------------------------------------------#
 DEEP_SLEEP=0
 #---------------------------------------------------------------------------------------#
 MOVE_PLUGINS=0
 #---------------------------------------------------------------------------------------#
 SCHEDULED_BACKUP=0
 #---------------------------------------------------------------------------------------#
 ACTIONS=0
 #---------------------------------------------------------------------------------------#
 CIF_MOUNT=0
 #--------------------------------------------------------------------------------------#
 VERBOSE_MODE=0
BuyukBang will explain in more detail other possibilities, as in Linux there are always more ways to do the same thing...

My experience with streaming from my Synology DS210j NAS so far:

AVI - no problem.

VOB [DVD files] - no problem!

IMAX.Ride.Around.The.World.2006.1080p.BluRay.x264.mkv, with DTS sound -> drop-out just once, for a fraction of a second and a picture slow down for about 5 - 10 secs at one point [19th minute].

At the same time I was copying large files onto my NAS from a USB HDD attached to it.

Later on, I also tried a couple of concerts, mkv 1080, with DTS. Similar results. Watchable!!! Occasionally your picture will slow down for a few secs and DTS drop-outs will happen rarely! But it's watchable!

In fact, I am impressed!!!!!!!!!!!!!!!!

Both with what BuyukBang has done and with Synology DS210j NAS!!!

But I have to somewhat change my perception of AZbox HD accordingly, I'm afraid.... It's not as bad as it seemed initially, when it comes to streaming to AZbox HD. One needs a Linux based NAS or PC, with NFS installed and properly configured and... maybe... Windows based sharing [CIFS] is more limited, it seems...
 

gorski

Well Known Member
Messages
1,553
Ooooohhh, yeahhhhh!!!!! :D

I just love it when things are working!!!! ;)

You know, you buy something and after some learning - after all said and done, you actually can set it up so it is working really well.... ;)

Synology DS210j NAS only has 800 MHz processor and 128 MG RAM but with Linux OS and everything nicely sorted inside, with minimal power usage - it is all working really well!!!

So, with your oh, so cool script and my perseverance... it works!!! :cool:

Now, if we could just do one more thing: get AZbox HD to record directly onto NAS.... ecchhhh... :D
 

buyukbang

Registered
Messages
33
I'll try this, we'll see.

Ooooohhh, yeahhhhh!!!!! :D

I just love it when things are working!!!! ;)

You know, you buy something and after some learning - after all said and done, you actually can set it up so it is working really well.... ;)

Synology DS210j NAS only has 800 MHz processor and 128 MG RAM but with Linux OS and everything nicely sorted inside, with minimal power usage - it is all working really well!!!

So, with your oh, so cool script and my perseverance... it works!!! :cool:

Now, if we could just do one more thing: get AZbox HD to record directly onto NAS.... ecchhhh... :D
 

gorski

Well Known Member
Messages
1,553
IT IS WORKING!!!! :D

I managed to record from AZ [in]directly to NAS, as indicated by Keibertz!! I tried this morning and it worked better.

Last night it was idx temporary files and it wasn't stable, blocked my laptop and NAS, so I had to reboot etc.

When I started recording it was creating tmp.idx files and idx files, which were not playable. Anyways, there were plenty of difficulties...

But this morning it was cool! It created TS files and it was playable, it was all functioning pretty well, I am very pleased to say. Some jerky moments, but overall it was good!

One thing I noticed is that it needed a few times to delete all that was there, each time showing me more stuff I tried recording at different attempts, which kinda failed and needed to be deleted - almost as if it was done in layers, so I had to delete it in layers, one at a time...

One more thing: my 1GB USB Memory Stick is also losing the SWAP file after deleting this stuff. I can't see it in HOME -> File Manager -> USB1 -> SDA1. Even after a few reboots, sometimes... Weird... One can see that USB1 is there, just SWAP is lost...

So, as you said, Keibertz, it is possible to do it via USB memory stick, mounting it that way. In Settings, under Storage I have 1.1 TB free, which means AZ really sees my NAS!!!

This is what I did, according to Keibertz & co. Wiki article plus what we discussed here before, in detail...

1) Telnet command to mount the folder necessary for recording via USB memory stick to NAS:

Code:
mount /dev/sda /DATA/usb1

2) A line in BB's PM 1.8, under "Mount NFS folders" in the Settings file:

Code:
NFS[4]="mount -t nfs -o nolock,rsize=8192,wsize=8192 192.168.x.x:/volume1/TVrecord /DATA/usb1"

192.168.x.x = the IP address of my NAS

/volume1/TVrecord = the folder on my NAS I want to record to, of course, and

/DATA/usb1 = the roundabout taken to mount the NAS folder for recording, as the WIKI article states. This is where one will find the recordings, under SDA1, if one goes HOME -> File Manager -> USB1 -> SDA1 -> recordfile [the way I set it up for my needs].

THANX A BUNCH for the advice and details, as with a little bit of patience and perseverance I managed to sort it out!!!

Thanx Synology for the great little home NAS DS210j!!!

Thanx BuyukBang for PM 1.8! Great little piece of work!!!

Thanx Zeini, Keibertz and co. for the Wiki articles and advice here!!!

ZIVJELI!!! PROST!!! CHEERS!!! OLE!!!! :)
 

buyukbang

Registered
Messages
33
@gorski,

As I promised you I tested recording to NFS mount today. The result was perfect, no freezes, no glitches. I just activated NFS mount feature of Priority Manager and added below setting:

NFS[1]="mount -t nfs $REMOTE_IP:/download /DATA/hdb1/recordfile/ -o nolock,rsize=32768,wsize=32768"

Code:
NFS[1]="mount -t nfs $REMOTE_IP:/download /DATA/hdb1/recordfile/ -o nolock,rsize=32768,wsize=32768"
In this line I used "/DATA/hdb1/recordfile/" because I have an internal HDD and "/DATA/recordfile directory" is automatically mapped to "/DATA/hdb1/recordfile/" by the firmware while booting. So if there is no HDD, a flashdisk can help. In this situation below lines can be used:

If flashdisk inserted into usb1 port:

Code:
NFS[1]="mount -t nfs $REMOTE_IP:/download /DATA/usb1/sda1/recordfile/ -o nolock,rsize=32768,wsize=32768"
If flashdisk inserted into usb2 port:

Code:
NFS[1]="mount -t nfs $REMOTE_IP:/download /DATA/usb2/sda1/recordfile/ -o nolock,rsize=32768,wsize=32768"
When using Priority Manager, this is all needed for recording to NFS mounts.
 

gorski

Well Known Member
Messages
1,553
Thanx!:)

I noticed the change: "rsize=32768,wsize=32768".

What if we do it for all the folders?:confused:

Cheers!:thum:
 

gorski

Well Known Member
Messages
1,553
The Synology guys said I should only sort out the settings in the client, i.e. AZ HD, not Synology.

To the NFS issue, we guess that you want to increase the wsize and rsize between the NFS client (your media player) and server (the DS210j). If it's true, this kind of setting should be configured in the NFS client. So you could check if your NFS client supports this kind of parameter. Here is also an example to setup wsize and rsize in the NFS client:

Code:
http://www.debianhelp.co.uk/nfs.htm

Did that [rsize=32768,wsize=32768] and recorded...

1) SD was fine. Watching it straight from satellite is nearly perfect. Reproducing the recorded film from NAS to AZ HD is almost as good. Perfectly watchable!!!

2) However, HD was not watchable, sadly. Too many little freezes etc.
 

spinmar

Registered
Messages
9
IT IS WORKING!!!! :D

I managed to record from AZ [in]directly to NAS, as indicated by Keibertz!! I tried this morning and it worked better.

Last night it was idx temporary files and it wasn't stable, blocked my laptop and NAS, so I had to reboot etc.

When I started recording it was creating tmp.idx files and idx files, which were not playable. Anyways, there were plenty of difficulties...

But this morning it was cool! It created TS files and it was playable, it was all functioning pretty well, I am very pleased to say. Some jerky moments, but overall it was good!

One thing I noticed is that it needed a few times to delete all that was there, each time showing me more stuff I tried recording at different attempts, which kinda failed and needed to be deleted - almost as if it was done in layers, so I had to delete it in layers, one at a time...

One more thing: my 1GB USB Memory Stick is also losing the SWAP file after deleting this stuff. I can't see it in HOME -> File Manager -> USB1 -> SDA1. Even after a few reboots, sometimes... Weird... One can see that USB1 is there, just SWAP is lost...

So, as you said, Keibertz, it is possible to do it via USB memory stick, mounting it that way. In Settings, under Storage I have 1.1 TB free, which means AZ really sees my NAS!!!

This is what I did, according to Keibertz & co. Wiki article plus what we discussed here before, in detail...

1) Telnet command to mount the folder necessary for recording via USB memory stick to NAS:

Code:
mount /dev/sda /DATA/usb1

2) A line in BB's PM 1.8, under "Mount NFS folders" in the Settings file:

Code:
NFS[4]="mount -t nfs -o nolock,rsize=8192,wsize=8192 192.168.x.x:/volume1/TVrecord /DATA/usb1"

192.168.x.x = the IP address of my NAS

/volume1/TVrecord = the folder on my NAS I want to record to, of course, and

/DATA/usb1 = the roundabout taken to mount the NAS folder for recording, as the WIKI article states. This is where one will find the recordings, under SDA1, if one goes HOME -> File Manager -> USB1 -> SDA1 -> recordfile [the way I set it up for my needs].

THANX A BUNCH for the advice and details, as with a little bit of patience and perseverance I managed to sort it out!!!

Thanx Synology for the great little home NAS DS210j!!!

Thanx BuyukBang for PM 1.8! Great little piece of work!!!

Thanx Zeini, Keibertz and co. for the Wiki articles and advice here!!!

ZIVJELI!!! PROST!!! CHEERS!!! OLE!!!! :)
Hi gorski,
I have a problem to record to my dreambox hdd.
I have nfs server on dreambox started and I configured the server to open to my azbox client.
Then I tried to follow your step.
I insert a usb memory stick (1G fat32) on my azbox and the I tried:

MMP[~]$ mount /dev/sda /DATA/usb1

But I get an error:

mount: Mounting /dev/sda on /DATA/usb1 failed: Device or resource busy

What am I missing?
Best regards

Marco
 

spinmar

Registered
Messages
9
No.
Your command gives me always the same error.
Anyway It seems that the problem is using mgcamd as client to external server (my dreambox dm8000), decoding encryped content, and record on nfs server....
It only creates a small file if yoy try to recod....
I could use one other client (multicas for example) but I'd like to understand why mgcamd have this problem...
 

spinmar

Registered
Messages
9
MMP[~]$ mount /dev/sda /DATA/usb1

mount: Mounting /dev/sda on /DATA/usb1 failed: Device or resource busy

with a usb memory stick formatted as ext2.
 

gorski

Well Known Member
Messages
1,553
It depends...

NewCS is not necessarily off, neither is Priority Manager, possibly...

So, as I said, install it all from scratch but the USB memory stick as soon as possible...
 

daemonas

Registered
Messages
19
How-to set a Linux NFS server-client share (fixed some grey lines...)

We are installing nfs-kernel-server, nfs-common, portmap if not allready installed.
Must comment (#) loopback, in /etc/default/portmap in case its uncommented, or use following commands e.g:

sudo dpkg-reconfigure portmap
sudo /etc/init.d/portmap restart


Next we are editing /etc/exports file on our server, as should be an access control list for filesystems which may be exported to NFS clients, e.g:

/DATA/music xxx.xxx.xxx.xxx(rw,no_root_squash,async,no_subtree_check)
;#; for read-write access, where /DATA/music is dir to be shared and xxx.xxx.xxx.xxx is host to allow access (ip address),
or
/DATA/music xxx.xxx.xxx.xxx(ro,async,no_subtree_check)
;#; for read-only

We can export dirs for movies as well pictures the same way.
Also we can use other drives in net after mounting them in our server's described mount point.
We can use similar dir names, as, our multimedia player or our linux stb, uses.
Then we execute following commands as su

sudo exportfs -a
;#; for exporting fs to NFS clients
sudo /etc/nfs-kernel-server restart
;#; for starting NFS server service in our server.

That's all for server part, it works fine for me, using ubuntu server and busybox client (AZBox Premium ;-)

Next, assuming our client is ready to be nfs client, we are just mounting above mentioned server mounts, to similar empty ones in client, we have just created or allready existent.
Even if we have installed an internal sata hdd in our client and we have lets say dir /DATA/hdb1/music on it, we are proceeding to final step after login in to client and we can use /DATA/music as mount point in AzBox'es internal HDD sdb1 without any problem. Works just fine e.g:

telnet xxx.xxx.xxx.xxx ;#;ip-address.of.our.client
uid: ......
passwd: ........


after connecting we may restart following services just to be sure e.g:
(only for clients others than AzBox.
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-common restart

then we mount shared point typing:

mount xxx.xxx.xxx.xxx:/DATA/music /DATA/music
;#; where xxx.xxx.xxx.xxx is our server's ip address

(mount point "/DATA/music", by the way is default in azbox firmware.)

For security reasons and for clients others than AzBox (e.g other Laptop or Desktop) we can fix also hosts.allow & hosts.deny files in /etc

if everything's fine after a bit we can see our server's share.
In case of AzBox share appears inside default dirs (/DATA/music, /DATA/movie, /DATA/picture.)

There are a lot of scripts for automate procedures and not retyping the same things every time needed and all are well covered in others posts.

Hope corrections made it easier

daemonas

PS:
huge thanks to thousands of web users who are always helping each other on learning almost everything...,
as well to "gorski" whose azbox alternative's guides, are always piece of art ;-)
 
Last edited:
Top