LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 02-21-2014, 09:49 AM   #1
gael33
Member
 
Registered: Feb 2009
Location: Scotland
Distribution: Linux Mint 18.3 Cinnamon 64 bit
Posts: 309

Rep: Reputation: 20
Question No line in fstab for USB?


No line in fstab for USB?

I don't appear to have a line in the fstab file for USB ... how do I write one in?
USB won't automatically mount and when anything is plugged in it makes a weird noise through the PC speakers,
plus I cannot access the USB sticks without going through the Terminal - sudo

# /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=9a69a35a-e43d-4216-b8dd-72de331e2053 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=13dcf74e-f08a-49d7-a550-71e06e67991c none swap sw 0 0

gael
 
Old 02-21-2014, 12:24 PM   #2
Tadaen
Member
 
Registered: Sep 2005
Distribution: Arch
Posts: 210

Rep: Reputation: 39
All you have in that fstab is root ( / ) and swap. With the usb drive inserted from terminal do a

Code:
lsblk
ls -l /dev/disk/by-uuid
That will first show you all drives currently available. The 2nd command will list the uuid of the available partitions. Figure out which uuid goes with the usb drive (compare the output of the 2 commands) and add it to the /etc/fstab.

Code:
UUID=????????????????     /mount/point     /ext?     defaults     0     0
My /etc/fstab for example.

Code:
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=b64f54cf-73bf-4a4a-9f54-e4db137c3ed9 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=f2fc22fc-5042-47d5-8365-6638bb1979b8 none            swap    sw              0       0
# data partition /dev/sdb2
UUID=22805acc-488c-4f4c-919d-5ad78fbed1aa       /media/Data     ext4    defaults        0       0
# usb hdd backup
UUID=f29d3b18-d700-41f4-bba0-0b63bb02176a       /media/backups/hdd      ext4    noauto,user     0       0
# usb fdd backuup
UUID=7ef1ce58-10fd-4768-aa85-e0d924cde941       /media/backups/fdd      ext4    noauto,user     0       0
As mine is on laptop I have a script that runs every 30 seconds to mount the usb drives instead of mounting when plugged in. I don't take them with me when I run around.

*EDIT* Something else is messed up though because they should auto mount and be available through the file manager on Mint. Above is work around.

Last edited by Tadaen; 02-21-2014 at 12:35 PM.
 
Old 02-22-2014, 08:21 AM   #3
s.verma
Member
 
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 169
Blog Entries: 4

Rep: Reputation: 24
USB drives are automatically mounted on most of the desktop environments.
And they are not usually listed in fstab.

If you do not have any automount feature, then there is also utility known as 'pmount'.
pmount don't require entry in fstab file.

Just plugin usb drive,
then
pmount /dev/sdx1 (sdx is pen drive, known by lsblk.)
as normal user.

Last edited by s.verma; 02-22-2014 at 08:23 AM.
 
Old 02-22-2014, 09:29 AM   #4
gael33
Member
 
Registered: Feb 2009
Location: Scotland
Distribution: Linux Mint 18.3 Cinnamon 64 bit
Posts: 309

Original Poster
Rep: Reputation: 20
Question

To be honest, I've had this problem since upgrading from Mint 14 to 16 with a clean install. I plug in a USB Stick and although I can open the stick and see the files on it, I cannot copy or paste into or out of it only by going through the Terminal - sudo and having higher permissions. Also when I want to remove the drive, a window pops up and asks me for my password. I never had problems like this before. My guess is that when I first installed Linux Mint 16 something went wrong and there is a fault that is too difficult for me to correct, therefore, It may be easier and less frustrating and time consuming to reinstall the OS again.
 
Old 02-22-2014, 11:59 AM   #5
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,706

Rep: Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506
My fstab has the following
/dev/sdb1 /media/usb auto noauto,user,noatime,nodiratime 0 0
to ensure that the first one plugged in (and I normally only have one) will always mount with a sensible name (as opposed to /media/verbatim store 'n' go). The parameter "user" ensures that I don't need administrative privilege to access it.
 
Old 02-22-2014, 01:37 PM   #6
gael33
Member
 
Registered: Feb 2009
Location: Scotland
Distribution: Linux Mint 18.3 Cinnamon 64 bit
Posts: 309

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by DavidMcCann View Post
My fstab has the following
/dev/sdb1 /media/usb auto noauto,user,noatime,nodiratime 0 0
to ensure that the first one plugged in (and I normally only have one) will always mount with a sensible name (as opposed to /media/verbatim store 'n' go). The parameter "user" ensures that I don't need administrative privilege to access it.
Thanks David, do I just copy and paste that line into the fstab and save it, or do I have to add UUID= before it, plus change 'user' to 'gael33'?
As you probably guess, I'm not very technical although I can do simple tasks and follow instructions quite well.

gael
 
Old 02-22-2014, 04:14 PM   #7
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian
Posts: 1,054

Rep: Reputation: 279Reputation: 279Reputation: 279
No, don't change 'user'. User as a parameter tells the system to allow any user to mount the drive.
You can use /dev/sdb1 or the UUID, either works. If the USB drive has a label, you can also use the label. Using
Code:
man mount
in a terminal will give you more information.
 
  


Reply


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
Can I add this line to FSTAB ? kc5hwb Ubuntu 8 04-08-2007 03:51 PM
Line 7 in /etc/fstab is bad!!! Please Help da_xlnc Linux - General 9 07-20-2006 07:03 AM
Line 7 in fstab bad.... cooljed Linux - General 1 01-11-2006 07:42 AM
Bad line in fstab dubya Fedora 2 06-19-2005 03:49 PM
Weird fstab line dom_lochet Linux - Newbie 3 02-10-2005 07:23 AM

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

All times are GMT -5. The time now is 09:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration