Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
# <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.
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.
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.