mount: only root can mount

Discussion in 'Linux' started by Zorofroozo, Dec 30, 2008.

  1. Zorofroozo

    Zorofroozo

    Joined:
    Sep 28, 2008
    Messages:
    89
    Likes Received:
    0
    i installed the latest ntfs-3g driver 'ntfs-3g-1.5130' and 'ntfs-config-1.0.1' from source but now there seems to be something wrong with the permissions

    i tryed to research it a little:
    Code:
    [user@localhost ~]$ ls -la /media
    total 56
    drwxr-xr-x  5 root root  4096 2008-12-30 14:28 .
    drwxr-xr-x 25 root root  4096 2008-12-30 15:27 ..
    -rw-r--r--  1 root root    13 2008-12-30 14:06 .created_by_python-fstab
    drwxr-xr-x  9 user root 16384 2008-12-30 14:28 disk
    drwxr-xr-x  2 root root  4096 2008-12-30 13:40 extern
    -rw-r--r--  1 root root    92 2008-12-30 14:28 .hal-mtab
    -rw-------  1 root root     0 2008-12-30 14:28 .hal-mtab-lock
    drwxr-xr-x  2 root root  4096 2008-11-09 22:59 test
    
    and then tryed this to change permissions
    Code:
    [user@localhost ~]$ sudo chown root:user /media
    [user@localhost ~]$ sudo chmod 775 /media
    
    the output of 'ls -la /media' changed to this
    Code:
    [user@localhost ~]$ ls -la /media
    total 56
    drwxrwxr-x  5 root user  4096 2008-12-30 14:28 .
    drwxr-xr-x 25 root root  4096 2008-12-30 15:27 ..
    -rw-r--r--  1 root root    13 2008-12-30 14:06 .created_by_python-fstab
    drwxr-xr-x  9 user root 16384 2008-12-30 14:28 disk
    drwxr-xr-x  2 root root  4096 2008-12-30 13:40 extern
    -rw-r--r--  1 root root    92 2008-12-30 14:28 .hal-mtab
    -rw-------  1 root root     0 2008-12-30 14:28 .hal-mtab-lock
    drwxr-xr-x  2 root root  4096 2008-11-09 22:59 test
    
    but i keep having the mount error. With my external ntfs drive it does not really matter, but i can't even plug in my usbstick without manually mounting.

    i think my fstab got changed due to ntfs-config, but i know to litlle to make any changes to in manually.
    my fstab
    Code:
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    
    /dev/sda1       /       ext2    defaults,noatime        1       1
    /dev/sdb1       /media/extern   ntfs-3g defaults,nosuid,nodev,locale=en_GB.UTF-$
    /dev/sdb1       /mnt/windows    ntfs-3g defaults        0       0
    none    /dev/pts        devpts  gid=5,mode=620  0       0
    none    /dev/shm        tmpfs   defaults        0       0
    none    /proc   proc    defaults        0       0
    none    /sys    sysfs   defaults        0       0
    /dev/sda2       swap    swap    defaults        0       0
    
    #none   /tmp    tmpfs   defaults        0       0
    
    my backup (thx god ntfs-config made one :s)
    Code:
    /dev/sda1          /                  ext2          defaults,noatime        1 1
    none               /dev/pts           devpts        gid=5,mode=620         0 0
    none               /dev/shm           tmpfs         defaults               0 0
    none               /proc              proc          defaults               0 0
    none               /sys               sysfs         defaults               0 0
    #none               /tmp               tmpfs         defaults               0 0
    /dev/sda2          swap               swap         defaults               0 0
    
    i tryed comparing them, i tryed :(, it looks just like gibberish to me, can anyone help me out here?
     
    Zorofroozo, Dec 30, 2008
    #1
  2. Zorofroozo

    dattaway

    Joined:
    Sep 2, 2008
    Messages:
    198
    Likes Received:
    0
    Location:
    Kansas Citeeeeeeeeee, MO
    Could you copy and paste the exact line and resulting error?
     
    dattaway, Dec 30, 2008
    #2
  3. Zorofroozo

    Zorofroozo

    Joined:
    Sep 28, 2008
    Messages:
    89
    Likes Received:
    0
    plugging in the usb stick gives this error:

    Failed to mount "UDISK 2.0".
    mount: only root can mount /dev/sdb1 on /mnt/windows

    so it is still automounting, but it is not allowed to 'mount' as user, as thus automount gives the error seen above.

    mounting works if i do:
    Code:
    sudo mount /dev/sdb1 /mnt/windows
    if i try mounting as user, it fails:
    Code:
    [user@localhost ~]$ mount /dev/sdb1 /mnt/windows
    mount: only root can do that
    
    somewhere in the line of installing ntfs-3g and -config, the permissions to use the 'mount' command have changed, i like to change the permissions back :D

    thx very much for the quick reply ;)
     
    Zorofroozo, Dec 30, 2008
    #3
  4. Zorofroozo

    dattaway

    Joined:
    Sep 2, 2008
    Messages:
    198
    Likes Received:
    0
    Location:
    Kansas Citeeeeeeeeee, MO
    Add the "user" or "users" option in /etc/fstab for that drive. That alone will give users permission to mount and unmount. Note that no execute or suid privs are given from a user mount.

    change "default" to "default,users" for that drive.
     
    dattaway, Dec 30, 2008
    #4
  5. Zorofroozo

    Zorofroozo

    Joined:
    Sep 28, 2008
    Messages:
    89
    Likes Received:
    0
    if i understand correctly, my fstab should look like this after editing, and the usb should be mountable by user again?

    Code:
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    
    /dev/sda1       /       ext2    defaults,noatime        1       1
    /dev/sdb1       /media/extern   ntfs-3g defaults,user,nosuid,nodev,locale=en_GB.UTF-$
    /dev/sdb1       /mnt/windows    ntfs-3g defaults,user        0       0
    none    /dev/pts        devpts  gid=5,mode=620  0       0
    none    /dev/shm        tmpfs   defaults        0       0
    none    /proc   proc    defaults        0       0
    none    /sys    sysfs   defaults        0       0
    /dev/sda2       swap    swap    defaults        0       0
    but won't that only work with ntfs drives? because it says type: ntfs-3g??? my usb is fat16, and id like to be able to connect anything to my usb port and have it automount (if posible)

    :p
     
    Zorofroozo, Dec 30, 2008
    #5
  6. Zorofroozo

    dattaway

    Joined:
    Sep 2, 2008
    Messages:
    198
    Likes Received:
    0
    Location:
    Kansas Citeeeeeeeeee, MO
    "user" is a handy option recognized by the "mount" commands allowing any user to mount or unmount, regardless of filesystem type.
     
    dattaway, Dec 30, 2008
    #6
  7. Zorofroozo

    Zorofroozo

    Joined:
    Sep 28, 2008
    Messages:
    89
    Likes Received:
    0
    i did the modification and now i have this error

    Failed to mount 'UDISK 2.0'
    Error opening '/dev/sdb1': Permission denied
    Failed to mount '/dev/sdb1': Permission denied
    Please check '/dev/sdb1' and the ntfs-3g binary permissions,
    and the mounting user ID. More explanation is provided at
    http://ntfs-3g.org/support.html#unprivileged.

    and mount tru terminal doesn't work either
    Code:
    [user@localhost ~]$ mount /dev/sdb1 /mnt/windows
    mount: only root can do that
    
     
    Zorofroozo, Dec 30, 2008
    #7
  8. Zorofroozo

    Zorofroozo

    Joined:
    Sep 28, 2008
    Messages:
    89
    Likes Received:
    0
    put back the old fstab from before ntfs-config, and automounting usb works

    the question is, is there a way to automount my external ntfs drive, with write support?
     
    Zorofroozo, Dec 30, 2008
    #8
  9. Zorofroozo

    Zorofroozo

    Joined:
    Sep 28, 2008
    Messages:
    89
    Likes Received:
    0
    with the help of this topic i found some extra information

    Code:
    [user@localhost etc]$ cat /etc/udev/rules.d/99-fuse.rules 
    KERNEL=="fuse", NAME="%k", MODE="0666",OWNER="root",GROUP="root"
    
    as thus, adding user to owner or group, or changing mode in 775, should do the trick, ..., i think ...., what do you think?

    i'll keep ya posted

    [edit] i tryedthis, but it did not work, probably because its a different distro then in the tutorial

    Code:
    sudo nano /etc/hal/fdi/policy/10-ntfs-policy.fdi
    
    then i pasted this:

    Code:
    CODE
    <?xml version="1.0" encoding="UTF-8"?>
    <deviceinfo version="0.2">
    <!-- mount ntfs volume with the ntfs-3g driver to enable write
    support
    
      <device>
            <match key="volume.fstype" string="ntfs">
                <match key="@block.storage_device:storage.hotpluggable" bool="true">
                    <merge key="volume.fstype"
    type="string">ntfs-3g</merge> <merge
    key="volume.policy.mount_filesystem"
    type="string">ntfs-3g</merge>
                    <append key="volume.mount.valid_options"
    type="strlist">locale=</append>
                </match>
            </match>
         </device>
     </deviceinfo>
    
    and tryed to restart HA with this command but it failed
    Code:
    [user@localhost policy]$ /etc/init.d/dbus restart
    bash: /etc/init.d/dbus: No such file or directory
    
    as thus i shall try to reboot the whole system and see if it works.

    again, i'll keep ya posted

    [edit]

    deleted ntfs-3g and ntfs-config tru console with
    Code:
    sudo make uninstall
    and then reinstalled ntfs-3g, and last, i replaced my fstab with the first backup

    usb works, ntfs is automounted, but READ-ONLY, now i just need to find a way to mount it as read and writeable...
     
    Zorofroozo, Dec 30, 2008
    #9
  10. Zorofroozo

    Zorofroozo

    Joined:
    Sep 28, 2008
    Messages:
    89
    Likes Received:
    0
    chmod'ing /etc/udev/rules.d/99-fuse.rules has no apparant effect on auto mount

    help would be appreciated
     
    Zorofroozo, Jan 1, 2009
    #10
  11. Zorofroozo

    tee_blauer_enzian

    Joined:
    Aug 8, 2008
    Messages:
    16
    Likes Received:
    0
    Location:
    Solingen, Germany
    I was working on the same problem and got it running by performing the following steps:

    1.) Update the ntfs-3g-driver to version 1.5012 via
    Code:
    yum update ntfs-3g
    2.) Create a file 10-ntfs-policy.fdi in the directory /usr/share/hal/fdi/policy/10osvendor containing the following code:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <deviceinfo version="0.2">
        <device>
            <match key="volume.fstype" string="ntfs">
                <match key="@block.storage_device:storage.hotpluggable" bool="true">
                    <merge key="volume.fstype" type="string">ntfs-3g</merge>
                    <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>
                    <append key="volume.mount.valid_options" type="strlist">locale=</append>
                </match>
            </match>
        </device>
    </deviceinfo>
    I found the code on the german Website http://www.pc-forum24.de/suse-syste...t-ntfs-3g-automatisch-schreibbar-mounten.html.
    3.) Reboot your AAO.
    4.) Plug in your extermal NTFS-formatted HDD. It should be automatically mounted r/w.
     
    tee_blauer_enzian, Jan 1, 2009
    #11
  12. Zorofroozo

    Zorofroozo

    Joined:
    Sep 28, 2008
    Messages:
    89
    Likes Received:
    0
    Great! worked like a charm :) thx a lot mate
     
    Zorofroozo, Jan 1, 2009
    #12
  13. Zorofroozo

    ch1mp

    Joined:
    Nov 16, 2008
    Messages:
    3
    Likes Received:
    0
    EDIT - sudo mousepad /usr/bin/xfcepost & then created new file - pressumeably you can swap the paths (but it's worked!!)
    from viewtopic.php?f=39&t=4931



    Hi

    How do I write the file... I appreciate that this has got to be one of the dumbest questions, but I copied in the code from step 2 into Mousepad but it won't let me save in tht location. Being Root in Terminal doesn't help (I wasn't really expecting the two to work independently), so pessumably you need to create the file through terminal - I just don't know how.

    Also this topic was created in August so perhaps somebody else could help please.
     
    ch1mp, Jan 2, 2009
    #13
  14. Zorofroozo

    Zorofroozo

    Joined:
    Sep 28, 2008
    Messages:
    89
    Likes Received:
    0
    alt+f2 and then type "sudo mousepad"
     
    Zorofroozo, Jan 29, 2009
    #14
  15. Zorofroozo

    Guest Guest

    hi i also have this problem in that i installed ntfs cfg and then removed it but i am now unable to auto mount any usb or memory card they are all with the identity of the ntfs hdd i tried to mount and i get the error only root can mount but it then says unknown file system ntfs-3g even though the card and hdd are fat16 and fat32 please can someone help with instructions on how to correct this i only want to be able to auto mount fat file system now
    when i try to mount the fat32 drive_n_go usb hdd i get cant find /sdb1/media/drive_n_go in /ect/fstab or/ect/mtab
    mike46
    ps i have done a system restore now so usb auto mount is working again

    mike 46
     
    Guest, Feb 1, 2009
    #15
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.