2

I'm using Debian Stretch. I plug in a USB, then open Nautilus (as an unprivileged user). I click mount on the USB and Nautilus mounts it. However, only privileged users can write to it.

Is there some way to make Nautilus mount the device so at the very least the user who mounted the drive can write to it?

fixer1234
  • 27,064
  • 61
  • 75
  • 116
nullUser
  • 723
  • 1
  • 12
  • 30
  • rw has always been the _default_; doing otherwise would sort of defeat the purpose. Where do you see "read only" – in `mount`/`findmnt` or elsewhere? – u1686_grawity Nov 03 '15 at 06:04
  • Sure it's not mounted as `rw`, but your user just doesn't have permission to write to it? Or maybe there's a filesystem problem that forces a `ro` mount? Check mount's output as grawity suggests, maybe even dmesg or the syslog for errors – Xen2050 Nov 03 '15 at 06:08
  • Both commenters were correct, it was mounted rw, but the mounting user didn't have permission to write to it. Please see updated question. – nullUser Nov 03 '15 at 06:11
  • What filesystem does the drive use? – u1686_grawity Nov 03 '15 at 07:10
  • Drive is NTFS, but I would like it to work for ext4 as well. – nullUser Nov 03 '15 at 14:15
  • Stumbled across this is an old question that never received an answer. Please let us know whether you ever solved it or if it was overtaken by events. If you still have the problem, it sounds a little like one I ran into. See https://superuser.com/questions/849433/hard-drive-writeable-but-not-by-file-manager. – fixer1234 Mar 29 '17 at 06:50
  • This problem was never resolved. Filenames play no apparent role in my case. – nullUser Mar 30 '17 at 01:42
  • I think I have the same problem, with Debian jessie. When I mount a USB drive in Nautilus, it mounts on `/media/usb0` but that directory is owned by `root`, and my user account can't write to it. However, if I mount it on the terminal instead, with `udisks --mount /dev/sde1`, it's owned by me and writable. I need to find out what Nautilus is doing differently. – Chad May 02 '17 at 03:11

1 Answers1

1

I figured out why this was happening for me. I had an entry for /dev/sde1 in /etc/fstab:

/dev/sde1     /media/usb0    auto        rw,user,noauto    0  0

I edited that file as root and removed that line, and now USB drives mounted by nautilus are owned and writable by me!

On other systems, it's likely that /dev/sde1 is not the right device. To find out what it would be for you, you can watch the output of sudo tail -f /var/log/messages when you plug in the drive. It should show a bunch of lines like this:

May  1 21:00:10 centurion kernel: [14151.300528] scsi 12:0:0:0: Direct-Access     Generic  Flash Disk       8.07 PQ: 0 ANSI: 2
May  1 21:00:10 centurion kernel: [14151.301788] sd 12:0:0:0: Attached scsi generic sg5 type 0
May  1 21:00:10 centurion kernel: [14151.305140] sd 12:0:0:0: [sde] 1966078 512-byte logical blocks: (1.00 GB/959 MiB)
May  1 21:00:10 centurion kernel: [14151.305755] sd 12:0:0:0: [sde] Write Protect is off
May  1 21:00:10 centurion kernel: [14151.312524]  sde: sde1
May  1 21:00:10 centurion kernel: [14151.316724] sd 12:0:0:0: [sde] Attached SCSI removable disk

The line with sde: sde1 shows that the device for the USB drive is sde and it has one partition, so the device file to mount is /dev/sde1.

Chad
  • 121
  • 3