# Remote mount from mfsBSD



## balanga (Oct 18, 2022)

Is there any way of mounting a remote drive when booting from mfsBSD?


----------



## Alain De Vos (Oct 18, 2022)

If you install the necesarry packages you can mount an NFS-share or ISCSI or SSHFS , over IP.


----------



## balanga (Oct 18, 2022)

Which packages? And how do I install them?


----------



## Phishfry (Oct 18, 2022)

For NFS no packages needed. (iSCSI either)
Setup remote drive machine as NFS server with desired remote drive directory as export.
Setup mfsBSD as NFS client.

```
#
### NFS Client ####
nfs_client_enable="YES"
nfs_client_flags="-n 4"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
#
```

Set mfsBSD /etc/fstab to mount remote NFS Server export at bootup.
You will want to use the the `failok` flag for the remote mount.
That way if it can't find the remote drive it will not crash the client machine.


----------



## balanga (Oct 19, 2022)

Phishfry said:


> For NFS no packages needed. (iSCSI either)
> Setup remote drive machine as NFS server with desired remote drive directory as export.
> Setup mfsBSD as NFS client.
> 
> ...


Not sure what you mean.... I'm using an mfsBSD iso. When I try to mount an NFS share I get:-

tcp: Netconfig database not found

which suggest that something is missing from the mfsBSD image.
It would be nice to know should be included to make this work.


----------



## Alain De Vos (Oct 19, 2022)

do you see the file /etc/netconfig ?


----------



## Alain De Vos (Oct 19, 2022)

tcp: Netconfig database not found
					

I'm trying to mount an NFS share when PXE booting mfsBSD.   Any idea what's missing? I do realise that mfsBSD is a minimal installation of FreeBSD, but if I knew what was required to run an NFS client, maybe I could add it.




					forums.freebsd.org
				



You will have to rebuild the kernel with these options and copy over the mfbsd image.


----------



## balanga (Oct 19, 2022)

Alain De Vos said:


> tcp: Netconfig database not found
> 
> 
> I'm trying to mount an NFS share when PXE booting mfsBSD.   Any idea what's missing? I do realise that mfsBSD is a minimal installation of FreeBSD, but if I knew what was required to run an NFS client, maybe I could add it.
> ...


Looks like I've been trying to figure this out for a while, but couldn't figure out how to add the required options to build mfsBSD.


----------



## Alain De Vos (Oct 19, 2022)

I've asked the question. I don't know myself. Let's see.








						How to recompile mfbsd kernel with NFS ? · Issue #137 · mmatuska/mfsbsd
					

I want to recompile the kernel used by mfsbsd with NFS included, i.e. KERNCONF option NFSCL option NFSD option NFSLOCKD option NFS_ROOT I've extracted base.txz to the good location. Then : make...




					github.com


----------



## Alain De Vos (Oct 19, 2022)

I think you need something like,

make iso CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1









						mfsbsd/BUILD.md at master · mmatuska/mfsbsd
					

mfsBSD. Contribute to mmatuska/mfsbsd development by creating an account on GitHub.




					github.com


----------



## Alain De Vos (Oct 19, 2022)

I wonder why NFS is not in the kernel of mfbsd ? Where is the location of the configuration of that ?
Do you have a custom KERNCONF on your system ?


----------



## T-Daemon (Oct 19, 2022)

In case of NFS there is no package to install or configuration needed to mount a share.

balanga, I just checked it: cloned git repository, build image (13.1-RELEASE), boot mfsbsd (in VirtualBox in my case), mount NFS share from a 13.1-RELEASE server:

`mount -o nfsv4 <nfs-server-ip>:/   /mnt/d1`
`mount  <nfs-server-ip>:/dir   /mnt/d1`

If there is an mount error, then it's probably an issue on the server side.

Can you ping the server? If it's a NFSv3 server, what does `showmount -e <nfs-server-ip>` show? How does on the server the /etc/exports file look (eventually redact domain names and/or IP's)?


----------



## Alain De Vos (Oct 19, 2022)

I already had the impression mfsbsd uses the default kernel which normally has NFS.
T-deamon you have the file /etc/netconfig ?


----------



## T-Daemon (Oct 19, 2022)

Alain De Vos said:


> I already had the impression mfsbsd uses the default kernel which normally has NFS.
> T-deamon you have the file /etc/netconfig ?


It is present.

Regular 13.1-RELEASE

```
% ls /etc/net*
/etc/netconfig        /etc/netstart        /etc/network.subr    /etc/networks
```

mfsbsd 13.1


----------



## Alain De Vos (Oct 19, 2022)

This suggest Balanga has a mis-configuration. Which can happen to anyone.
According to my analysis mfsbsd uses the DEFAULT or GENERIC kernel.


----------



## balanga (Oct 19, 2022)

T-Daemon said:


> It is present.
> 
> Regular 13.1-RELEASE
> 
> ...


I tried to PXE boot mfsbsd-mini-13.1-RELEASE-amd64.iso but I get numerous errors which I'm unable to capture, although most mention various 'screen*' files. mini-12.2 works fine using the same PXE entry.


----------

