[Help] NFS Root Path & Exports

Discussion about using NAS on Linux and Unix OS.

[Help] NFS Root Path & Exports

Postby KillerkelvUK » Thu Aug 25, 2011 7:02 pm

Hi, since the new 3.5.0 fw introduced functionality for specifying a DHCP Boot File and a TFTP server I've been playing around getting several different PXE boot environments up and running directly from my 259. Last night after several hours and several attempts I eventually managed to get a Ubuntu LiveCD booting over the network using a NFS share which contained the mounted CD image. The main stumbling block I had was specifying the nfsroot= in the "/pxelinux.cfg/default" file and I was wondering whether there is a better solutions than what I did to get this working...

For the working solution I created a share called 'NFS_Ubuntu' and specified Read Only for the NFS Access Control and in this share I mounted the Ubuntu LiveCD image by adding a line into the "/etc/fstab".

The PXE boot files I put in "/Filestorage/PXE/TFTPRoot/pxelinux.cfg/" and the contents of my 'default' file is as follows...

Code: Select all
DEFAULT /pxelinux.cfg/menu.c32

LABEL Ubuntu Livecd 11.04
MENU DEFAULT
KERNEL Ubuntu/casper/vmlinuz
APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.1.100:/share/MD0_DATA/NFS_Ubuntu/ initrd=Ubuntu/casper/initrd.lz


..."nfsroot=192.168.1.100:/share/MD0_DATA/NFS_Ubuntu/"

With all the above as specified my client booted off the network and successfully gets into Ubuntu which is great! :D

However my original attempt was to mount the Ubuntu LiveCD into "/Filestorage/PXE/TFTPRoot/Ubuntu/", specify Read Only NFS Access Controls with a 'default' file of...

Code: Select all
DEFAULT /pxelinux.cfg/menu.c32

LABEL Ubuntu Livecd 11.04
MENU DEFAULT
KERNEL Ubuntu/casper/vmlinuz
APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.1.100:/share/MD0_DATA/Filestorage/PXE/TFTPRoot/Ubuntu/ initrd=Ubuntu/casper/initrd.lz


..."nfsroot=192.168.1.100:/share/MD0_DATA/Filestorage/PXE/TFTPRoot/Ubuntu/"

This just generated errors during the boot sequence which eventually droped in to an initramfs prompt as it was unable to locate the 'filesystem.squashfs' which was because the boot was unable to mount my nfsroot share with the error "Server denied permission". I then looked at "/etc/exports" and I believe I found the cause...the share is only listed in the exports file up to the 'Filestorage' folder...

Code: Select all
"/share/NFS/Filestorage" *(ro,nohide,async,no_root_squash)
"/share/MD0_DATA/Filestorage" *(ro,nohide,async,no_root_squash)


Am I doing something wrong? Is there a way to specify the nfsroot share further down the directory structure as per my original attempt? Reading some of the various guides found such as https://wiki.ubuntu.com/LiveCDNetboot it would seem a full Ubuntu Desktop install can achieve what I'm trying to do so is this something specific about the QNap?

Thanks in advance,

K
----------------------------------------------------------------------------------
TS-259Pro+, 2x Samsung HD204UI 2TB in Raid 1
Hating QNAP right now for releasing fw 3.8 Build1114! No more guff!
----------------------------------------------------------------------------------
User avatar
KillerkelvUK
Getting the hang of things
 
Posts: 58
Joined: Sat Oct 10, 2009 8:35 pm
Location: North West England
NAS Model: TS-459U

Re: [Help] NFS Root Path & Exports

Postby schumaku » Thu Aug 25, 2011 8:06 pm

Coompare with what you would have to do mounting the Filestorage share on the NAS from an NFS client:

[~] # mount -t nfs [NAS]:/[sharename] [mountpoint] -o nfsvers=3

So start with the sharename here, too - because _that_ is effectively the thingie you want to moint. The /etc/exports stuff is somewat misleading:

nfsroot=192.168.1.100:/Filestorage/PXE/TFTPRoot/Ubuntu/ initrd=Ubuntu/casper/initrd.lz
User avatar
schumaku
Guru
 
Posts: 22141
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
NAS Model: TS-x79 Pro

Re: [Help] NFS Root Path & Exports

Postby tmt » Thu Aug 25, 2011 8:43 pm

KillerkelvUK wrote:I then looked at "/etc/exports" and I believe I found the cause...the share is only listed in the exports file up to the 'Filestorage' folder...


Your exports file is fine, everything under the path is exported, provided it's an actual directory tree (no symlinks or mounts for example).

You're getting a permissions error. Have you checked the permissions? You'll want world permissions to be enabled on all the directories and the actual files from Filestorage on down. Try:

Code: Select all
# cd /share/MD0_DATA/Filestorage
# chmod -R a+rx .
#
SS-439, Ubuntu Server 12.04.2 LTS, EXT4, RAID10, 4xHitachi 5K1000
TS-112, 3.7.3 20120801, EXT4, 1xHitachi 7K1000
tmt
Been there, done that
 
Posts: 973
Joined: Mon Nov 16, 2009 11:02 am
NAS Model: SS-439 Pro

Re: [Help] NFS Root Path & Exports

Postby KillerkelvUK » Fri Aug 26, 2011 2:14 am

Okay so this is weird...

I went through all the permissions and that was all fine, I then started playing around with manually mounting the NFS share in a Ubuntu client to see if I could replicate the error and I could...

"mount -t nfs 192.168.1.100:/share/MD0_DATA/Filestorage/PXE/TFTPRoot/Ubuntu UB/ -o vers=3" would always return the same permissions error however...
"mount -t nfs 192.168.1.100:/share/MD0_DATA/Filestorage/ UB/ -o vers=3" worked fine and even stranger...
"mount -t nfs 192.168.1.100:/share/MD0_DATA/Downloads/sabnzbd/ UB/ -o vers=3" worked fine!

The only difference between the above scenarios is that I'd pre-mounted a .ISO file into the /share/MD0_DATA/Filestorage/PXE/TFTPRoot/Ubuntu on my NAS, by removing the mounted .ISO I was then able to mount the share from the client. All this is stranger still to me as I had it working as described in my original post which was the .ISO mounted into /share/MD0_DATA/NFS_Ubuntu on my NAS and was then mounting this location from my client and all this worked fine?!?! :?:

Does this make sense to anyone? I'm not overly familiar with linux so if someone could explain that would be great :mrgreen:
----------------------------------------------------------------------------------
TS-259Pro+, 2x Samsung HD204UI 2TB in Raid 1
Hating QNAP right now for releasing fw 3.8 Build1114! No more guff!
----------------------------------------------------------------------------------
User avatar
KillerkelvUK
Getting the hang of things
 
Posts: 58
Joined: Sat Oct 10, 2009 8:35 pm
Location: North West England
NAS Model: TS-459U

Re: [Help] NFS Root Path & Exports

Postby schumaku » Fri Aug 26, 2011 2:38 am

Need to escape the sapce in "Ubuntu UB" - something like:

Code: Select all
mount -t nfs 192.168.1.100:/share/MD0_DATA/Filestorage/PXE/TFTPRoot/Ubuntu\ UB/ -o vers=3
User avatar
schumaku
Guru
 
Posts: 22141
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
NAS Model: TS-x79 Pro

Re: [Help] NFS Root Path & Exports

Postby tmt » Fri Aug 26, 2011 2:48 am

KillerkelvUK wrote:The only difference between the above scenarios is that I'd pre-mounted a .ISO file into the /share/MD0_DATA/Filestorage/PXE/TFTPRoot/Ubuntu on my NAS, by removing the mounted .ISO I was then able to mount the share from the client.


