[opensuse] how to mount ext2 USB-stick as user
I partitioned a 2Gb USB stick into 500MB vfat and 1.5 GB ext2 using YaST2 partitioner. When I connect the stick, HAL mounts the vfat partition as username.user, but the ext2 partition as root.root under /media. Anyway to control how Hal mounts the ext2 partition? If I right-click the link in Storage Media in Konqueror, I can control the mount options (user, etc) in the vfat link, but not in the ext2 link (owned by root). -- Carlos FL "It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that." - G. H. Hardy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, 2008-01-03 at 15:48 -0700, Carlos F. Lange wrote:
I partitioned a 2Gb USB stick into 500MB vfat and 1.5 GB ext2 using YaST2 partitioner. When I connect the stick, HAL mounts the vfat partition as username.user, but the ext2 partition as root.root under /media. Anyway to control how Hal mounts the ext2 partition?
The files and directories in the ext2 partition already know who they belong to - they have uids and gids. An easy technique that will probably give you what you want is to mount the stick, then as root create a directory on it called say 'carlos-dir'. Then chown carlos carlos-dir. Now switch back to your normal carlos userid and you'll be able to do whatever you like in the carlos-dir directory. HTH, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu January 3 2008 16:21:14 Dave Howorth wrote:
On Thu, 2008-01-03 at 15:48 -0700, Carlos F. Lange wrote:
I partitioned a 2Gb USB stick into 500MB vfat and 1.5 GB ext2 using YaST2 partitioner. When I connect the stick, HAL mounts the vfat partition as username.user, but the ext2 partition as root.root under /media. Anyway to control how Hal mounts the ext2 partition?
The files and directories in the ext2 partition already know who they belong to - they have uids and gids.
An easy technique that will probably give you what you want is to mount the stick, then as root create a directory on it called say 'carlos-dir'. Then chown carlos carlos-dir. Now switch back to your normal carlos userid and you'll be able to do whatever you like in the carlos-dir directory.
That is what I did. But it means that if I want to create another top level directory I need to be root, which in the case of an insecure, convenient transfer media is annoying. And in case I connect it to someone else's machine, it will be mounted with however is user UID in their machine, which might not be the current user and then the permissions are not right, etc. -- Carlos FL "It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that." - G. H. Hardy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 * Carlos F. Lange <carlos.lange@ualberta.ca> [01-03-08 18:34]:
But it means that if I want to create another top level directory I need to be root, which in the case of an insecure, convenient transfer media is annoying.
And in case I connect it to someone else's machine, it will be mounted with however is user UID in their machine, which might not be the current user and then the permissions are not right, etc.
then make the owner of the partition "users" ie: chmod users:users /mnt/<name> and "anyone" in users can access it. - -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFHfYF8ClSjbQz1U5oRAhpUAJ9lLssd44DtgGFGw5LZm3PLd7xxuwCfWUmz 4PIhYajxI6Vhbg6W/061iT8= =er6b -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu January 3 2008 17:44:45 Patrick Shanahan wrote:
And in case I connect it to someone else's machine, it will be mounted with however is user UID in their machine, which might not be the current user and then the permissions are not right, etc.
then make the owner of the partition "users"
ie: chmod users:users /mnt/<name>
and "anyone" in users can access it.
For that I need to be root, which in the general case neither me nor the owner of the machine may be. That is the convenience of the vfat partition that Hal mounts as owned by the currently active user, as with the "users" option of mount. Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user? -- Carlos FL "It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that." - G. H. Hardy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
<newby alert> Hello Can't you just use 2 (or 3 or 4 or N) directories for your USB drives? In that case you could set the permissions once, as root, and use it forever. You could (I belive) mount it as user and have the acces as setted by root. </newby alert> On Jan 4, 2008 6:26 AM, Carlos F. Lange <carlos.lange@ualberta.ca> wrote:
On Thu January 3 2008 17:44:45 Patrick Shanahan wrote:
And in case I connect it to someone else's machine, it will be mounted with however is user UID in their machine, which might not be the current user and then the permissions are not right, etc.
then make the owner of the partition "users"
ie: chmod users:users /mnt/<name>
and "anyone" in users can access it.
For that I need to be root, which in the general case neither me nor the owner of the machine may be. That is the convenience of the vfat partition that Hal mounts as owned by the currently active user, as with the "users" option of mount.
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user?
-- Carlos FL "It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that." - G. H. Hardy --
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos F. Lange a écrit :
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user?
problem is only if you want to ba able to use this key with others computer. If so: * you can't know what UID/GID is used (AFAIK only UID/GID are stored in the file system) * only the "onboard" modification will be ported with you :-( so, for true protability, better stick to fat32 :-( jdd (I play by now installing openSUSE on USB stick, with some success) -- http://www.dodin.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, Jan 04, 2008 at 09:37:43AM +0100, jdd wrote:
Carlos F. Lange a écrit :
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user? problem is only if you want to ba able to use this key with others computer.
If so:
* you can't know what UID/GID is used (AFAIK only UID/GID are stored in the file system) * only the "onboard" modification will be ported with you :-(
so, for true protability, better stick to fat32 :-(
Actually, something like chmod 777 dir should give everyone, regardless of their UID/GID, read- and write access. Rasmus -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri January 4 2008 01:48:28 Rasmus Plewe wrote:
On Fri, Jan 04, 2008 at 09:37:43AM +0100, jdd wrote:
Carlos F. Lange a écrit :
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user?
problem is only if you want to ba able to use this key with others computer.
If so:
* you can't know what UID/GID is used (AFAIK only UID/GID are stored in the file system) * only the "onboard" modification will be ported with you :-(
so, for true protability, better stick to fat32 :-(
Actually, something like chmod 777 dir should give everyone, regardless of their UID/GID, read- and write access.
The point here is that the permissions for the ext2 partition are set by the automounter in the host machine. I only can set permissions of directories and files in the partition. -- Carlos FL "It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that." - G. H. Hardy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, Jan 04, 2008 at 09:14:19AM -0700, Carlos F. Lange wrote:
On Fri January 4 2008 01:48:28 Rasmus Plewe wrote:
On Fri, Jan 04, 2008 at 09:37:43AM +0100, jdd wrote:
Carlos F. Lange a écrit :
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user?
problem is only if you want to ba able to use this key with others computer.
If so:
* you can't know what UID/GID is used (AFAIK only UID/GID are stored in the file system) * only the "onboard" modification will be ported with you :-(
so, for true protability, better stick to fat32 :-(
Actually, something like chmod 777 dir should give everyone, regardless of their UID/GID, read- and write access.
The point here is that the permissions for the ext2 partition are set by the automounter in the host machine. I only can set permissions of directories and files in the partition.
That is correct. I was referring to the workaround of creating a directory in the ext2 partition that then contains the data. For the mount point itself I think you don't have any options that work across different machines. Rasmus -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri January 4 2008 09:20:39 Rasmus Plewe wrote:
Actually, something like chmod 777 dir should give everyone, regardless of their UID/GID, read- and write access.
The point here is that the permissions for the ext2 partition are set by the automounter in the host machine. I only can set permissions of directories and files in the partition.
That is correct. I was referring to the workaround of creating a directory in the ext2 partition that then contains the data. For the mount point itself I think you don't have any options that work across different machines.
OK, I just replied to CER the same thing. -- Carlos FL "It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that." - G. H. Hardy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
"Carlos F. Lange" <carlos.lange@ualberta.ca> writes:
On Thu January 3 2008 17:44:45 Patrick Shanahan wrote:
And in case I connect it to someone else's machine, it will be mounted with however is user UID in their machine, which might not be the current user and then the permissions are not right, etc.
then make the owner of the partition "users"
ie: chmod users:users /mnt/<name>
and "anyone" in users can access it.
For that I need to be root, which in the general case neither me nor the owner of the machine may be. That is the convenience of the vfat partition that Hal mounts as owned by the currently active user, as with the "users" option of mount.
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user?
Not that I'm aware of. You can create on your system an own fdi file for hal (AFAIK in /etc/hal/fdi) that does specific action once a specific USB stick is mounted. But that works only on the system you set it up and you need to be root to set it up initially, Andreas -- Andreas Jaeger, Director Platform/openSUSE, aj@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Thursday 2008-01-03 at 22:26 -0700, Carlos F. Lange wrote:
On Thu January 3 2008 17:44:45 Patrick Shanahan wrote:
And in case I connect it to someone else's machine, it will be mounted with however is user UID in their machine, which might not be the current user and then the permissions are not right, etc.
then make the owner of the partition "users"
ie: chmod users:users /mnt/<name>
and "anyone" in users can access it.
For that I need to be root, which in the general case neither me nor the owner of the machine may be. That is the convenience of the vfat partition that Hal mounts as owned by the currently active user, as with the "users" option of mount.
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user?
No. Unix type filesystems are mounted with permissions marked by the filesystem, not by whom is mounting it. Interesting problem, this... universal access to an usb stick as user plugged in by the user. Mind, on some places usb sticks are banned, and the usb bus is disabled in hardware, so that employees can not use usb sticks to violate security protocols. For portability, make directories and load everything inside. And notice, that the user "name" on your computer may not have permission on another machine, because the UID maybe different. Better make sure the directory is marked at least "read" for everybody, possibly "read/write". - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFHfhGGtTMYHG2NR9URAsFvAJ0b/UqLlSzdUC30hYt5xLlVfYA0qACdG95Y Z2GtpLgAFjLMdDDwRg+CBak= =jc8W -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
The Thursday 2008-01-03 at 22:26 -0700, Carlos F. Lange wrote:
On Thu January 3 2008 17:44:45 Patrick Shanahan wrote:
And in case I connect it to someone else's machine, it will be mounted with however is user UID in their machine, which might not be the current user and then the permissions are not right, etc.
then make the owner of the partition "users"
ie: chmod users:users /mnt/<name>
and "anyone" in users can access it.
For that I need to be root, which in the general case neither me nor the owner of the machine may be. That is the convenience of the vfat partition that Hal mounts as owned by the currently active user, as with the "users" option of mount.
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user?
No. Unix type filesystems are mounted with permissions marked by the filesystem, not by whom is mounting it.
Interesting problem, this... universal access to an usb stick as user plugged in by the user. Mind, on some places usb sticks are banned, and the usb bus is disabled in hardware, so that employees can not use usb sticks to violate security protocols.
It should be interesting when only USB mice and keyboards are available. ;-) -- Use OpenOffice.org <http://www.openoffice.org> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri January 4 2008 03:59:18 Carlos E. R. wrote:
For portability, make directories and load everything inside. And notice, that the user "name" on your computer may not have permission on another machine, because the UID maybe different. Better make sure the directory is marked at least "read" for everybody, possibly "read/write".
I agree this would be the best solution, i.e. create a top level directory with a generic name, say USB, to serve as the real top level and make it read/write for all (chmod 777). Then anyone can write to it on any machine. Also, the files deposited there need to be made readable to all. This way the USB stick can serve as (insecure) transport media. -- Carlos FL "It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that." - G. H. Hardy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos F. Lange wrote:
On Thu January 3 2008 17:44:45 Patrick Shanahan wrote:
And in case I connect it to someone else's machine, it will be mounted with however is user UID in their machine, which might not be the current user and then the permissions are not right, etc.
then make the owner of the partition "users"
ie: chmod users:users /mnt/<name>
and "anyone" in users can access it.
For that I need to be root, which in the general case neither me nor the owner of the machine may be. That is the convenience of the vfat partition that Hal mounts as owned by the currently active user, as with the "users" option of mount.
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user?
Given that it's entirely possible to have multiple users logged in at the same time, which user would own it? -- Use OpenOffice.org <http://www.openoffice.org> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri January 4 2008 05:16:51 James Knott wrote:
Given that it's entirely possible to have multiple users logged in at the same time, which user would own it?
I don't recall precisely, but I think automounter associates new mounts with the user that currently has the active desktop (ctrl+alt+F7, ctrl+alt+F8, etc). -- Carlos FL "It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that." - G. H. Hardy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri January 4 2008 10:11:37 Carlos F. Lange wrote:
On Fri January 4 2008 05:16:51 James Knott wrote:
Given that it's entirely possible to have multiple users logged in at the same time, which user would own it?
I don't recall precisely, but I think automounter associates new mounts with the user that currently has the active desktop (ctrl+alt+F7, ctrl+alt+F8, etc).
OK, I just tested this and confirmed. Hal gives ownership to the currently active user and when you switch users the ownership remains as when the partition was initially mounted. -- Carlos FL "It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that." - G. H. Hardy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos F. Lange wrote:
On Fri January 4 2008 10:11:37 Carlos F. Lange wrote:
On Fri January 4 2008 05:16:51 James Knott wrote:
Given that it's entirely possible to have multiple users logged in at the same time, which user would own it? I don't recall precisely, but I think automounter associates new mounts with the user that currently has the active desktop (ctrl+alt+F7, ctrl+alt+F8, etc).
OK, I just tested this and confirmed. Hal gives ownership to the currently active user
That seems to conflict with data I've collected. If someone starts another X session after yours is established, and you then plug in a device, are you sure the ownership will not be assigned to the person who logged in after you?
and when you switch users the ownership remains as when the partition was initially mounted.
Naturally it won't change ownership once assigned. Joe -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri January 4 2008 16:53:27 Joe Sloan wrote:
OK, I just tested this and confirmed. Hal gives ownership to the currently active user
That seems to conflict with data I've collected. If someone starts another X session after yours is established, and you then plug in a device, are you sure the ownership will not be assigned to the person who logged in after you?
That is what I meant. First USB mount I did was assigned to me, then I switched user to my wife and plugged in another device, which was mounted under her name. Then I switched back (ctrl+alt+F7) and plugged in my iRiver player, which was mounted under my name. That is, devices are mounted by the currently active X session owner, regardless of who logged in last. -- Carlos FL "It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that." - G. H. Hardy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
Carlos F. Lange wrote:
On Thu January 3 2008 17:44:45 Patrick Shanahan wrote:
And in case I connect it to someone else's machine, it will be mounted with however is user UID in their machine, which might not be the current user and then the permissions are not right, etc.
then make the owner of the partition "users"
ie: chmod users:users /mnt/<name>
and "anyone" in users can access it.
For that I need to be root, which in the general case neither me nor the owner of the machine may be. That is the convenience of the vfat partition that Hal mounts as owned by the currently active user, as with the "users" option of mount.
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user?
Given that it's entirely possible to have multiple users logged in at the same time, which user would own it?
This is a fairly arbitrary design decision, so there's room for discussion about the particular tradeoffs. My recent experience seems to indicate that the ownership of the device is assigned to the last person who started an X session. Joe -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Friday 2008-01-04 at 07:16 -0500, James Knott wrote: ...
Can I set something on my USB ext2 partition to tell Hal to automount it as owned by the user?
Given that it's entirely possible to have multiple users logged in at the same time, which user would own it?
Hal or whatever Knows :-) The user logged in locally, ie, the same user that gets ownership of an scanner, for instance. Problem is when there are two... I don't know who gets access, the first one or the last. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFHfoH5tTMYHG2NR9URAijFAJ40p7ol/g/mj7qYb4Gxvnam47ZP7QCfWOf1 ty/e7rLzbdLQcQwPc9GE0VU= =6rW6 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (11)
-
Andreas Jaeger
-
Carlos E. R.
-
Carlos F. Lange
-
Dave Howorth
-
James Knott
-
jdd
-
Joe Sloan
-
Neil
-
Patrick Shanahan
-
Rasmus Plewe
-
Sloan