This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to mount nfs directory
#1
Exclamation 
Hi,
      I recently purchased the new Asus Tinker Board and installed Debian Linux. After performing some minimal configuration (edit of .bashrc ect) I tried to mount an NFS directory from my server:

mount -t nfs Server:/Path/To/NFS_Directory /usr/local/NFS_Directory

which failed. Anyone have any suggestions? Exclamation
Reply
#2
exports ?
Reply
#3
It might help to give the output of the error message.

Do you have the nfs-common package installed? I don't recall if it is by default.
Is the nfs-client systemd service started? If not, then, sudo systemctl start nfs-client
Reply
#4
Wink 
(05-11-2017, 07:27 PM)boudicca Wrote: exports ?

Hi
     As far as the exports - my NFS server is working with a variety of other Linux machines so the exports are correct!

(05-11-2017, 10:50 PM)augiedoggie Wrote: It might help to give the output of the error message.

Do you have the nfs-common package installed? I don't recall if it is by default.
Is the nfs-client systemd service started? If not, then, sudo systemctl start nfs-client
Thank you for your questions and insights they are great!
The error message that I get when trying to mount the nfs file system directory is:

mount: wrong fs type, bad option, bad superblock on Server:/NFS_Directorym missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might need a mount.<type> helper program)

 As it turns out I tried several to find NFS packages via Synaptic as well as apt and is seems that nfs-common is not available. 
For example I tried the following
       $ apt-get install nfs-common
with the reply
      Package nfs-common is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source.
      ETongueackage 'nfs-common' has no installation candidate

I have used the previous command to install nfs-common on multiple Raspberry PI's. 

As far as nfs-client, I don't see it, and there is not a script in /etc/init.d and no file for NFS in /lib/systemd.

So I suspect that this is not yet available, or ported.

By the way I did not mean for that icon to get in the way
Error - Package 'nfs-common' has not installation candidate

Oh there is only mount.fuse in /sbin.
Reply
#5
If this is a fresh install you may need to run 'apt-get update' before trying to install the nfs-common package
Reply
#6
i did a

sudo apt-get install ntfs-3g

to get mine going
Reply
#7
The code below will automate the process for you by creating a script and execute it loading all the 
dependency packages and proceeds to ask you input questions around your nfs or cifs network share 
details then proceeds make the necessary persistent configurations on your system.

The information asked is as follows with prompt descriptions:
Share username
Share password
Mount folder name (creates a folder in the root directory)
Network path to share

Persistent configuration changes are made in this file:
/etc/fstab

The login user linaro password linaro is used with sudo to achieve the correct permissions.


The script has error checking capability and checks for existing entries in your /etc/fstab file for the 
specific share path before creating another. The script is not destructive to any other configurations in your /etc/fstab file and won't create duplicate share mounts but please backup your fstab as a matter of good practice and remove any line entries for the same share you are now trying to create that already exist before proceeding by copying and pasting the code below into a shell session.

Code:
sudo cp /etc/fstab /etc/fstab.bak

The script mounts your network share with full read / write permissions. Once run you can access your share by simply changing to the folder that was specified. cd /<share folder name>

The script is annotated to describe what it is doing in order to be transparent in its processes please read the script 
and make any changes if necessary.

Simply copy and paste the code below into a shell session for a automated experience.

