LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-30-2021, 12:52 PM   #1
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Rep: Reputation: 77
Another Question on automounting a NFS Share


This is in relation to this question here:

https://www.linuxquestions.org/quest...er-4175684862/

I do have the share set up and working in dolphin. My question is in relation to thunar. From what I can see the shares do not show up in thunar, so if I wanted to have a slimmed down install on a laptop with XFCE and no KDE is there a way to get the NFS shares to show up in thunar? Is there a package that I'm missing?

I know that I can use XFCE and keep KDE and just use dolphin when I need to access the shares, but I am curious if there's another way to do this for thunar.
 
Old 12-31-2021, 09:35 AM   #2
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Oh, and one more thing I've been noticing. The NFS shares do not unmount automatically when I shut down my PC. I need to unmount it manually as root before shutting down or it hangs. I cannot unmount as my user, but can as root, which is strange.
 
Old 12-31-2021, 03:38 PM   #3
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
I use autofs, IIRC there used to be a howto on the Slackware wiki but basically you edit /etc/auto.master.d/mnt.autofs and /etc/auto.mnt

auto.mnt is similar to fstab

this is my script to set it up

Code:
echo "/mnt	/etc/auto.mnt" > /etc/auto.master.d/mnt.autofs
echo "Shares		-fstype=nfs		192.168.1.10:/home/Shares" > /etc/auto.mnt

chmod +x /etc/rc.d/rc.rpc
/etc/rc.d/rc.rpc start
chmod +x /etc/rc.d/rc.autofs
/etc/rc.d/rc.autofs start
Thunar will display the mounted NFS shares in its Shortcuts side pane view.

You can also make a desktop launcher like this:
Code:
[Desktop Entry]
Version=1.0
Type=Application
Name=Shares
Comment=
Exec=thunar /mnt/Shares/
Icon=folder-remote
Path=/mnt/Shares/
Terminal=false
StartupNotify=false
Either way of mounting though should unmount at shutdown/reboot but autofs will unmount after a few minutes as set in /etc/autofs.conf so you don't any delays at boot time or shutdown if its already unmounted. Depending on how much you use the NFS shares it can be helpful. I like this config on my laptop so if I boot up away from home its not trying to mount my server.
 
2 members found this post helpful.
Old 01-01-2022, 09:05 AM   #4
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by enine View Post
I use autofs, IIRC there used to be a howto on the Slackware wiki but basically you edit /etc/auto.master.d/mnt.autofs and /etc/auto.mnt

auto.mnt is similar to fstab

this is my script to set it up

Code:
echo "/mnt	/etc/auto.mnt" > /etc/auto.master.d/mnt.autofs
echo "Shares		-fstype=nfs		192.168.1.10:/home/Shares" > /etc/auto.mnt

chmod +x /etc/rc.d/rc.rpc
/etc/rc.d/rc.rpc start
chmod +x /etc/rc.d/rc.autofs
/etc/rc.d/rc.autofs start
Thunar will display the mounted NFS shares in its Shortcuts side pane view.

You can also make a desktop launcher like this:
Code:
[Desktop Entry]
Version=1.0
Type=Application
Name=Shares
Comment=
Exec=thunar /mnt/Shares/
Icon=folder-remote
Path=/mnt/Shares/
Terminal=false
StartupNotify=false
Either way of mounting though should unmount at shutdown/reboot but autofs will unmount after a few minutes as set in /etc/autofs.conf so you don't any delays at boot time or shutdown if its already unmounted. Depending on how much you use the NFS shares it can be helpful. I like this config on my laptop so if I boot up away from home its not trying to mount my server.
Thanks a lot, this seems to work better than messing around with fstab.
 