You can't export a mounted volume by sticking it in the middle of another path. NFS detects any volume boundary crossing and cuts off the access. If you want to export an ISO, you should use the QNAP gui to make it available as a share, then export it as you would any other.
SS-439, Ubuntu Server 12.04.2 LTS, EXT4, RAID10, 4xHitachi 5K1000
TS-112, 3.7.3 20120801, EXT4, 1xHitachi 7K1000
tmt
Been there, done that
 
Posts: 973
Joined: Mon Nov 16, 2009 11:02 am
NAS Model: SS-439 Pro

Re: [Help] NFS Root Path & Exports

Postby lunarestate » Wed Apr 18, 2012 6:44 am

Hi,

Not much activity on this one lately, but I hope there's still somebody down here who can help me.

I'm also trying to get this pxe-booting to work on a TS-419P II, wanna boot Mint 12, my setup looks a lot as the one posted above. However, I keep running into a strange kernel panic error, see attachment for screenshot.
I configured the tftp-server, I populated the corresponding folder with the pxeboot files, edited 'defautl', set permissions and mounted the iso.
My default in the pxelinux.cfg folder is (I'm not using a menu or ui' to keep it as simple as possible):

Code: Select all
LABEL mint12
DEFAULT mint12/casper/vmlinuz
APPEND boot=casper netboot=nfs nfsroot=192.168.1.100:/share/HDA_DATA/mint12 initrd=mint12/casper/initrd.lz --

What is going on here? I really don't have a clue. I tried a lot of googling and a lot of pxeboot-how-to's, but I keep running into this error. What am I missing? I'm getting the impression that there is something going wrong with nfs part of the setup , but I'm not sure. I configured the specefied folders and permissions via the qnap web interface, I never touched 'exports' or 'nfssettings'.
I also tried an Ubuntu netboot image I found somewhere on their servers, when I pointed 'default' to the designated folder the client just booted, I guess that could count as some sort of proof of concept.
I guess it can be very handy to boot clients from the qnap, I also like to explore the possibility of a fat-client boot, however I can't seem to get this basic part right.

Anybody any ideas?

Thanx
lunarestate
Starting out
 
Posts: 17
Joined: Wed Mar 14, 2012 9:15 pm
NAS Model: TS-x19P II

Re: [Help] NFS Root Path & Exports

Postby KillerkelvUK » Thu Apr 19, 2012 2:30 am

Hi, just tested 'linuxmint-12-gnome-cd-nocodecs-64bit.iso' via PXE boot and got it working no issues on my Acer Aspire One 722. Primary difference is that I extracted the .iso file to a folder structure underneath my TFTP server as such...

0.PXE <--root share
1.TFTPRoot <--as it looks, the root of my TFTP Server
2.Mint <--folder containing extracted .iso
2.ubuntu <-- netinstall extracted .iso
2.an so on...

My pxe config looks like this...

Code: Select all
LABEL mint_test
MENU LABEL linux mint
KERNEL mint/casper/vmlinuz
APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.1.100:/share/MD0_DATA/PXE/TFTPRoot/mint/ initrd=mint/casper/initrd.lz


Just attempted to do the same with a mount .iso and got a mount call failure - permission denied...pretty sure this is something to do with tmt's responce in this thread about where I'm mounting too and from and NFS detecting this as crossing a boundary thingy...yeh what he said :shock:
----------------------------------------------------------------------------------
TS-259Pro+, 2x Samsung HD204UI 2TB in Raid 1
Hating QNAP right now for releasing fw 3.8 Build1114! No more guff!
----------------------------------------------------------------------------------
User avatar
KillerkelvUK
Getting the hang of things
 
Posts: 58
Joined: Sat Oct 10, 2009 8:35 pm
Location: North West England
NAS Model: TS-459U

Re: [Help] NFS Root Path & Exports

Postby lunarestate » Thu Apr 19, 2012 11:21 pm

