LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-03-2017, 11:55 PM   #1
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Jessie, Bunsenlabs
Posts: 586

Rep: Reputation: 38
Mounting a mp3 player as user?


My question is about mounting a mp3 player.
I had trouble mounting the player as a user so I entered this in /etc/fstab:
Quote:
# sansa clip
UUID=44AD-4794 /media/clip vfat rw,noauto,user,sync 0 0
When I mount it manually it works loading with me as owner of the files and directories. When I plug the player into the usb and it mounts automatically then it loads with root as the owner and I have to use sudo to move anything in or out. Can this be fixed?

Joe
 
Old 08-04-2017, 12:08 AM   #2
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
Try adding the uid=ownerID and/or gid=ownerGroupID, of the user you want to be able to access it to your /etc/fstab.

You might want to specify the umask as well
Code:
# sansa clip
UUID=44AD-4794 /media/clip vfat umask=0022,gid=gid,uid=uid,noauto,user,sync 0 0

Last edited by TheEzekielProject; 08-04-2017 at 12:22 AM.
 
Old 08-04-2017, 12:08 AM   #3
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
your really doing this the wrong way. it should be handle in linux through etc/udev/rules and set up a rule for that device so when it is plugged in the kernel loads it. Like a usb mic. Since you have no name for the device I have no way to find out.
a simple way is you change that fstab and plug it in and run lsusb and dmesg and see what you got. makes some rules for it. find out what the chip is.
Since your able to mount it the kernel module "aka drive" is loading.
as far as copying the stuff off it just do it and have fun.

Last edited by Drakeo; 08-04-2017 at 12:11 AM.
 
Old 08-04-2017, 06:41 AM   #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
if gvfs is installed and working, maybe it should handle that as well?
in combination with a polkit agent, maybe.
gvfs has plugins, maybe there's just one missing that can handle your (which? lsusb?) media player, e.g.: gvfs-mtp
 
Old 08-04-2017, 09:27 AM   #5
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,988

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
I think there's nothing wrong with setting this up in fstab vs using udev rules. Since vfat does not have a native permission system like linux filesystems, handling permissions on vfat partitions is different. Different distros handle vfat permission options in the fstab entry a little differently, but the critical item is the umask entry. My Debian 9 vfat partitions have the following entries in fstab in the following form:
Code:
UUID=<partition uuid>  <mount point>    vfat    utf8,users,noauto,umask=007,gid=46   0       0
This was automatically setup by Debian at installation except for the "noauto" option.

The basic setup options I've used when handcrafting vfat entries is:
Code:
vfat user,noauto,exec,defaults,umask=0,rw 0 0
This pretty much worked everywhere and the critical thing is "umask=0". As you've experienced, if you don't have the proper fstab entry, the vfat partition will only be writable by root.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting MP3 Player seelk Linux - Software 2 07-15-2006 11:39 AM
mp3 player, mounting, etc rae_napoleon Linux - Newbie 1 08-12-2005 05:31 PM
Mounting MP3 Player DaBlade Linux - Hardware 2 06-06-2005 09:24 AM
mounting mp3 player novacrasher Linux - Hardware 3 12-10-2004 05:36 PM
Mounting MP3 Player usercsr Slackware 3 10-15-2004 06:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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