Old 01-01-2022, 05:30 PM   #5
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
If you use your shares all the time then fstab may be better but I keep the my current data local (sync'ed via nextcloud) with older data on my server so I don't use those shares every day so the delay while it automounts isn't a big deal.
Another thing you can do too is add a shortcut on Thunar's Shortcuts side pane.

Edit ~/.config/gtk-3.0/bookmarks and add a line like this:

Code:
file:///mnt/Shares
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2022-01-01_18-24-09.png
Views:	30
Size:	53.3 KB
ID:	37959  
 
2 members found this post helpful.
Old 01-02-2022, 08:37 AM   #6
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by enine View Post
If you use your shares all the time then fstab may be better but I keep the my current data local (sync'ed via nextcloud) with older data on my server so I don't use those shares every day so the delay while it automounts isn't a big deal.
Another thing you can do too is add a shortcut on Thunar's Shortcuts side pane.

Edit ~/.config/gtk-3.0/bookmarks and add a line like this:

Code:
file:///mnt/Shares
Actually I like autofs, that seems to work much better for me than editing fstab. It mounts when I want it to and automatically unmounts when not in use. I don't need to open a file manager as root to unmount it before shutting down either.

Most of my stuff is backed up on my server, but I like to have some things on my PCs or laptops.
 
Old 01-02-2022, 09:06 AM   #7
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
The only issue I have with autofs is the directories will disappear from the mount point when they unmount so you still have to know what they were or type them in, it would be nice if it left them directpries there. So that is why I added the bookmarks so I can just click on them in Thunar.
 
1 members found this post helpful.
Old 01-02-2022, 09:47 AM   #8
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by enine View Post
The only issue I have with autofs is the directories will disappear from the mount point when they unmount so you still have to know what they were or type them in, it would be nice if it left them directpries there. So that is why I added the bookmarks so I can just click on them in Thunar.
Good tip, that does make it easier.

Thanks.
 
Old 01-02-2022, 05:47 PM   #9
BigTig
Member
 
Registered: Aug 2015
Posts: 61

Rep: Reputation: Disabled
Quote:
Originally Posted by enine View Post
The only issue I have with autofs is the directories will disappear from the mount point when they unmount so you still have to know what they were or type them in, it would be nice if it left them directpries there. So that is why I added the bookmarks so I can just click on them in Thunar.
If you add 'browse' to your automaster file it'll show the directories whether they're mounted or not.
e.g.:

/media/ServerName/ /etc/auto.Server browse
 
1 members found this post helpful.
Old 01-02-2022, 06:13 PM   #10
notzed
Member
 
Registered: Dec 2020
Location: South Australia
Distribution: slackware64-current
Posts: 95

Rep: Reputation: Disabled
For what it's worth I couldn't get fstab to work because it would try the mount once too early in the boot sequence - before the network or some daemon was properly initialised - so always fail. autofs works well.

I think autofs fell somewhat out of favour due to gnome/kde using their own auto-mounting mechanisms tied to login sessions.
 
Old 01-03-2022, 07:40 AM   #11
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by notzed View Post
For what it's worth I couldn't get fstab to work because it would try the mount once too early in the boot sequence - before the network or some daemon was properly initialised - so always fail. autofs works well.

I think autofs fell somewhat out of favour due to gnome/kde using their own auto-mounting mechanisms tied to login sessions.
I got fstab to work, but my system would hang up on shutdown and I would need to manually unmount the shares, but I could only do it as root. I like autofs a lot better so far.
 
Old 01-03-2022, 07:40 AM   #12
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by BigTig View Post
If you add 'browse' to your automaster file it'll show the directories whether they're mounted or not.
e.g.:

/media/ServerName/ /etc/auto.Server browse
That's a good tip, thanks.
 
  


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] Question on automounting a NFS share from a server Bertman123 Slackware 7 11-07-2020 12:38 PM
Question about automounting nfs directories within ldap kapitaenhaddock Linux - Server 1 10-10-2017 08:53 AM
NFS Share within an NFS Share tiberus Linux - Server 2 05-25-2010 10:28 AM
Sharing a NFS share off of another NFS server keysorsoze Linux - Networking 2 09-19-2008 10:50 AM
Automounting a samba share at bootup stodge Linux - Software 1 02-16-2002 02:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:08 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