LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-10-2020, 10:14 AM   #1
RickPoleshuck
Member
 
Registered: Jun 2019
Posts: 34

Rep: Reputation: Disabled
Permanent USB drive with Ubuntu desktop


I have added the proper magic to my /etc/fstab to mount my USB drive on boot and as root. But when I login to my desktop, it tries to mount the USB drive again as my user id in /media/$USERNAME. Is this is a bug or a configuration issue? I don't think its related but I am using samba, smbd to export this drive.

OS: Ubuntu 20.04
Desktop manager: default Gnome
fstab: UUID=719b83b1-8f0d-42f8-b9c6-c796832e8371 /media/backup ext4 errors=remount-ro 0 2

I think this is the right forum, but don't hesitate to correct me.
Thanks
 
Old 12-10-2020, 10:26 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by RickPoleshuck View Post
I have added the proper magic to my /etc/fstab to mount my USB drive on boot and as root. But when I login to my desktop, it tries to mount the USB drive again as my user id in /media/$USERNAME. Is this is a bug or a configuration issue? I don't think its related but I am using samba, smbd to export this drive.

OS: Ubuntu 20.04
Desktop manager: default Gnome
fstab: UUID=719b83b1-8f0d-42f8-b9c6-c796832e8371 /media/backup ext4 errors=remount-ro 0 2

I think this is the right forum, but don't hesitate to correct me.
Thanks
Check the "automounter" settings in the desktop/graphical environment you're using - it's a configuration issue with that.
 
Old 12-10-2020, 11:04 AM   #3
RickPoleshuck
Member
 
Registered: Jun 2019
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
Check the "automounter" settings in the desktop/graphical environment you're using - it's a configuration issue with that.
Thanks for your reply.
Unfortunately, I did not fully specify my problem. My apologies.
Using dconf-editor I can turn off automount easily by browsing to org.gnome.desktop.media, but that turns off ALL automounts which is not what I want.
 
Old 12-10-2020, 01:39 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by RickPoleshuck View Post
Unfortunately, I did not fully specify my problem. My apologies.
Using dconf-editor I can turn off automount easily by browsing to org.gnome.desktop.media, but that turns off ALL automounts which is not what I want.
If you want to disable automounting only for one specific device, but not all others, a udev rule might help.

Hint: this is much harder to achieve.
 
Old 12-10-2020, 10:46 PM   #5
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by RickPoleshuck View Post
Thanks for your reply.
Unfortunately, I did not fully specify my problem. My apologies.
Using dconf-editor I can turn off automount easily by browsing to org.gnome.desktop.media, but that turns off ALL automounts which is not what I want.
Are you sure you can't go into System > Preferences > Removable Drives and Media and set an option to not automount just your USB drive? Because reading this seems to suggest you can, under the heading "Preferences".

I'm pretty sure there is in fact an option to selectively automount removable drives in KDE. GNOME is one of the reasons I don't use Ubuntu myself, and I don't seem to have an ISO image of it to look at it for you in a VM either.

I would check in Ubuntu's Removable Drives and Media settings for an option to not automount your USB drive, without disabling automounting completely. Or you'll have to setup a udev rule as suggested to stop your USB drive being automounted.
 
Old 12-11-2020, 10:18 AM   #6
RickPoleshuck
Member
 
Registered: Jun 2019
Posts: 34

Original Poster
Rep: Reputation: Disabled
If the option to specify a particular drive exists in Ubuntu 20.04 Gnome, it is hidden well. :-)

After more research, I believe this is a bug. When I plugin my USB drive while logged in I do not see this problem. It only occurs after a reboot. Although I am careful to lock my screen when I walk away, I almost never log out so I hadn't been aware of this before.

I think I am pointed in the right direction. For others, this looks like a good very beginner tutorial to udev: https://opensource.com/article/18/11/udev

Thanks to all.

Quote:
Originally Posted by jsbjsb001 View Post
Are you sure you can't go into System > Preferences > Removable Drives and Media and set an option to not automount just your USB drive? Because reading this seems to suggest you can, under the heading "Preferences".

I'm pretty sure there is in fact an option to selectively automount removable drives in KDE. GNOME is one of the reasons I don't use Ubuntu myself, and I don't seem to have an ISO image of it to look at it for you in a VM either.

I would check in Ubuntu's Removable Drives and Media settings for an option to not automount your USB drive, without disabling automounting completely. Or you'll have to setup a udev rule as suggested to stop your USB drive being automounted.
 
Old 12-11-2020, 04:11 PM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by RickPoleshuck View Post
It only occurs after a reboot.
Show us the output of
Code:
cat /etc/fstab
please.

(just a wild guess)
 
Old 12-11-2020, 07:11 PM   #8
RickPoleshuck
Member
 
Registered: Jun 2019
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
Show us the output of
Code:
cat /etc/fstab
please.

(just a wild guess)
My original post had the relevant line from my fstab, but here is the whole thing:

Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=130b39ea-b957-422b-8cb7-7d760169c5b9 /               ext4    errors=remount-ro 0       1
/swapfile                                 none            swap    sw              0       0
UUID=719b83b1-8f0d-42f8-b9c6-c796832e8371 /media/backup   ext4    errors=remount-ro 0       2
 
Old 12-12-2020, 02:59 AM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ aw crud, you posted that in your OP. Sorry.
But it made me realise what the problem is.
In fstab, you can add an option to that drive that tells your DE to basically ignore it.
I kknow this exists but I cannot find it.
I currently have
Code:
...,comment=x-gvfs-show,...
on one internal drive, but that does the exact opposite. So maybe "x-gvfs-hide"?
 
  


Reply

Tags
drive, gnome, ubuntu, usb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to make changes to OS on USB flash drive permanent eco_bach Linux - Newbie 4 12-29-2016 10:10 AM
ubuntu-desktop vs. kubuntu-desktop vs. xubuntu-desktop vs. lubuntu-desktop vs. unity Kenny_Strawn Ubuntu 18 05-13-2011 09:20 AM
How to put a permanent entry in fstab for usb pen drive zulfilee Linux - General 4 08-31-2004 11:36 PM
How make perfect 'virtual desktop' permanent? lugoteehalt Linux - General 4 10-08-2003 09:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:01 PM.

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