Thanx for your help man, I've got it running.
I replaced the default boot sequence by a menu, that took care of the strange kernel panic error. Put mint12 folder (with extracted files) into the tftp path, and did chmod a+x. Mint boots, quite fast actually, guess my gigabit lan and server are faster than my optical-drives :lol:
I've got an other question you can maybe answer;
The tftp and dhcp part of my setup are not on the same server, as a consequence my mint client doesn't have any internet connection (I understand this from the forums). I can access everything inside my lan, but not the wan. My dhcp-server is on my wrt54gl router running tomato 1.27, dnsmasq is configured this way:
Code: Select all
dhcp-boot=pxelinux.0,192.168.1.100

The client has a "static dhcp" by mac configured in the router.
Do you maybe know how to solve this problem too?

Thanx
lunarestate
Starting out
 
Posts: 17
Joined: Wed Mar 14, 2012 9:15 pm
NAS Model: TS-x19P II

Re: [Help] NFS Root Path & Exports

Postby KillerkelvUK » Fri Apr 20, 2012 12:02 am

I've never used dnsmasq so no where near an expert but assuming that the 192.168.1.100 address is your TFTP server then you also need to be specifying the default gateway/route, maybe you already are just the code snippet you've shown doesn't include it?

Quick google lead me to the dnsmasq man page where I got the following from..."...For example, to set the default route option to 192.168.4.4, do --dhcp-option=3,192.168.4.4 or --dhcp-option = option:router, 192.168.4.4"

If you're also using the DNS side of dnsmasq then you'll need to ensure this is set up correctly for referring back through your default gateway/router etc.
----------------------------------------------------------------------------------
TS-259Pro+, 2x Samsung HD204UI 2TB in Raid 1
Hating QNAP right now for releasing fw 3.8 Build1114! No more guff!
----------------------------------------------------------------------------------
User avatar
KillerkelvUK
Getting the hang of things
 
Posts: 58
Joined: Sat Oct 10, 2009 8:35 pm
Location: North West England
NAS Model: TS-459U

Re: [Help] NFS Root Path & Exports

Postby sc0ri0n » Wed May 02, 2012 11:03 pm

Hey folks -

I would like to be able to create a PXE environment and serve ubuntu (and later some other distros) from my qnap. Although I understand the concepts at a high level, I have never created such an environment so I am looking for s tep by step guide that explains what to do and why we are doing it.

Any pointers for me?

Thanks!
sc0ri0n
Starting out
 
Posts: 30
Joined: Thu Nov 05, 2009 9:01 am
NAS Model: TS-239 Pro

Re: [Help] NFS Root Path & Exports

Postby lunarestate » Thu May 03, 2012 2:27 am

Hi KillerkelvUK,

Thanx for the reply. I never got the wan connection working for the Mint Live install even with the proper dnsmasq configuration. I did a fatclient install and with the same dsnmasq configuration I'm booting Mint 12 from the Qnap with wan connection. The network information and configuration tool states that the wired connection is unmapped and I'm not able to do any networkconfiguration via the controlpanel. I didn't have the time to figure out how this all fits together, but the whole fatclient setup is working properly.


Hi sc0ri0n,

If you want to setup a fatclient boot you can take a look at this site:
https://help.ubuntu.com/community/DisklessUbuntuHowto
lunarestate
Starting out
 
Posts: 17
Joined: Wed Mar 14, 2012 9:15 pm
NAS Model: TS-x19P II

Re: [Help] NFS Root Path & Exports

Postby sc0ri0n » Thu May 03, 2012 4:36 am

lunarestate wrote:Hi KillerkelvUK,
Hi sc0ri0n,

If you want to setup a fatclient boot you can take a look at this site:
https://help.ubuntu.com/community/DisklessUbuntuHowto


