Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The ghost option in your auto.master should automatically create the Exports/ directory. I would remove the entry in your auto.misc and use auto.Jackknife
still digging around. found a bit of a tidbit... the UID and GUI plus group need to be the same on both FreeNAS (the server) and my Fedora workstation.
In FreeNAS it is:
Code:
[user@freenas ~]$ id ray
uid=1001(user) gid=1001(user) groups=1001(user),0(wheel),22(sshd)
but in Fedora its:
Code:
[root@workstation ~]# id user
uid=1000(user) gid=1000(user) groups=1000(user),10(wheel)
crossing fingers this does not crash my system. ok so ill have to log out completely before I can make those changes, do I need to boot into "forget Linux name for it" safe mod? so only root is running?
The ghost option in your auto.master should automatically create the Exports/ directory. I would remove the entry in your auto.misc and use auto.Jackknife
Can do. Ill make that change before I start messing with uid/gid settings.
edit: Attempted those changes. No luck. looks like I need to at least log out as user and switch to root in CLI. maybe that will do the trick. would hate to have to boot into single user mode.
It is also possible to mount your share using systemd's x-systemd.automount. It works in a similar fashion except you do not have to specify a base directory.
The command as posted was correct i.e chgrp (change group) but assume you didn't cut and paste it into the last post. foo is just a place holder and you have to use a real ID.
[root@workstation ~]# cat /etc/auto.misc
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
#Exports -fstype=nfs jackknife:/mnt/Exports
# the following entries are samples to pique your imagination
#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd
[root@workstation ~]# cat /etc/auto.Jackknife
Exports -rw,soft,intr,bg,rsize=8192,wsize=8192 server:/mnt/Exports
mount -t nfs -o uid=1000,gid=1000,tcp,rw <freenasServer>:/path/to/export /mnt/freenasMnt
So I ran the following with some errors:
Code:
[root@workstation ~]# mount -t nfs -o -uid=65534,gid=65534,tcp,rw jackknife:/mnt/Exports /home/user/Jackknife
Created symlink /run/systemd/system/remote-fs.target.wants/rpc-statd.service → /usr/lib/systemd/system/rpc-statd.service.
mount.nfs: an incorrect mount option was specified
the uid/gid are the nobody for user/group on FreeNAS for that share.
I removed the -, then the uid= and gid= before it would "mount" still same error Input/output error total 0.
Also changed the uid/gid value to 1001 to match the client side uid/gid for my user.
Yes the user on both sides are the same name/uid/gid now.
WOOT progress. I can now manually mount the NFS share and access files with rw permissions.
Now I can work on the autofs portion. steps to get access:
1. deleted the current NFS share on the FreeNAS server. Something must have been configured incorrectly when it was initially setup or just got corrupt over the last few years.
2. created new NFS share inside FreeNAS with the following settings:
Code:
1. Path: set to a specific sub folder, in this case /mnt/Exports/Exports
2. Authorized networks: xxx.xxx.xxx.0/24 for my LAN
3. All directories checked ON
4. Read only: checked OFF
5. Quiet: checked ON
6. Maproot user: set to 'root' (yes bad for security, sadly my FreeNAS needs to be rebuilt to fix several issues, this is one of them)
7. maproot group: set to 'nobody' ideally the user/group would be nobody/nobody, see #6 above.
Then I just mounted the NFS share with a simple:
Code:
mount -t nfs jackknife:/mnt/Exports/Exports /home/user/Jackknife
I know have full read/write permissions as my user. More posts to come with both questions and solutions, i hope solutions
The command as posted was correct i.e chgrp (change group) but assume you didn't cut and paste it into the last post. foo is just a place holder and you have to use a real ID.
no the error was my eyes are getting old and even with my reading glasses on i saw chgrg, not chgrp. Once I realized what I had seen incorrectly and fixed poof the find did its job and my user on the Fedora system now has uid/gid=1001.
WOOT progress. I can now manually mount the NFS share and access files with rw permissions.
Now I can work on the autofs portion. steps to get access:
1. deleted the current NFS share on the FreeNAS server. Something must have been configured incorrectly when it was initially setup or just got corrupt over the last few years.
2. created new NFS share inside FreeNAS with the following settings:
Well done. I'd assumed you'd already checked the server with other working clients. Always a good to check first.
Yes, I had, but knowing limited information about how FreeNAS configures its NFS shares, I just used the GUI tool (web interface) to see that it had NFS service active and the NFS share pointing to the directory I wanted access to.
Working now on reading and following the link from above to see if I can get the workstation to automount the share on demand as desired.
Nice thing is once that is setup and running I can duplicate the automounting for the 2 laptops running around the house.
[root@workstation ~]# systemctl start autofs
[root@workstation ~]# d /home/ray/Jackknife/
total 4
drwxr-xr-x. 3 root root 0 Jan 11 22:00 ./
drwxr-xr-x. 21 ray ray 4096 Jan 11 19:41 ../
drwxr-xr-x. 2 root root 0 Jan 11 22:00 Exports/
[root@workstation ~]# d /home/user/Jackknife/Exports/
ls: cannot access '/home/user/Jackknife/Exports/': No such file or directory
[root@workstation ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 16G 27M 16G 1% /dev/shm
tmpfs tmpfs 16G 2.0M 16G 1% /run
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sdb3 ext4 49G 11G 37G 22% /
tmpfs tmpfs 16G 56K 16G 1% /tmp
/dev/sdb5 ext4 976M 155M 755M 17% /boot
/dev/sdb6 ext4 163G 61M 154G 1% /stuff
/dev/sdb2 vfat 200M 18M 182M 9% /boot/efi
/dev/sda1 ext4 4.6T 2.3T 2.0T 54% /home
tmpfs tmpfs 3.2G 16K 3.2G 1% /run/user/42
tmpfs tmpfs 3.2G 44K 3.2G 1% /run/user/1001
/dev/sdc1 fuseblk 1.9T 542G 1.3T 30% /run/media/user/WD Passport
[root@workstation ~]# systemctl stop autofs
[root@workstation ~]# d /home/user/Jackknife/
total 8
drwxrwxr-x. 2 ray ray 4096 Jan 11 19:08 ./
drwxr-xr-x. 21 ray ray 4096 Jan 11 19:41 ../
So something is amiss on my end again.
auto.master:
Code:
[root@workstation ~]# cat /etc/auto.master
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
/misc /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given.
#
/net -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
#
#
#
# If you have fedfs set up and the related binaries, either
# built as part of autofs or installed from another package,
# uncomment this line to use the fedfs program map to access
# your fedfs mounts.
#/nfs4 /usr/sbin/fedfs-map-nfs4 nobind
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
/home/user/Jackknife /etc/auto.Jackknife --timeout=600 --ghost
auto.misc
Code:
[root@workstation ~]# cat /etc/auto.misc
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
#Exports -fstype=nfs jackknife:/mnt/Exports
# the following entries are samples to pique your imagination
#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd
I found a command I had not seen before: enable for the autofs sadly that didnt help even when I built the files as the link.
Code:
[root@workstation ~]# cat /etc/auto.master
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
/misc /etc/auto.misc
/home/user/Jackknife /etc/auto.Jackknife
#
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given.
#
/net -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
#
#
#
#/- /etc/auto.direct
# If you have fedfs set up and the related binaries, either
# built as part of autofs or installed from another package,
# uncomment this line to use the fedfs program map to access
# your fedfs mounts.
#/nfs4 /usr/sbin/fedfs-map-nfs4 nobind
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
/home/user/Jackknife /etc/auto.Jackknife --timeout=600 --ghost
[root@workstation ~]# cat /etc/auto.Jackknife
Exports -fstype=nfs,rw,soft,intr,bg,rsize=8192,wsize=8192 server:/mnt/Exports/Exports
With these changes i just never mounted, but also did not present the error I have been seeing. The folder /home/user/Jackknife was just empty.
removed the double entry (see bold font line), now back to the I/O error again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.