FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 09-15-2008, 06:48 PM
Karl Larsen
 
Default USB external disk write permission. What have I done wrong?

Zhengguo Xu wrote:
> Hi,
>
> I formated a 160GB external usb disk as ext3 file system using GParted
> (logical instead of primary) and when it mounted automatically i don't have
> write permission. in disk property tab it says the disk's owner and its
> group are root. googled a bit and issued the following command:
>
> sudo chown zhengguo:zhengguo /media/disk
>
> yes i have write permission now. however, when i umount it, unpluged it and
> plugged it again, the disk could not mount automatically.
>
> what have I done wrong? How can i get the automatical mount function back
> and at the same time have write permission? (I am NOT talking about write a
> line in /etc/fstab to mount /dev/sdb1 or whatever because before i formated
> the disk, it can be auto-mounted without a such line in fstab)
>
> also, in GParted I couldn't find it anywhere to change disk label. Is it
> because of the GParted lacking of this function or just because i'm a newbie
> so...? I'd like this 160GB disk AUTOMATICALLY mounted when plugged in AND
> appear as "eBooks" (this is the disk label i'd like to use). Can it be done?
> How? google doesn't help much at this point. if i need to reformat the disk
> and it can only be done in command-line, can anyone kindly provide the
> command?
>
> thanks.
>
>
First chown will NOT work on /media/disk/. You need to use df to
find out the right /dev/ to use. Then you can use chown on your external
partition.

Now you did chown /media/disk/ so look at that with ls -al and see
what it is. On my Hardy it is:

karl@karl-hardy:~$ ls -al /media
total 16
drwxr-xr-x 4 root root 4096 2008-09-14 12:40 .
drwxr-xr-x 22 root root 4096 2008-09-05 12:13 ..
drwxr-xr-x 3 root root 4096 2008-08-19 13:52 boot
lrwxrwxrwx 1 root 999 6 2008-06-14 11:16 cdrom -> cdrom0
drwxr-xr-x 2 root 999 4096 2008-06-14 11:16 cdrom0
-rw-r--r-- 1 root root 0 2008-09-14 12:40 .hal-mtab
-rw------- 1 root root 0 2008-09-02 15:04 .hal-mtab-lock
karl@karl-hardy:~$

In words both owner and group are root. If they are something else
please change back to this.


DF will print out the address for your external hard drive. Do NOT
write anything in /etc/fstab.


Karl



--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-15-2008, 07:30 PM
Rashkae
 
Default USB external disk write permission. What have I done wrong?

Karl Larsen wrote:

>>
> First chown will NOT work on /media/disk/. You need to use df to
> find out the right /dev/ to use. Then you can use chown on your external
> partition.

This is just wrong, wrong, and wrong,, never chown /dev entries unless
you *really* know what you're doing... chown /media/disk was the right
thing to do.

Sorry, don't know why changing the ownership on an external FS would
prevent automount from working, and not able to test right atm.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-15-2008, 08:22 PM
Karl Larsen
 
Default USB external disk write permission. What have I done wrong?

Rashkae wrote:
> Karl Larsen wrote:
>
>
>>>
>>>
>> First chown will NOT work on /media/disk/. You need to use df to
>> find out the right /dev/ to use. Then you can use chown on your external
>> partition.
>>
>
> This is just wrong, wrong, and wrong,, never chown /dev entries unless
> you *really* know what you're doing... chown /media/disk was the right
> thing to do.
>
> Sorry, don't know why changing the ownership on an external FS would
> prevent automount from working, and not able to test right atm.
>
>
Well I KNOW you can chown from the /dev/ address because I did it on
MY USB hard drive. Worked fine and did not stop automount. Where do you
get your info that it is risky to use /dev/???


Karl


--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-15-2008, 08:39 PM
"Zhengguo Xu"
 
Default USB external disk write permission. What have I done wrong?

ok. problem solved by root the PC. no idea why so.

still, my question about disk labels was unanswered.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-15-2008, 08:50 PM
Karl Larsen
 
Default USB external disk write permission. What have I done wrong?

Zhengguo Xu wrote:
> ok. problem solved by root the PC. no idea why so.
>
> still, my question about disk labels was unanswered.
>
>
Please read if you can "man mkfs" which explains how to make a file
system and also how to name it.

Karl


--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-16-2008, 02:23 AM
Derek Broughton
 
Default USB external disk write permission. What have I done wrong?

Karl Larsen wrote:

> Well I KNOW you can chown from the /dev/ address because I did it on
> MY USB hard drive. Worked fine and did not stop automount. Where do you
> get your info that it is risky to use /dev/???

On a single user system, it probably isn't that risky. You either have
access to a device, or you don't and then you want to change either
permissions or ownership. But as a general principle, somebody went to
some trouble to decide what the ownership of every device should be, and
when you change that, you risk preventing other users from accessing the
device.

On top of that, changing permissions or ownership of /dev nodes with chown,
chgrp and chmod is purely temporary - those settings are made by udev, so
unless you change the relevant udev rule, they get reset when you reboot.
--
derek


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-16-2008, 03:27 AM
Rashkae
 
Default USB external disk write permission. What have I done wrong?

Derek Broughton wrote:
> Karl Larsen wrote:
>
>> Well I KNOW you can chown from the /dev/ address because I did it on
>> MY USB hard drive. Worked fine and did not stop automount. Where do you
>> get your info that it is risky to use /dev/???
>
> On a single user system, it probably isn't that risky. You either have
> access to a device, or you don't and then you want to change either
> permissions or ownership. But as a general principle, somebody went to
> some trouble to decide what the ownership of every device should be, and
> when you change that, you risk preventing other users from accessing the
> device.
>
> On top of that, changing permissions or ownership of /dev nodes with chown,
> chgrp and chmod is purely temporary - those settings are made by udev, so
> unless you change the relevant udev rule, they get reset when you reboot.

chaning ownership on /dev devices will also give users write permission
on the raw device.. This is generally bad, since there is little reason
why a user should write directly to the device. You need to do so as
root to format or otherwise do low level service to the device, but in a
sane world, normal processes should not have permission to modify a file
system device outside of the file system layer. Especially when said
file system might be mounted!

And where I get my info? (yes I know Derek, this is Karl, sorry I'm
replying in your reply). My gods man, you got some balls asking me that
on this list.


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-16-2008, 11:53 AM
Karl Larsen
 
Default USB external disk write permission. What have I done wrong?

Rashkae wrote:
> Derek Broughton wrote:
>
>> Karl Larsen wrote:
>>
>>
>>> Well I KNOW you can chown from the /dev/ address because I did it on
>>> MY USB hard drive. Worked fine and did not stop automount. Where do you
>>> get your info that it is risky to use /dev/???
>>>
>> On a single user system, it probably isn't that risky. You either have
>> access to a device, or you don't and then you want to change either
>> permissions or ownership. But as a general principle, somebody went to
>> some trouble to decide what the ownership of every device should be, and
>> when you change that, you risk preventing other users from accessing the
>> device.
>>
>> On top of that, changing permissions or ownership of /dev nodes with chown,
>> chgrp and chmod is purely temporary - those settings are made by udev, so
>> unless you change the relevant udev rule, they get reset when you reboot.
>>
>
> chaning ownership on /dev devices will also give users write permission
> on the raw device.. This is generally bad, since there is little reason
> why a user should write directly to the device. You need to do so as
> root to format or otherwise do low level service to the device, but in a
> sane world, normal processes should not have permission to modify a file
> system device outside of the file system layer. Especially when said
> file system might be mounted!
>
> And where I get my info? (yes I know Derek, this is Karl, sorry I'm
> replying in your reply). My gods man, you got some balls asking me that
> on this list.
>
>
>
The real point to all this is when you get to the point of adding
the file system. To get mkfs.ext3 to work you must use the /dev/ address
AND unmount the USB connection. Then run mkfs. While there you can do
all the other stuff.

Karl


--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-16-2008, 02:27 PM
Derek Broughton
 
Default USB external disk write permission. What have I done wrong?

Rashkae wrote:

> chaning ownership on /dev devices will also give users write permission
> on the raw device.. This is generally bad, since there is little reason
> why a user should write directly to the device.

Well, it kind of depends on the device - there are all sorts of cases where
users _do_ need write permission on the raw device (but generally NOT
partitions!_, but this should have been handled by udev or some user-mode
package you've installed (ie, as I said, somebody went to a lot of trouble
to figure out what permissions each device should have).

> And where I get my info? (yes I know Derek, this is Karl, sorry I'm
> replying in your reply).

No problem!

> My gods man, you got some balls asking me that on this list.

<snort/>
--
derek


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-16-2008, 02:49 PM
Rashkae
 
Default USB external disk write permission. What have I done wrong?

Derek Broughton wrote:

> Well, it kind of depends on the device - there are all sorts of cases where
> users _do_ need write permission on the raw device (but generally NOT
> partitions!_, but this should have been handled by udev or some user-mode
> package you've installed (ie, as I said, somebody went to a lot of trouble
> to figure out what permissions each device should have).
>


Granted, I made a sweeping generalization. Examples that come to mind
where a user needs direct write access to a device would include sound
and mixer devices, as well as CD/DVD-R devices, so discs can be burned
without suid binaries. (As you've pointed out, these should all be
taken care of in the UDEV scripts and pre-configured groups)

That all being clarified in detail, I still think Karl should refrain
from suggesting people change the ownership of devices that are a
mounted filesystem! (Actually, I think Karl should refrain from using
the Reply button entirely, but I'm just in a grouchy mood. I'll be
happy for small victories )


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 07:00 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org