LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   How to run NFS Server On Embedded Linux(LSDK, NXP LS1046) (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/how-to-run-nfs-server-on-embedded-linux-lsdk-nxp-ls1046-4175713947/)

nekarose 06-27-2022 11:27 PM

How to run NFS Server On Embedded Linux(LSDK, NXP LS1046)
 
Hi, experts.

I am conducting Linux port up out custom LS1046a board. and I have two reference board LS1046ARDB, LS1045AFRWY. I'm using NXP LSDK tiny linux based on Yocto. So Root file systme was made by busybox. but they doesn't support NFS Server on that I think.

I have included following ALL item in the kernel.
[*] NFS server support[*] NFS server support for NFS version 3
... so on

but After booting up, I can't find /etc/exprots file, /etc/init.d/nfsstart or other NFS related command and scrips(nfs-server or nfs-kernel-services).

Also, I didn't find any NFS command in BusyBox.
as fas as I know, Busybox doesn't support nfs-kernel-server or something like that.

How to progress next step for running NFS server. I checked to mount NFSD, I think it's ok. (mount -t nfsd nfsd /proc/fs/nfsd). Plz help me.

pan64 06-28-2022 12:23 AM

compiling kernel with nfs support will not create files like /etc/exports, you need to do that manually. You need to install nfs server, use something like this:
https://variwiki.com/index.php?title...Setup_TFTP/NFS

nekarose 06-28-2022 12:47 AM

Quote:

Originally Posted by pan64 (Post 6364036)
compiling kernel with nfs support will not create files like /etc/exports, you need to do that manually. You need to install nfs server, use something like this:
https://variwiki.com/index.php?title...Setup_TFTP/NFS

Thank you for your answer.
I already have created /etc/exports. but it didn't work.
and I want to install nfs server the way that site said you mentioned. but My linux doesn't support apt-get command. because that is embedded linux(base on yocto) and using busybox for Root file system.
So I really want to know how to install NFS server using busybox or something.
Should I make NFS command or scripts (such as nfs-kernel-service)?
Is there the other way to run NFS server? don't use scripts?

pan64 06-28-2022 01:00 AM

Quote:

Originally Posted by nekarose (Post 6364040)
I already have created /etc/exports. but it didn't work.

I don't really understand. How should it work at all. What does "it didn't work" really mean?
Quote:

Originally Posted by nekarose (Post 6364040)
and I want to install nfs server the way that site said you mentioned. but My linux doesn't support apt-get command. because that is embedded linux(base on yocto) and using busybox for Root file system.
So I really want to know how to install NFS server using busybox or something.
Should I make NFS command or scripts (such as nfs-kernel-service)?
Is there the other way to run NFS server? don't use scripts?

I have no idea because I don't really know what do you have and how can you install anything on it. Probably others can help you with it. But in general there are two ways:
1. use and official repository and package management tool to install it (you need to check if that is available for you)
2. make it for yourself (=download source code and compile/build it). In that case you need to know how can you do that (or how can you cross-compile it).

You got some answer here: https://community.nxp.com/t5/Layersc...db/td-p/916365
and probably this is useful too: https://community.nxp.com/t5/i-MX-Pr...t/ta-p/1105526

nekarose 06-28-2022 01:33 AM

Quote:

Originally Posted by pan64 (Post 6364043)
I don't really understand. How should it work at all. What does "it didn't work" really mean?

I have no idea because I don't really know what do you have and how can you install anything on it. Probably others can help you with it. But in general there are two ways:
1. use and official repository and package management tool to install it (you need to check if that is available for you)
2. make it for yourself (=download source code and compile/build it). In that case you need to know how can you do that (or how can you cross-compile it).

You got some answer here: https://community.nxp.com/t5/Layersc...db/td-p/916365
and probably this is useful too: https://community.nxp.com/t5/i-MX-Pr...t/ta-p/1105526

"it didn't work' mean that NFS server doesn't work.
I already refered these two site. but I could not figure out what I want to know.
as you said, I think I might have to make it myself (NFS server for ARM). but it is hard to me. Honestly, I dont know where I can get a NFS server source code for ARM64.
There might be easier way to run NFS server than I build source code myself.

In conclustion. What I did
1> included NFS component in kerenl (CONFIG_NFSD, so on)
2> created /etc/exports file manually.
3> can not find any service refered to NFS (service --status-all)
4> verifyed NFSD status is OK (mount -t nfsd nfsd /proc/fs/nfsd)

