Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   Absolutely cannot write to USB drive (http://www.linux-archive.org/debian-user/32539-absolutely-cannot-write-usb-drive.html)

"Dotan Cohen" 01-08-2008 11:33 PM

Absolutely cannot write to USB drive
 
I have a 2GB Sandisk Cruzer USB drive that I removed the U3 garbage
from. I formatted the disk as FAT in a friend's WindowsXP machine.
Now, any Windows machine can read and write to the disk, and my Fedora
desktop can read and write to it as a regular user. However, my Ubuntu
Feisty 7.04 laptop can only write as root.

I have this is my fstab (yes, it is the correct device):
/dev/sdb1 /media/usb auto rw,users,noauto 0 0

However, HAL does not auto mount so I must manually mount it:
feisty@feisty-laptop:~$ mount -o rw /dev/sdb1 /media/usb/
mount: only root can do that
feisty@feisty-laptop:~$ sudo mount -o rw /dev/sdb1 /media/usb/
feisty@feisty-laptop:~$ sudo chown feisty /media/usb/
chown: changing ownership of `/media/usb/': Operation not permitted

As you can see, despite the "users" option in fstab, only root can
mount. And even then, I cannot change the user. What is to be done?
Ideally, HAL would automount this device such that users could write
to it.

Thanks in advance.

Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-*-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

"Chris Howie" 01-08-2008 11:35 PM

Absolutely cannot write to USB drive
 
Try "mount /media/usb" as a user.

On Jan 8, 2008 7:33 PM, Dotan Cohen <dotancohen@gmail.com> wrote:

I have a 2GB Sandisk Cruzer USB drive that I removed the U3 garbage
from. I formatted the disk as FAT in a friend's WindowsXP machine.
Now, any Windows machine can read and write to the disk, and my Fedora
desktop can read and write to it as a regular user. However, my Ubuntu

Feisty 7.04 laptop can only write as root.

I have this is my fstab (yes, it is the correct device):
/dev/sdb1 /media/usb auto rw,users,noauto 0 0

However, HAL does not auto mount so I must manually mount it:

feisty@feisty-laptop:~$ mount -o rw /dev/sdb1 /media/usb/
mount: only root can do that
feisty@feisty-laptop:~$ sudo mount -o rw /dev/sdb1 /media/usb/
feisty@feisty-laptop:~$ sudo chown feisty /media/usb/
chown: changing ownership of `/media/usb/': Operation not permitted


As you can see, despite the "users" option in fstab, only root can
mount. And even then, I cannot change the user. What is to be done?
Ideally, HAL would automount this device such that users could write

to it.

Thanks in advance.

Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-*-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

--
Chris Howie

http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

"Dotan Cohen" 01-08-2008 11:49 PM

Absolutely cannot write to USB drive
 
On 09/01/2008, Chris Howie <cdhowie@gmail.com> wrote:
> Try "mount /media/usb" as a user.
>

That's all there was to it??! Thanks, that worked!

I can get by now, but for the wife's sake, can this be handled by
HAL's automount?

Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-*-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

John Schmidt 01-08-2008 11:59 PM

Absolutely cannot write to USB drive
 
On Tuesday 08 January 2008, Dotan Cohen wrote:
> I have a 2GB Sandisk Cruzer USB drive that I removed the U3 garbage
> from. I formatted the disk as FAT in a friend's WindowsXP machine.
> Now, any Windows machine can read and write to the disk, and my Fedora
> desktop can read and write to it as a regular user. However, my Ubuntu
> Feisty 7.04 laptop can only write as root.
>
> I have this is my fstab (yes, it is the correct device):
> /dev/sdb1 /media/usb auto rw,users,noauto 0 0
>
> However, HAL does not auto mount so I must manually mount it:
> feisty@feisty-laptop:~$ mount -o rw /dev/sdb1 /media/usb/
> mount: only root can do that
> feisty@feisty-laptop:~$ sudo mount -o rw /dev/sdb1 /media/usb/
> feisty@feisty-laptop:~$ sudo chown feisty /media/usb/
> chown: changing ownership of `/media/usb/': Operation not permitted
>
> As you can see, despite the "users" option in fstab, only root can
> mount. And even then, I cannot change the user. What is to be done?
> Ideally, HAL would automount this device such that users could write
> to it.
>

What are your groups that you belong to? You might have to add yourself to
the plugdev group.

Here are my groups and I can do the usb drive thing:

dialout cdrom floppy audio video plugdev fuse powerdev

John


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

"Dotan Cohen" 01-09-2008 07:21 AM

Absolutely cannot write to USB drive
 
On 09/01/2008, John Schmidt <john.andrew.schmidt@gmail.com> wrote:
> What are your groups that you belong to? You might have to add yourself to
> the plugdev group.

feisty@feisty-laptop:~$ groups
feisty adm dialout cdrom floppy audio dip video plugdev scanner netdev
lpadmin powerdev admin

> Here are my groups and I can do the usb drive thing:
>
> dialout cdrom floppy audio video plugdev fuse powerdev

Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-*-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Ron Johnson 01-09-2008 07:33 AM

Absolutely cannot write to USB drive
 
On 01/09/08 02:21, Dotan Cohen wrote:

On 09/01/2008, John Schmidt <john.andrew.schmidt@gmail.com> wrote:

What are your groups that you belong to? You might have to add yourself to
the plugdev group.


feisty@feisty-laptop:~$ groups
feisty adm dialout cdrom floppy audio dip video plugdev scanner netdev
lpadmin powerdev admin


Since this is a Feisty Fawn box, and Ubuntu doesn't do everything
the same way that Debian does, it might behoove you to ask these
questions on the Ubuntu Forums.


Anyway, why do you have an entry for it in /etc/fstab? The Big
Desktops will automount any USB drive you plug in.



Here are my groups and I can do the usb drive thing:

dialout cdrom floppy audio video plugdev fuse powerdev


--
Ron Johnson, Jr.
Jefferson LA USA

"I'm not a vegetarian because I love animals, I'm a vegetarian
because I hate vegetables!"
unknown


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

"Dotan Cohen" 01-09-2008 08:41 AM

Absolutely cannot write to USB drive
 
On 09/01/2008, Ron Johnson <ron.l.johnson@cox.net> wrote:
> On 01/09/08 02:21, Dotan Cohen wrote:
> > On 09/01/2008, John Schmidt <john.andrew.schmidt@gmail.com> wrote:
> >> What are your groups that you belong to? You might have to add yourself to
> >> the plugdev group.
> >
> > feisty@feisty-laptop:~$ groups
> > feisty adm dialout cdrom floppy audio dip video plugdev scanner netdev
> > lpadmin powerdev admin
>
> Since this is a Feisty Fawn box, and Ubuntu doesn't do everything
> the same way that Debian does, it might behoove you to ask these
> questions on the Ubuntu Forums.

I will. I find that technical knowledge is often replaced by MS
bashing there, but I'll take my chances.

> Anyway, why do you have an entry for it in /etc/fstab? The Big
> Desktops will automount any USB drive you plug in.

Because HAL wasn't automounting it, and I could not mount it
read/write for users. Googling the problem led me to believe that I
needed an fstab entry. Indeed, I still believe that I do, otherwise it
gets mounted with the wrong encoding and Hebrew filenames show up as
??? or gibberish.

Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-*-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Sjoerd Hardeman 01-09-2008 09:03 AM

Absolutely cannot write to USB drive
 
Dotan Cohen schreef:
> On 09/01/2008, Ron Johnson <ron.l.johnson@cox.net> wrote:
>> On 01/09/08 02:21, Dotan Cohen wrote:
>>> On 09/01/2008, John Schmidt <john.andrew.schmidt@gmail.com> wrote:
>>>> What are your groups that you belong to? You might have to add yourself to
>>>> the plugdev group.
>>> feisty@feisty-laptop:~$ groups
>>> feisty adm dialout cdrom floppy audio dip video plugdev scanner netdev
>>> lpadmin powerdev admin
>> Since this is a Feisty Fawn box, and Ubuntu doesn't do everything
>> the same way that Debian does, it might behoove you to ask these
>> questions on the Ubuntu Forums.
>
> I will. I find that technical knowledge is often replaced by MS
> bashing there, but I'll take my chances.
>
>> Anyway, why do you have an entry for it in /etc/fstab? The Big
>> Desktops will automount any USB drive you plug in.
>
> Because HAL wasn't automounting it, and I could not mount it
> read/write for users. Googling the problem led me to believe that I
> needed an fstab entry. Indeed, I still believe that I do, otherwise it
> gets mounted with the wrong encoding and Hebrew filenames show up as
> ??? or gibberish.
It is strange that hal isn't mounting it. Is hal running properly (try
lshal).
You can mount in userspace using pmount /dev/sdb1. It will then mount
under /media/sdb1 with read-write privileges for the user that mounted
the drive. If you want a user to be able to read-write with a
root-mount, make sure you state the proper rights in the fstab-entry.
Make a group that is allowed to read-write to the device, and add
/dev/sdb1 /media/usb auto rw,users,noauto,gid=xxx,umask=007 0 0
with xxx replaced by the id of that group (or give system wide
read-write privileges by stating umask=000)
As fat doesn't support a proper security-model, you have to specify that
yourself. Else only root can read.
Good luck!

Sjoerd


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

"Dotan Cohen" 01-09-2008 06:33 PM

Absolutely cannot write to USB drive
 
On 09/01/2008, Sjoerd Hardeman <sjoerd@lorentz.leidenuniv.nl> wrote:
> It is strange that hal isn't mounting it. Is hal running properly (try
> lshal).

I got lots of output from that command, so I assume that HAL is running.

> You can mount in userspace using pmount /dev/sdb1. It will then mount
> under /media/sdb1 with read-write privileges for the user that mounted
> the drive. If you want a user to be able to read-write with a
> root-mount, make sure you state the proper rights in the fstab-entry.
> Make a group that is allowed to read-write to the device, and add
> /dev/sdb1 /media/usb auto rw,users,noauto,gid=xxx,umask=007 0 0
> with xxx replaced by the id of that group (or give system wide
> read-write privileges by stating umask=000)
> As fat doesn't support a proper security-model, you have to specify that
> yourself. Else only root can read.
> Good luck!

Thanks, I did not know about pmount. I'll remove the fstab entry and
use pmount from now on.

I'd still like to get HAL mounting this disk. I installed and maintain
a dozen or so friends' ubuntu, and if they ever come across this I'd
like to have a solution ready.

Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-*-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Florian Kulzer 01-09-2008 08:12 PM

Absolutely cannot write to USB drive
 
On Wed, Jan 09, 2008 at 21:33:03 +0200, Dotan Cohen wrote:
> On 09/01/2008, Sjoerd Hardeman wrote:
> > It is strange that hal isn't mounting it. Is hal running properly (try
> > lshal).
>
> I got lots of output from that command, so I assume that HAL is running.

The amount of information is a bit overwhelming, isn't it? It might help
to run "lshal --monitor" and plug in the problematic device. That should
narrow it down a bit. Maybe the device is not recognized as "removable"
or a policy blocks the automounting. (daemon.log might also be worth a
look.)

> > You can mount in userspace using pmount /dev/sdb1. It will then mount
> > under /media/sdb1 with read-write privileges for the user that mounted
> > the drive. If you want a user to be able to read-write with a
> > root-mount, make sure you state the proper rights in the fstab-entry.
> > Make a group that is allowed to read-write to the device, and add
> > /dev/sdb1 /media/usb auto rw,users,noauto,gid=xxx,umask=007 0 0
> > with xxx replaced by the id of that group (or give system wide
> > read-write privileges by stating umask=000)
> > As fat doesn't support a proper security-model, you have to specify that
> > yourself. Else only root can read.
> > Good luck!
>
> Thanks, I did not know about pmount. I'll remove the fstab entry and
> use pmount from now on.

When things go wrong with pmount it is usually because the device is not
recognized as removable. In that case you can whitelist the device in
/etc/pmount.allow.

> I'd still like to get HAL mounting this disk. I installed and maintain
> a dozen or so friends' ubuntu, and if they ever come across this I'd
> like to have a solution ready.

If the output of "lshal --monitor" does not provide enough clues by
itself, it might help to look the existing .fdi files in /etc/hal/fdi/
and /usr/share/hal/fdi/. There are a lot of things that can be tuned
with HAL. If necessary you can run your own scripts via a HAL callout
whenever the device is plugged in. The HAL specifications are in

/usr/share/doc/hal-doc/spec/hal-spec.html

which is part of package hal-doc. (I have only played around with HAL a
little bit so far and I don't know anything about Gnome, therefore I
cannot make more specific suggestions.)

--
Regards, | http://users.icfo.es/Florian.Kulzer
Florian |


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


All times are GMT. The time now is 03:01 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.