Code:
echo "Creating script /home/linaro/nfs-install"
sudo cat >  /home/linaro/nfs-install <<'EOF_INSTALL'
#!/bin/bash
######################################################
### With compliments of www.iiot.co.za            ####
######################################################
### Linux linaro-alip 4.4.16-00006-g4431f98-dirty ####
### SMP Mon Apr 17 17:27:25 CST 2017              ####
### armv7l GNU/Linux                              ####
######################################################
install_storage_dependencies(){
echo "Installing storage tools and dependancies.."
sudo apt-get update
sudo apt-get install libnss-winbind winbind ntfs-3g cifs-utils -yqq
sudo sed -i 's/dns/wins dns/g' /etc/nsswitch.conf
}
mount_shares(){
CIFS_PACKAGE=cifs
echo "Here you need to enter the share credentials and details"
echo "To access the share, CIFS, NAS or windows share you have already setup."
echo ""
echo "Enter your share username."
read USER_NAME
echo "Enter your share password."
read USER_PASSWORD
echo "Enter a local folder name you would like to use to mount your share e.g. my_share."
read MOUNT_FOLDER_NAME
echo "Enter your path to your share for example //192.168.2.10/movies"
read SHARE_FOLDER_NAME
echo "Checking for installed packages..."
CHECK_CIFS_PACKAGE=$(sudo apt list $CIFS_PACKAGE &> /dev/null)
if [[ "$CHECK_CIFS_PACKAGE" = "" ]]
then
sudo apt-get install cifs-utils -yqq
fi
CHECK_FSTAB_CONFIG=$(sudo cat /etc/fstab | grep $SHARE_FOLDER_NAME | awk '{print $1}')
echo "Checking for existing configuration with this share..."
if [[ "$CHECK_FSTAB_CONFIG" = "" ]]
then
sudo mkdir -p /$MOUNT_FOLDER_NAME
sudo echo $SHARE_FOLDER_NAME /$MOUNT_FOLDER_NAME "cifs username=$USER_NAME,password=$USER_PASSWORD,iocharset=utf8,gid=0,uid=0,file_mode=0777,dir_mode=0777  0  0" >> /etc/fstab
MOUNT_CHECK=$(mount -a)
if [[ "$MOUNT_CHECK" != "" ]]
then
echo "Mounting failed backing out changes..."
sudo rm -rf /$MOUNT_FOLDER_NAME
sudo cat /etc/fstab | grep -v "$SHARE_FOLDER_NAME" > /etc/cleanShare.fstab
sudo rm -rf /etc/fstab && sudo mv /etc/cleanShare.fstab /etc/fstab && sudo chown root:root /etc/fstab
fi
echo "Mounting succeeded.."
fi
}
install_storage_dependencies
mount_shares


EOF_INSTALL
sudo chmod +x /home/linaro/nfs-install
sudo /home/linaro/nfs-install
Reply
#8
(05-12-2017, 07:47 PM)DiggingDave Wrote: i did a

sudo apt-get install ntfs-3g

to get mine going

ntfs is not the same as nfs

(05-12-2017, 09:12 PM)Kevern Wrote: Copy and paste the below into a shell session.
.....

This script has nothing to do with nfs, it installs ntfs and cifs/samba

Huh
Reply
#9
(05-12-2017, 11:42 PM)augiedoggie Wrote:
(05-12-2017, 07:47 PM)DiggingDave Wrote: i did a

sudo apt-get install ntfs-3g

to get mine going

ntfs is not the same as nfs

(05-12-2017, 09:12 PM)Kevern Wrote: Copy and paste the below into a shell session.
.....

This script has nothing to do with nfs, it installs ntfs and cifs/samba

Huh
Please adapt to suit.
Reply
#10
(05-12-2017, 09:12 PM)Thank you for your response. Somehow I guess my question was not clear or maybe you are recommending that a network share should be done the Microsoft/cifs NTFS way. I\m trying to mount a Unix Network File System A.K.A. Nightmare File System. Your solution is interesting, and useful for a Samba or NTFS share which is great! :) Thank you. I ran the script, some lines by hand on the command line, and found that apt-get install cifs returns the following errorE: Unable to locate package cifs.So again I suspect that the port of Debian Linux to the Tinker Board is not quite there yet. Wrote: The code below will automate the process for you by creating a script and execute it loading all the 
dependency packages and proceeds to ask you input questions around your nfs or cifs network share 
details then proceeds make the necessary persistent configurations on your system.

The information asked is as follows with prompt descriptions:
Share username
Share password
Mount folder name (creates a folder in the root directory)
Network path to share

Persistent configuration changes are made in this file:
/etc/fstab