ondoho 06-28-2022 03:39 AM

I'd like to see your exports file, and messages you get when starting the service(s) with a verbose switch.
Also what you see client-side.

What init system does your install use?
Try
Code:

ps -1
which will probably return sth like /sbin/init.
Now show us
Code:

ls -l /sbin/init

nekarose 06-29-2022 02:46 AM

Quote:

Originally Posted by ondoho (Post 6364067)
I'd like to see your exports file, and messages you get when starting the service(s) with a verbose switch.
Also what you see client-side.

What init system does your install use?
Try
Code:

ps -1
which will probably return sth like /sbin/init.
Now show us
Code:

ls -l /sbin/init

I use busybox init system. I made /etc/exports file manually.
Only one line in it,
/test *(rw,no_root_squash,async)
I tried "ls -l /sbin/init" and returned "/sbin/init -> /sbin/init.sysvinit"
and I can't service related to nfs-kernel-server and nfs-common.
What should I gonnad do?

ondoho 06-29-2022 02:55 AM

Quote:

Originally Posted by nekarose (Post 6364307)
I tried "ls -l /sbin/init" and returned "/sbin/init -> /sbin/init.sysvinit"

use sysvinit tools (like the service command you already used) to start/stop the services in question, and see what sort of log/error/general output you get from that.
Repeat the same from your client.
Show us.
Please use CODE tags for full command output (incl. the command itself) and code (see my signature).

I can help you but I'm not going to walk you through it. Please do web searches and read documentation.

Have you checked NFS documentation if you can use *, which is rather insecure (anyone can mount)?

FWIW, I set up mine thusly, more or less, with minor adaptations:
https://www.vultr.com/docs/setup-nfs-share-on-debian
https://wiki.archlinux.org/index.php/NFS
Both my systems run systemd, not sysvinit.

rnturn 06-29-2022 03:28 AM

Quote:

Originally Posted by nekarose (Post 6364050)
"it didn't work' mean that NFS server doesn't work.
I already refered these two site. but I could not figure out what I want to know.
as you said, I think I might have to make it myself (NFS server for ARM). but it is hard to me. Honestly, I dont know where I can get a NFS server source code for ARM64.
There might be easier way to run NFS server than I build source code myself.

In conclustion. What I did
1> included NFS component in kerenl (CONFIG_NFSD, so on)
2> created /etc/exports file manually.
3> can not find any service refered to NFS (service --status-all)
4> verifyed NFSD status is OK (mount -t nfsd nfsd /proc/fs/nfsd)

What is returned when issuing:
Code:

$ showmount -e
on the system that is supposed to be providing the NFS service? You should see something like:
Code:

Export list for your-server-name:
local-mount-pt-1    allowed-host1,allowed-host2
local-mount-pt-2    allowed-host1,allowed-host2,allowed-host-3
  .
  .
  .
  etc.

Those values come from your /etc/exports file (minus any NFS options: 'ro', 'rw', etc.)

Without seeing your /etc/exports file, it's hard to tell what's going on. It could be due to a syntax error in that file. Can you post it?

nekarose 07-01-2022 12:50 AM

Quote:

Originally Posted by rnturn (Post 6364315)
What is returned when issuing:
Code:

$ showmount -e
on the system that is supposed to be providing the NFS service? You should see something like:
Code:

Export list for your-server-name:
local-mount-pt-1    allowed-host1,allowed-host2
local-mount-pt-2    allowed-host1,allowed-host2,allowed-host-3
  .
  .
  .
  etc.

Those values come from your /etc/exports file (minus any NFS options: 'ro', 'rw', etc.)

Without seeing your /etc/exports file, it's hard to tell what's going on. It could be due to a syntax error in that file. Can you post it?

My Root file system doen't support "showmount" command because That is based on Busybox.
And /etc/exprots file says below.
/test *(rw,no_root_squash,async)

Technically, All I want to know is run NFS Server on Embedded Linux base on Busybox.
this enviroment doen't support general command that is used in Ubuntu, Fedora so on.

ondoho 07-01-2022 01:28 AM

Quote:

Originally Posted by nekarose (Post 6364786)
this enviroment doen't support general command that is used in Ubuntu, Fedora so on.

According to your own output it appears to be running sysvinit init system, which used to be the default on many distros, and still is on some.
Please re-read my previous post.

Can you not install any software?


All times are GMT -5. The time now is 05:22 AM.