Thanks for response. I really would like to set up my QNAP as the pxe server. I went to SYSLINUX site and downloaded the latest set of files from there.
I gave TS 439 Pro with latest firmware which comes with TFTP server, so I simply enabled it (pointing to 'public' share)
Then, created
/Public/tftpboot/pxelinux.config

I think I need to copy pxelinux.0 file from SYSLINUX/core but then I do not know what else I need to do. Could not find an applicable guide, and still hoping someone in this forum has enough knowledge to tell me more.
sc0ri0n
Starting out
 
Posts: 30
Joined: Thu Nov 05, 2009 9:01 am
NAS Model: TS-239 Pro

Re: [Help] NFS Root Path & Exports

Postby KillerkelvUK » Thu May 03, 2012 2:58 pm

So I put a PXE how to guide together specifically targeted at booting OpenELEC but the same principlas exist no matter what your booting. Plus the guide includes links and other referneces to generic PXE material so have a read through and see what you can make of it.

http://openelec.tv/forum/12-guides-tips-and-tricks/26156-how-to-pxe-boot-network-boot-diskless-bootopenelec
----------------------------------------------------------------------------------
TS-259Pro+, 2x Samsung HD204UI 2TB in Raid 1
Hating QNAP right now for releasing fw 3.8 Build1114! No more guff!
----------------------------------------------------------------------------------
User avatar
KillerkelvUK
Getting the hang of things
 
Posts: 58
Joined: Sat Oct 10, 2009 8:35 pm
Location: North West England
NAS Model: TS-459U

Re: [Help] NFS Root Path & Exports

Postby sc0ri0n » Fri May 04, 2012 2:50 am

I tried to make this all work but seem to having issues with TFTP. The error I get is
"PXE-E32: TFTP open timeout"

Here is what I did:
1) Installed dd-wrt on my cisco linksys E3000 and added the following in "Additional DNSMasq Options":
dhcp-boot=pxelinux.0,192.168.1.11
where IP address points to my QNAP

2) Enabled TFTP service, no change to defaults. I.e. it's pointing to /Public share (/share/Public)
3) Enabled NFS (Network Services > NFS Service).
4) From the GUI, I shared my ubuntu desktop CD as 'ubuntu-desktop-iso'
5) Set the NFS Access control to 'read only' for 'ubuntu-desktop-iso' share ( Access Rights Management > Share Folders > ISO Share Folders > Action )
6) Created tftpboot/pxelinux.cfg/ under "Public" share (which is served by TFTP)
7) Copied necessary files and set the permissions:

Content of /share/Public/tftpboot :
initrd.lz
pxelinuz.0
vmlinuz
ubuntu -> ../../ubuntu-desktop-iso/ // this is symlink to mounted share
pxelinux.cfg/ // this is the folder to host default file


Contents of /share/Public/tftpboot/pxeconfig.cfg/default
LABEL ubuntu-desktop
KERNEL ubuntu/casper/vmlinuz
APPEND ip=dhcp root=/dev/nfs nfsroot=192.168.1.11:/ubuntu-desktop-iso/ initrd=ubuntu/casper/initrd.lz
(I don't actually understand that root=/dev/nfs because there is no /dev/nfs as far as I can tell...)

I think I covered everything about my setup.
So, when I boot a VM from network, it gets and IP and it looks like trying to talk to TFTP but nothing is going on afterwards.

I do not see anything about TFTP in the Qnap 'System Event Logs'.
I looked at /share/Public/opentftpd.log as well, but nothing other 'listening on: 192.168.1.11:69

Any ideas?

p.s. Apologies for zipping up the screenshots but 'rules' for size of the pics does not make it easy to do otherwise.
You do not have the required permissions to view the files attached to this post.
sc0ri0n
Starting out
 
Posts: 30
Joined: Thu Nov 05, 2009 9:01 am
NAS Model: TS-239 Pro

Next

Return to Linux & Unix (NFS)

Who is online

Users browsing this forum: No registered users and 1 guest