The login user linaro password linaro is used with sudo to achieve the correct permissions.


The script has error checking capability and checks for existing entries in your /etc/fstab file for the 
specific share path before creating another. The script is not destructive to any other configurations in your /etc/fstab file and won't create duplicate share mounts but please backup your fstab as a matter of good practice and remove any line entries for the same share you are now trying to create that already exist before proceeding by copying and pasting the code below into a shell session.

Code:
sudo cp /etc/fstab /etc/fstab.bak

The script mounts your network share with full read / write permissions. Once run you can access your share by simply changing to the folder that was specified. cd /<share folder name>

The script is annotated to describe what it is doing in order to be transparent in its processes please read the script 
and make any changes if necessary.

Simply copy and paste the code below into a shell session for a automated experience.

Code:
echo "Creating script /home/linaro/nfs-install"
sudo cat >  /home/linaro/nfs-install <<'EOF_INSTALL'
#!/bin/bash
######################################################
### With compliments of www.iiot.co.za            ####
######################################################
### Linux linaro-alip 4.4.16-00006-g4431f98-dirty ####
### SMP Mon Apr 17 17:27:25 CST 2017              ####
### armv7l GNU/Linux                              ####
######################################################
install_storage_dependencies(){
echo "Installing storage tools and dependancies.."
sudo apt-get update
sudo apt-get install libnss-winbind winbind ntfs-3g cifs-utils -yqq
sudo sed -i 's/dns/wins dns/g' /etc/nsswitch.conf
}
mount_shares(){
CIFS_PACKAGE=cifs
echo "Here you need to enter the share credentials and details"
echo "To access the share, CIFS, NAS or windows share you have already setup."
echo ""
echo "Enter your share username."
read USER_NAME
echo "Enter your share password."
read USER_PASSWORD
echo "Enter a local folder name you would like to use to mount your share e.g. my_share."
read MOUNT_FOLDER_NAME
echo "Enter your path to your share for example //192.168.2.10/movies"
read SHARE_FOLDER_NAME
echo "Checking for installed packages..."
CHECK_CIFS_PACKAGE=$(sudo apt list $CIFS_PACKAGE &> /dev/null)
if [[ "$CHECK_CIFS_PACKAGE" = "" ]]
then
sudo apt-get install cifs-utils -yqq
fi
CHECK_FSTAB_CONFIG=$(sudo cat /etc/fstab | grep $SHARE_FOLDER_NAME | awk '{print $1}')
echo "Checking for existing configuration with this share..."
if [[ "$CHECK_FSTAB_CONFIG" = "" ]]
then
sudo mkdir -p /$MOUNT_FOLDER_NAME
sudo echo $SHARE_FOLDER_NAME /$MOUNT_FOLDER_NAME "cifs username=$USER_NAME,password=$USER_PASSWORD,iocharset=utf8,gid=0,uid=0,file_mode=0777,dir_mode=0777  0  0" >> /etc/fstab
MOUNT_CHECK=$(mount -a)
if [[ "$MOUNT_CHECK" != "" ]]
then
echo "Mounting failed backing out changes..."
sudo rm -rf /$MOUNT_FOLDER_NAME
sudo cat /etc/fstab | grep -v "$SHARE_FOLDER_NAME" > /etc/cleanShare.fstab
sudo rm -rf /etc/fstab && sudo mv /etc/cleanShare.fstab /etc/fstab && sudo chown root:root /etc/fstab
fi
echo "Mounting succeeded.."
fi
}
install_storage_dependencies
mount_shares


EOF_INSTALL
sudo chmod +x /home/linaro/nfs-install
sudo /home/linaro/nfs-install

(05-12-2017, 02:43 AM)augiedoggie Wrote: If this is a fresh install you may need to run 'apt-get update' before trying to install the nfs-common package

Well today I did an 'apt-get update' followed by an 'apt-get upgrade' and then tried 'apt-get install nfs-common' with the following results: Success! I was able to mount the Network File system. So I suspect that NFS was ported recently! Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)