fstab

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ICE8

fstab

Post by ICE8 »

I recently had to wipe my machine. For the sake of time I was only able to backup /home. Unfortunately, I had neither the smarts or time to back up /etc.
I had 5 fstab entries that showed up unmounted in nemo under Network in the left pane, and no longer show. If I browse to /mnt/media/j_photo (for example), I am able to see and rw contents of all 5 shares. Would prefr to have them show up in nemo again, default unmounted.
Here is an example of the mount line in /etc/fstab to one share:
//ip_address/photo /mnt/media/j_photo cifs credentials=/home/user/Documents/.me 0 0
Using Cinnamon Linux Mint 19.1. Previously was using Linux Mint 19.0.
Many thanks and Happy 2019!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: fstab

Post by AndyMH »

I think you want noauto in the options for the fstab entry. Note, if you mount your shares in /media they will show up in the 'removable drives' icon in the panel - a quick way of getting at them. This is where I mount my NAS.
Workspace 1_009.png
Further thought, I put my credentials file in /etc/samba, this way when I backup up the system it's taken care of, with the file in /home timeshift will not back it up in its default config. Also changed the ownership to root and RO.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
ICE8

Re: fstab [SOLVED]

Post by ICE8 »

Thank you AndyMH.
I did add the noauto before your reply.
Creating the mount points in my /media/user directory was the trick. Not sure why I created /mnt/media/user.
Since I don't have or want other users to log into the NAS as myself (or on my personal desktop for that matter), I'll keep the credentials file under my home directory with 0600 for user account.
gm10

Re: fstab [SOLVED]

Post by gm10 »

ICE8 wrote: Wed Jan 02, 2019 5:52 pm Creating the mount points in my /media/user directory was the trick. Not sure why I created /mnt/media/user.
Likely because /mnt is the standard mount location for external file systems and every guide you followed would have pointed you there. If you want mounts in /mnt (or any other location) to show up in nemo you need to add the x-gvfs-show flag to the mount options in fstab or check the "Show in user interface" box in the Disk tool's mount options dialog (no need to edit fstab manually).
ICE8

Re: fstab

Post by ICE8 »

Well, I thought it was solved. Unlike before, when trying to mount, I get:

Unable to mount j_photo:
mount:/media/user/j_photo: operation permitted for root only

Mount points do show in Nemo, however.

//ip_address/photo /media/user/j_photo cifs noauto,credentials=/home/user/Documents/.me 0 0
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: fstab

Post by AndyMH »

Try adding your uid and gid to fstab, this is the entry for my NAS:

Code: Select all

//diskstation.local/home/ /media/synology cifs credentials=/etc/samba/credentials,uid=1000,gid=1000 0 0
If you want mounts in /mnt (or any other location) to show up in nemo you need to add the x-gvfs-show flag to the mount options in fstab
gm10, thanks for that, learnt something :)
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: fstab

Post by altair4 »

ICE8 wrote: Wed Jan 02, 2019 6:57 pm Well, I thought it was solved. Unlike before, when trying to mount, I get:

Unable to mount j_photo:
mount:/media/user/j_photo: operation permitted for root only

Mount points do show in Nemo, however.

//ip_address/photo /media/user/j_photo cifs noauto,credentials=/home/user/Documents/.me 0 0
If the object is to mount this share in your file manager as required you need one more option: user :
//ip_address/photo /media/user/j_photo cifs noauto,user,credentials=/home/user/Documents/.me 0 0
** Because the mount point is under /media it will show up on the side panel of your file manager.
** noauto will make it so it doesn't mount at boot.
** user allows an ordinary user ( i.e., not root ) the ability to mount the share.

Note: user in this case is literally user not your user name.

Put it all together with a little help from udisks in the background and the link in the file manager becomes actionable: click on the link and the system will go to fstab to find out if you can mount and then determine how to mount it - all seamlessly.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
ICE8

Re: fstab [SOLVED]

Post by ICE8 »

Many thanks to the 3 of you for the assistance.

I'm certain I had tried these things before. It turns out that mount -a wasn't enough, and I wound up performing reboots to ensure that nemo got the hint. There's certainly a better, proper way to do it, but I don't know it - more to eventually learn.

I tried all of the permutations and it turns out that both AndyMH and altair4 recommendations work, together or separately. For the sake of being thorough, I did check /etc/passwd to ensure that the id for user and group were correct - and, yes, I was the first user so they were 1000.

Notes taken, comments made, and lesson learned on backing up /etc - well, OK, also to fully test before sticking solved on a post. :D
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: fstab

Post by AndyMH »

Notes taken
I have a simple text file on my backup drive with a launcher on the desktop - whenever I make any changes I make a note in the file with a date/timestamp. And that includes all the stuff that didn't work :D
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Locked

Return to “Storage”