Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Unless I am logged in as root, I am unable to mount an external device (such as a flash drive or music player) This is what I get: The user ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! Raize's Avatar
    Join Date
    Jan 2009
    Location
    Colorado, USA
    Posts
    28

    Non-root unable to mount external media


    Unless I am logged in as root, I am unable to mount an external device (such as a flash drive or music player)

    This is what I get:


    The user in question:


    I can, of course, pull up a root terminal and use the mount command, but I don't want every user to have access to the root terminal, but I would like everyone to be able to mount external devices.



    In case it helps:
    Code:
    Linux debian 2.6.26-1-686 #1 SMP Sat Jan 10 18:29:31 UTC 2009 i686 GNU/Linux

  2. #2
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    You could add a line in /etc/fstab to allow users to mount, something like ...
    Code:
    /dev/sdb1 /media/sdb1 vfat rw,noauto,async,user 0 0
    that should allow mount through GUI to work for regular users.

  3. #3
    Just Joined! Raize's Avatar
    Join Date
    Jan 2009
    Location
    Colorado, USA
    Posts
    28
    This is what I have:
    Code:
    /dev/sda1       /media/usb1     vfat    defaults  0       0
    Would I just add ,user?

    Also, that would mean I'd have to edit fstab every time I get a new device (let's say a friend of mine brings his flash driver over).

    Is there a more automated way?

  4. #4
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    Quote Originally Posted by Raize View Post
    This is what I have:
    Code:
    /dev/sda1       /media/usb1     vfat    defaults  0       0
    Would I just add ,user?

    Also, that would mean I'd have to edit fstab every time I get a new device (let's say a friend of mine brings his flash driver over).
    Defaults includes nousers so I don't think that will not work ...
    If you only plug in a single device at a time it will be seen as sda1 each time ... add a similar line with sdb1 will allow both to be plugged in the system at the same time. The first to be plugged in will be sda1.
    If you need to tell which is which and mount to different folders then use /dev/disk/by-uuid/uuid-info-for-device instead of /dev/sda1.

  5. #5
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Add umask=0.
    Code:
    /dev/sda1       /media/usb1     vfat    defaults,umask=0  0       0
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #6
    Just Joined! Raize's Avatar
    Join Date
    Jan 2009
    Location
    Colorado, USA
    Posts
    28
    Now I have:
    Code:
    /dev/sda1       /media/usb1     vfat    defaults,umask=0  0       0
    Still no luck.

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Execute this
    Code:
    su -
    mount -a
    Post exact error message here, if any.
    Post the output of fdisk -l command too.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    Just Joined! Raize's Avatar
    Join Date
    Jan 2009
    Location
    Colorado, USA
    Posts
    28
    Code:
    debian:/# su -
    root@debian:~# mount -a
    ntfs-3g: Failed to access volume '/dev/sda5': No such file or directory
    Please type '/sbin/mount.ntfs-3g --help' for more information.
    ntfs-3g: Failed to access volume '/dev/sdb1': No such file or directory
    Please type '/sbin/mount.ntfs-3g --help' for more information.
    ntfs-3g: Failed to access volume '/dev/sdb5': No such file or directory
    Please type '/sbin/mount.ntfs-3g --help' for more information.
    Password: 
    mount: mount point 0 does not exist
    root@debian:~#
    Those errors are because I have extra entries in fstab for my external NTFS drives, which are not currently connected. If I plug them in, the "No such file or directory" errors go away. It's asking for a password for a network share. I don't know what the "mount point 0" one is.

    Code:
    root@debian:~# fdisk -l
    
    Disk /dev/hda: 3249 MB, 3249340416 bytes
    128 heads, 63 sectors/track, 787 cylinders
    Units = cylinders of 8064 * 512 = 4128768 bytes
    Disk identifier: 0xc4bcc4bc
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hda1   *           1         787     3173152+   c  W95 FAT32 (LBA)
    Partition 1 has different physical/logical endings:
         phys=(785, 127, 63) logical=(786, 127, 63)
    
    Disk /dev/hdb: 40.0 GB, 40060403712 bytes
    255 heads, 63 sectors/track, 4870 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xd783af3f
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdb1   *           1         978     7855753+  83  Linux
    /dev/hdb2             979        1027      393592+   5  Extended
    /dev/hdb3            1028        4870    30868897+   7  HPFS/NTFS
    /dev/hdb5             979        1027      393561   82  Linux swap / Solaris
    
    Disk /dev/hdd: 8455 MB, 8455200768 bytes
    128 heads, 63 sectors/track, 2047 cylinders
    Units = cylinders of 8064 * 512 = 4128768 bytes
    Disk identifier: 0xc4bcc4bc
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdd1   *           1        2047     8253472+   c  W95 FAT32 (LBA)
    
    Disk /dev/sda: 507 MB, 507322880 bytes
    16 heads, 63 sectors/track, 983 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes
    Disk identifier: 0xd3476eaf
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1         983      495400+   b  W95 FAT32
    root@debian:~#

  9. #9
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Check the output of df -h and contents of /media/usb1 folder now.

    I don't know what the "mount point 0" one is.
    Post the contents of /etc/fstab file here.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  10. #10
    Just Joined! Raize's Avatar
    Join Date
    Jan 2009
    Location
    Colorado, USA
    Posts
    28
    Code:
    root@debian:~# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    tmpfs                 189M   12K  189M   1% /lib/init/rw
    udev                   10M  108K  9.9M   2% /dev
    tmpfs                 189M     0  189M   0% /dev/shm
    rootfs                7.4G  6.9G  157M  98% /
    /dev/hda1             3.1G  3.1G  9.4M 100% /media/win
    /dev/sda1             483M  2.8M  481M   1% /media/usb1
    /dev/hdb3              30G   27G  2.8G  91% /extra
    /dev/hdd1             7.9G  3.1G  4.9G  39% /media/temp
    //192.168.0.104/E      75G   67G  8.5G  89% /winshare
    root@debian:~#
    Code:
    root@debian:~# ls -A /media/usb1
    Documents   LaunchU3.exe    .Spotlight-V100  .Trashes	 WEP Key.txt
    .fseventsd  PowerISO43.exe  System	     ._.Trashes
    root@debian:~#
    Code:
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    defaults        0       0
    /dev/hda1    /media/win    vfat    defaults    0 0
    #/dev/hdd5       none            swap    sw              0       0
    
    /dev/hdc        cdrom   udf,iso9660 user,noauto     0       0
    
    # No floppy
    #/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
    
    # First line is for external hard drive, last is for flash drive
    #/dev/sda1       /media/usb1     ntfs-3g    defaults,umask=0,force  0       0
    /dev/sda5       /media/usb1     ntfs-3g    defaults,umask=0,force  0       0
    /dev/sda1       /media/usb1     vfat    defaults,umask=0  0       0
    
    # Partition seems to keep changing on me
    /dev/sdb1    /media/usb0    ntfs-3g    defaults,umask=0,force    0 0
    /dev/sdb5    /media/usb0    ntfs-3g    defaults,umask=0,force    0 0
    
    # Extra partition on Linux drive
    /dev/hdb3	/extra	auto		defaults	0 0
    
    # Temp
    /dev/hdd1	/media/temp	vfat	defaults	0 0
    
    # Windows network shares
    //192.168.0.104/E /winshare smbfs auto,gid=users,file_mode=0664,dir_mode=0775,iocharset=iso8859-15,
    	credentials=/etc/sambapasswords 0 0

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •