|
|
|
|
||||||
| linux.debian.user debian-user@lists.debian.org. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello,
I'm really having trouble getting my head around udev and udev rules for removeable USB devices. When I plug in my USB stick, it automounts under /media/sda1. What I don't like is that I have to "su" to write to the stick and to unmount it again, so this automounting is pretty useless. I've tried to decipher the files under /etc/udev to find the rule that actually mounts stuff, but grepping for "mount" just shows me some unmounting detail in a file called "hal.rules". What I'd like is: 1. Automounting USB mass storage devices under some unique name determined by the label of the partition 2. Write access and unmounting by normal user. I've seen this work transparently under Gnome and KDE, but I use fvwm or no X at all so that's no option for me. Thanks --D. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Thu, Sep 27, 2007 at 01:50:11PM +0200, Dan H wrote:
> Hello, > > I'm really having trouble getting my head around udev and udev rules > for removeable USB devices. When I plug in my USB stick, it automounts > under /media/sda1. What I don't like is that I have to "su" to write > to the stick and to unmount it again, so this automounting is pretty > useless. I've tried to decipher the files under /etc/udev to find the > rule that actually mounts stuff, but grepping for "mount" just shows > me some unmounting detail in a file called "hal.rules". > > What I'd like is: > > 1. Automounting USB mass storage devices under some unique name > determined by the label of the partition > > 2. Write access and unmounting by normal user. > > I've seen this work transparently under Gnome and KDE, but I use fvwm > or no X at all so that's no option for me. I've never had a problem; I've never used automount. What type of filesystem is on the USB and who created it? If root created an ext2, then it belongs to root. You would want to create it as your own user. If its FAT* then use the UID/GID mount options. Put the mount point in /etc/fstab and use the user option. You can use the LABEL= instead of a device name and create per-LABEL mount points and put them all in fstab. Doug. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Thu, Sep 27, 2007 at 01:50:11PM +0200, Dan H wrote:
> Hello, > > I'm really having trouble getting my head around udev and udev rules for removeable USB devices. When I plug in my USB stick, it automounts under /media/sda1. What I don't like is that I have to "su" to write to the stick and to unmount it again, so this automounting is pretty useless. I've tried to decipher the files under /etc/udev to find the rule that actually mountsstuff, but grepping for "mount" just shows me some unmounting detail in a file called "hal.rules". > > What I'd like is: > > 1. Automounting USB mass storage devices under some unique name determined > by the label of the partition > > 2. Write access and unmounting by normal user. > > I've seen this work transparently under Gnome and KDE, but I use fvwm or no X at all so that's no option for me. The package usbmount might be what you need. Regards, Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG+842qJyztHCFm9kRArdCAJ9SHexpYYKyXvohAtRV3U 2LaKf2IwCdE3dY XdZLr4kTDbnzjiSc9NQACus= =ORcI -----END PGP SIGNATURE----- |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Try an entry in /etc/udev/10-local.rules; great howtos on the net.
On Thursday 27 September 2007 07:50, Dan H wrote: > Hello, > > I'm really having trouble getting my head around udev and udev rules for > removeable USB devices. When I plug in my USB stick, it automounts under > /media/sda1. What I don't like is that I have to "su" to write to the stick > and to unmount it again, so this automounting is pretty useless. I've tried > to decipher the files under /etc/udev to find the rule that actually mounts > stuff, but grepping for "mount" just shows me some unmounting detail in a > file called "hal.rules". > > What I'd like is: > > 1. Automounting USB mass storage devices under some unique name determined > by the label of the partition > > 2. Write access and unmounting by normal user. > > I've seen this work transparently under Gnome and KDE, but I use fvwm or no > X at all so that's no option for me. > > Thanks > --D. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
* Jesus Arocho (2007-09-28):
> Try an entry in /etc/udev/10-local.rules; great howtos on the net. > > On Thursday 27 September 2007 07:50, Dan H wrote: [...] There's also great information on quoting, e.g. http://www.vranx.de/mail/tofu.html -André -- May as well be hung for a sheep as a lamb! Linkstation/KuroBox/HG/HS/Tera Kernel 2.6/PPC from <http://hvkls.dyndns.org> |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
Andrei Popescu wrote:
> The package usbmount might be what you need. The description of usbmount says: This package automatically mounts USB mass storage devices (typically USB pens) when they are plugged in, and unmounts them when they are removed. Does this limit filesystems to FAT? FAT doesn't care if you rip it out without doing any cleanup. If you've formatted your thumbdrive as an ext2 filesystem, how can it be properly unmounted if you simply unplug it? Won't that mean you have to run fsck every time you plug it in again? Best wishes, Max Hyre -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
On Sat, Sep 29, 2007 at 11:27:35AM -0400, Max Hyre wrote:
> Andrei Popescu wrote: >> The package usbmount might be what you need. > > The description of usbmount says: > > This package automatically mounts USB mass > storage devices (typically USB pens) when they > are plugged in, and unmounts them when they are > removed. > > Does this limit filesystems to FAT? FAT doesn't care if you rip it out > without doing any cleanup. If you've formatted your thumbdrive as an ext2 > filesystem, how can it be properly unmounted if you simply unplug it? > Won't that mean you have to run fsck every time you plug it in again? maybe mount with sync instead of async, though mount warns of life-shortening possibilities with flash stuff. probably a good idea to go for noatime also to coutneract that. Both of those would minimise the risk of damage -- so long as the current process was done, you could pull it. that just a guess. check man mount. A -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG/nVraIeIEqwil4YRAiskAJ9lIAh39cGGdyfc8Z/VqXcDjH5++gCeIv04 jt6biG8NLT63eNv8QyCU/WU= =tqtS -----END PGP SIGNATURE----- |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
On Sat, Sep 29, 2007 at 08:55:23AM -0700, Andrew Sackville-West wrote:
> On Sat, Sep 29, 2007 at 11:27:35AM -0400, Max Hyre wrote: > > Andrei Popescu wrote: > >> The package usbmount might be what you need. > > > > The description of usbmount says: > > > > This package automatically mounts USB mass > > storage devices (typically USB pens) when they > > are plugged in, and unmounts them when they are > > removed. > > > > Does this limit filesystems to FAT? FAT doesn't care if you rip it out > > without doing any cleanup. If you've formatted your thumbdrive as an ext2 > > filesystem, how can it be properly unmounted if you simply unplug it? > > Won't that mean you have to run fsck every time you plug it in again? > > maybe mount with sync instead of async, though mount warns of > life-shortening possibilities with flash stuff. probably a good idea > to go for noatime also to coutneract that. Both of those would > minimise the risk of damage -- so long as the current process was > done, you could pull it. that just a guess. check man mount. You could also run 'sync;umount /dev/sda1' before unplugging, just to be sure. Regards, Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG/rYBqJyztHCFm9kRAomRAJ9Zs515jNXhkGtDc/tq2dGdGvT/8wCghJ37 CzdLieXn1lEz812P9CiVGxg= =/Gc4 -----END PGP SIGNATURE----- |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
* Jesus Arocho (2007-09-28):
> Try an entry in /etc/udev/10-local.rules; great howtos on the net. > > On Thursday 27 September 2007 07:50, Dan H wrote: [...] There's also great information on quoting, e.g. http://www.vranx.de/mail/tofu.html -André -- May as well be hung for a sheep as a lamb! Linkstation/KuroBox/HG/HS/Tera Kernel 2.6/PPC from <http://hvkls.dyndns.org> .. |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
Andrei Popescu wrote:
> You could also run 'sync;umount /dev/sda1' before unplugging, just to be > sure. Umm, OK. But that sort of obviates the point of usbmount. I guess I'll just continue to umount by hand. Best wishes, Max Hyre -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
On Sat, Sep 29, 2007 at 08:24:51PM -0400, Max Hyre wrote:
> Andrei Popescu wrote: > >You could also run 'sync;umount /dev/sda1' before unplugging, just to be > >sure. > > Umm, OK. But that sort of obviates the point of > usbmount. I guess I'll just continue to umount by hand. I don't use any sort of automounting or unmounting. I don't have NFS-homes (the traditional UNIX automounter setup). This is a UNIX-like OS, although its lookin more and more like a Windows-like OS. I label the filesystems on anything I want users to mount. I then have per-label mount points and lines in fstab; users are responsible for their own mounts and umounts and any damage they do. Then again, I don't have that many devices. Doug. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#12 |
|
Messages: n/a
Hébergeur: |
* Jesus Arocho (2007-09-28):
> Try an entry in /etc/udev/10-local.rules; great howtos on the net. > > On Thursday 27 September 2007 07:50, Dan H wrote: [...] There's also great information on quoting, e.g. http://www.vranx.de/mail/tofu.html -André -- May as well be hung for a sheep as a lamb! Linkstation/KuroBox/HG/HS/Tera Kernel 2.6/PPC from <http://hvkls.dyndns.org> ... .. |
|
|
|
#13 |
|
Messages: n/a
Hébergeur: |
* Jesus Arocho (2007-09-28):
> Try an entry in /etc/udev/10-local.rules; great howtos on the net. > > On Thursday 27 September 2007 07:50, Dan H wrote: [...] There's also great information on quoting, e.g. http://www.vranx.de/mail/tofu.html -André -- May as well be hung for a sheep as a lamb! Linkstation/KuroBox/HG/HS/Tera Kernel 2.6/PPC from <http://hvkls.dyndns.org> .... ... .. |
|
|
|
#14 |
|
Messages: n/a
Hébergeur: |
On Sat, 29 Sep 2007 08:55:23 -0700
Andrew Sackville-West <andrew@farwestbilliards.com> wrote: > On Sat, Sep 29, 2007 at 11:27:35AM -0400, Max Hyre wrote: > > Andrei Popescu wrote: > >> The package usbmount might be what you need. > > > > The description of usbmount says: > > > > This package automatically mounts USB mass > > storage devices (typically USB pens) when they > > are plugged in, and unmounts them when they are > > removed. > > > > Does this limit filesystems to FAT? FAT doesn't care if you rip it out > > without doing any cleanup. If you've formatted your thumbdrive as an ext2 > > filesystem, how can it be properly unmounted if you simply unplug it? > > Won't that mean you have to run fsck every time you plug it in again? > > maybe mount with sync instead of async, though mount warns of > life-shortening possibilities with flash stuff. probably a good idea > to go for noatime also to coutneract that. Both of those would > minimise the risk of damage -- so long as the current process was > done, you could pull it. that just a guess. check man mount. >From the usbmount README: > Vfat Filesystems > ---------------- > > Filesystems of type vfat are not considered by default, despite being > popular for many USB devices, because the Linux kernel does not yet > fully implement sync-mounting for this filesystem type. This means that > you risk losing data or even corrupting the filesystem if you remove the > medium before all data has been written to it. If you include vfat in > the FILESYSTEMS configuration variable, you *MUST* run the 'sync' > command before removing the device. So ext works via sync-mounting, and vfat requires manual syncing. > A Celejar -- mailmin.sourceforge.net - remote access via secure (OpenPGP) email ssuds.sourceforge.net - A Simple Sudoku Solver and Generator -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
![]() |
| Outils de la discussion | |
|
|