Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: USB drive mounts but user can't write to drive

  1. #1
    Join Date
    May 2005
    Location
    Birmingham UK
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    USB drive mounts but user can't write to drive

    Hello All

    I've got a bare bones Ubuntu 10.04 set up (xorg, openbox, usbmount). My (vfat32) stick drive mounts, and I can see what is in the one directory on the drive, but I can't write to the drive unless I use sudo. I tried the obvious step of attempting to change permissions on the drive..

    Code:
    keith@quiet:~$ sudo chmod -R 777 /media/usb0
    [sudo] password for keith: 
    keith@quiet:~$ ls /media/usb0
    stuff
    keith@quiet:~$ touch /media/usb0/readme.txt
    touch: cannot touch `/media/usb0/readme.txt': Permission denied
    I've seen these posts and they seem to relate to different situations...

    http://ubuntuforums.org/showthread.p...ve+permissions

    http://ubuntuforums.org/showthread.p...issions&page=2

    Any ideas?

    PS do we need a prefix for command line type systems?

  2. #2
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,638
    Distro
    Ubuntu

    Re: USB drive mounts but user can't write to drive

    Try
    Code:
    sudo chown -R keith:keith /media/usb0

  3. #3
    Join Date
    Dec 2009
    Beans
    5,917

    Re: USB drive mounts but user can't write to drive

    You can't chmod or chown a FAT32 or NTFS formatted partition. That's for linux filetypes.

    The real question is why is your USB stick mounting with owner = root. It should automount with owner = keith unless Ubuntu reset the defaults again in 10.04.

    Do you have an entry in fstab for this device. If so post the contents:

    cat /etc/fstab

    You also might want to post the output of sudo blkid

  4. #4
    Join Date
    May 2005
    Location
    Birmingham UK
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: USB drive mounts but user can't write to drive

    Quote Originally Posted by nothingspecial View Post
    Try
    Code:
    sudo chown -R keith:keith /media/usb0
    Thanks for reply, but...

    Code:
    chown: changing ownership of `/media/usb0/stuff/dttls': Operation not permitted
    chown: changing ownership of `/media/usb0/stuff': Operation not permitted
    chown: changing ownership of `/media/usb0': Operation not permitted
    fdisk -l gives...

    Code:
    Disk /dev/sdd: 2057 MB, 2057306112 bytes
    255 heads, 63 sectors/track, 250 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000336de
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdd1   *           1         250     2008093+   b  W95 FAT32
    cat /etc/fstab gives just the root, home and swap partitions, no entry for USB as I was sort of expecting there not to be. Would adding an fstab entry help?

  5. #5
    Join Date
    May 2005
    Location
    Birmingham UK
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: USB drive mounts but user can't write to drive

    Quote Originally Posted by Morbius1 View Post
    You can't chmod or chown a FAT32 or NTFS formatted partition. That's for linux filetypes.

    Do you have an entry in fstab for this device. If so post the contents:

    cat /etc/fstab

    You also might want to post the output of sudo blkid
    Thanks Morbius1, I've just seen your post. As mentioned above, no fstab for the USB stick. sudo blkid gives

    Code:
    /dev/sda1: UUID="87601e96-9320-42a5-bb2b-97ecb57ebf54" TYPE="ext4" 
    /dev/sda5: TYPE="swap" 
    /dev/sda6: UUID="ba78a906-a012-4f20-8cda-8d7332ec4b14" TYPE="ext3" 
    /dev/sdd1: UUID="3C52-C8C5" TYPE="vfat"
    I've been searching forums and there appear to be reports of defaults changing. System was installed and updated last night.

  6. #6
    Join Date
    Dec 2009
    Beans
    5,917

    Re: USB drive mounts but user can't write to drive

    You can add an entry but for the life of me I don't understand why it's necessary. Some developer somewhere didn't dot an "i" or cross a "t".

    Anyway, to add an entry into fstab it would go something like this:

    Open Terminal
    Type sudo mkdir /media/usbstick
    Type gksu gedit /etc/fstab

    Add an entry that looks like this:
    Code:
     UUID=3C52-C8C5 /media/usbstick vfat user,umask=000,utf8,flush,noauto 0 0
    The "user" and "noauto" will allow the user to mount the device automatically when inserted.

    The "umask=000" will allow read / write access to everyone.

    When you're done, save fstab, exit gedit, and back in the Terminal type:
    sudo mount -a

    Then insert the stick and find out if I'm full of hooey

  7. #7
    Join Date
    May 2005
    Location
    Birmingham UK
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: USB drive mounts but user can't write to drive

    Quote Originally Posted by Morbius1 View Post

    Then insert the stick and find out if I'm full of hooey
    You are right out of hooey. Thanks very much.

    Code:
    keith@quiet:~$ touch /media/usbstick/stuff/great.txt
    keith@quiet:~$ ls /media/usbstick/stuff
    dttls  great.txt
    Now, do I have to do this for each different drive that I use, so each one has a different UUID?

    Before I mark this as 'solved' has anyone got any ideas as to a 'general' solution that will get me back to where I am on another box with usbmount ('just works' with all permissions)?

    Thanks all

  8. #8
    Join Date
    Dec 2009
    Beans
    5,917

    Re: USB drive mounts but user can't write to drive

    Now, do I have to do this for each different drive that I use, so each one has a different UUID?
    Yes. I mean you could have done it this way:
    Code:
     /dev/sdd1 /media/usbstick vfat user,umask=000,utf8,flush,noauto 0 0
    And if you only have one usb storage device this might work. But if you have many and they're formatted in NTFS, ext3, .... then you start getting into problems.

    But as you stated above this is a workaround not a solution. Something's not right here.

  9. #9
    Join Date
    May 2005
    Location
    Birmingham UK
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: USB drive mounts but user can't write to drive

    Quote Originally Posted by Morbius1 View Post
    But as you stated above this is a workaround not a solution. Something's not right here.
    I'll do a bit more searching and then post about it on the Lucid development forum and search launchpad later on. I'm hoping its a short term beta release issue and that the behaviour will return to normal for Lucid release.

    The 'workaround' is helping me back up work for now, so I'm marking this as solved.

  10. #10
    Join Date
    Sep 2008
    Beans
    7

    Re: USB drive mounts but user can't write to drive

    This issue cropped up in 9.10 after the last update too

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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