LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-11-2019, 05:33 PM   #16
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896

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
 
Old 01-11-2019, 05:45 PM   #17
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
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)
following this link: https://www.cyberciti.biz/faq/linux-...l-owned-files/

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?
 
Old 01-11-2019, 05:46 PM   #18
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by michaelk View Post
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.

Last edited by lleb; 01-11-2019 at 06:09 PM.
 
Old 01-11-2019, 06:07 PM   #19
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,805

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Good catch regarding the config mistakes in auto.misc and auto.Jackknife. Missed that. Anyway, reads like progress now.
 
Old 01-11-2019, 06:17 PM   #20
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
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.

https://wiki.archlinux.org/index.php...t_with_systemd
 
1 members found this post helpful.
Old 01-11-2019, 06:28 PM   #21
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
michaelk, ill look at that once I am back into my workstation. on my laptop atm... seems that the following command is giving me fits:

Code:
# find / -group 1000 -exec chgrp -h foo {} \;
getting the following error:

Code:
find: 'chgrg': No such file or directory
Isnt chgrg the command for change group?

nevermind. im a bit blind it would seem.... it is chgrp, not chgrg le sigh. working on that code now

Last edited by lleb; 01-11-2019 at 06:31 PM.
 
Old 01-11-2019, 06:46 PM   #22
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
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.

This old thread might help.
https://www.linuxquestions.org/quest...id-4175519504/
 
1 members found this post helpful.
Old 01-11-2019, 06:54 PM   #23
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
well changing uid/gid did not help:

Code:
[root@workstation ~]# mount jackknife:/mnt/Exports /home/user/Jackknife/
[root@workstation ~]# df -Th
Filesystem             Type      Size  Used Avail Use% Mounted on
devtmpfs               devtmpfs   16G     0   16G   0% /dev
tmpfs                  tmpfs      16G   30M   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   32K  3.2G   1% /run/user/1001
/dev/sdc1              fuseblk   1.9T  542G  1.3T  30% /run/media/user/WD Passport
jackknife:/mnt/Exports nfs4      3.2T  512K  3.2T   1% /home/user/Jackknife
[root@workstation ~]# d /home/user/Jackknife/
ls: reading directory '/home/user/Jackknife/': Input/output error
total 0
[root@workstation ~]# id user
uid=1001(user) gid=1001(user) groups=1001(user),10(wheel)
Yes i did make the change to 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
[root@workstation ~]# cat /etc/auto.Jackknife 
Exports	-rw,soft,intr,bg,rsize=8192,wsize=8192	server:/mnt/Exports
 
Old 01-11-2019, 07:32 PM   #24
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
hmm, well making some headway, following a link that is old, but might get me on the correct path:

https://forums.freenas.org/index.php...-of-nfs.24411/

Code:
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.
 
Old 01-11-2019, 08:05 PM   #25
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
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
 
Old 01-11-2019, 08:07 PM   #26
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by michaelk View Post
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.

This old thread might help.
https://www.linuxquestions.org/quest...id-4175519504/
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.

Turns out might not need that for now.
 
Old 01-11-2019, 08:20 PM   #27
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,805

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
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.
 
Old 01-11-2019, 08:52 PM   #28
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
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.
 
Old 01-11-2019, 09:08 PM   #29
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
frown

Code:
[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
auto.Jackknife
Code:
[root@workstation ~]# cat /etc/auto.Jackknife 
Exports	-rw,soft,intr,bg,rsize=8192,wsize=8192	server:/mnt/Exports/Exports
 
Old 01-11-2019, 09:31 PM   #30
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Original Poster
Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
well ive about had it for tonight. following this link: https://www.linuxtechi.com/automount...-using-autofs/

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.

Last edited by lleb; 01-11-2019 at 09:43 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] autofs passing username to autofs mounts Timothy Miller Linux - General 3 08-27-2018 06:24 PM
LXer: How to use autofs to mount NFS shares LXer Syndicated Linux News 0 06-05-2018 09:42 AM
[SOLVED] any autofs experts here? how to get autofs and WebDAV to play nice? zippydan Linux - General 2 09-05-2016 07:13 PM
Automount Netapp NFS shares on Linux with AUTOFS athreyavc Linux - Server 2 10-30-2007 05:34 PM
Mounting samba windoze shares using autofs Rounan Linux - Software 2 12-05-2003 05:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration