add/remove actions for usb devices
Hello everybody,
i've just a simple question and i didn't find any clues about the answer on the internet, so i ask you : why is there no "remove" action for usb devices with hotplug?
my current problem is that i looking for a solution to mount/umount usb-storage devices automagically when they are plugged/unplugged, but since there is no remove event, i must write a complex script to do it (currently working on 2.6.4-ck1 and udev).
so is this lack of "remove" event a technical limit (i now that usb-storage device unplugged event is seen by the scsi agent, since it sends a log message)?
thanks a lot for your answer
Florian
Ps: is it the right place to talk about udev? i have several questions about it and find no other list than this one
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 5 lines · Florian Iragne
Hello everybody,
i've just a simple question and i didn't find any clues about the answer on the internet, so i ask you : why is there no "remove" action for usb devices with hotplug?
The remove event happens just fine. It's just that the current scripts don't do anything with it :)
Quoted 4 lines
my current problem is that i looking for a solution to mount/umount usb-storage devices automagically when they are plugged/unplugged, but since there is no remove event, i must write a complex script to do it (currently working on 2.6.4-ck1 and udev).
But there is an event. You can catch it on your own if you want. Just put your script in /etc/hotplug.d/usb/
Or if you want to catch the fact when udev removes a /dev node (which odds are is what you really want to catch), put your script, or a link to it in /etc/dev.d/block/ with the extension .dev and you will get both add and remove events that corrisponded to a udev create or remove device node.
Hope this helps,
greg k-h
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 23 lines · Greg KH
Quoted 7 lines · Florian Iragne
Hello everybody,
i've just a simple question and i didn't find any clues about the answer on the internet, so i ask you : why is there no "remove" action for usb devices with hotplug?
The remove event happens just fine. It's just that the current scripts don't do anything with it :)
Quoted 6 lines
my current problem is that i looking for a solution to mount/umount usb-storage devices automagically when they are plugged/unplugged, but since there is no remove event, i must write a complex script to do it (currently working on 2.6.4-ck1 and udev).
Quoted 5 lines
But there is an event. You can catch it on your own if you want. Just put your script in
/etc/hotplug.d/usb/
well actually, i've already try this and never catch the remove event. just to test i've made this single script :
if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
echo "add" >> /var/log/hotplug
fi
if [ "$ACTION" = "remove" -a "$TYPE" = "usb" ]; then
echo "remove">>/var/log/hotplug
fi
i do catch the add, but no trace of remove action in the log
Quoted 7 lines
Or if you want to catch the fact when udev removes a /dev node (which odds are is what you really want to catch), put your script, or a link to it in
/etc/dev.d/block/with the extension .dev and you will get both add and remove events that corrisponded to a udev create or remove device node.
yes, i think it's a better way, since currently i have to add a "sleep 10" instruction to wait for udev to create th node i want to move
Quoted 5 lines
Hope this helps,
greg k-h
thanks a lot, i will try this!
Florian
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines
Or if you want to catch the fact when udev removes a /dev node (which odds are is what you really want to catch), put your script, or a link to it in
/etc/dev.d/block/with the extension .dev and you will get both add and remove events that corrisponded to a udev create or remove device node.
just one more stupid question! ;-)
is this /etc/dev.d/block/ directory supposed to already exist? i think so but can't find it. On my debian sid, i have /etc/udev directory, but no block in this
and another one in fact : is the creation of a SYMLINK considered as a node add?
many thanks
Florian
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines · Florian Iragne
Quoted 10 lines
Or if you want to catch the fact when udev removes a /dev node (which odds are is what you really want to catch), put your script, or a link to it in
/etc/dev.d/block/with the extension .dev and you will get both add and remove events that corrisponded to a udev create or remove device node.
Quoted 5 lines
just one more stupid question! ;-)
is this
/etc/dev.d/block/directory supposed to already exist? i think so but can't find it. On my debian sid, i have/etc/udevdirectory, but no block in this
You need the 023 release for this to work.
And no, that directory will not be there, you need to create it yourself.
Quoted 2 lines
and another one in fact : is the creation of a SYMLINK considered as a node add?
No, but the SYMLINK had to be created to point to some real node, right? :)
That should all happen in one action.
thanks,
greg k-h
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 14 lines · Greg KH
Quoted 11 lines · Florian Iragne
Quoted 10 lines
Or if you want to catch the fact when udev removes a /dev node (which odds are is what you really want to catch), put your script, or a link to it in
/etc/dev.d/block/with the extension .dev and you will get both add and remove events that corrisponded to a udev create or remove device node.
Quoted 6 lines
You need the 023 release for this to work.
And no, that directory will not be there, you need to create it yourself.
ok, i'm now working with the 023 release. Is there any documentation about this .dev script? or do you have any little example on your side? i take a look on the net but can't find anything relevant with this feature
Florian
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 23 lines · Greg KH
Quoted 12 lines · Florian Iragne
Quoted 12 lines
Or if you want to catch the fact when udev removes a /dev node (which odds are is what you really want to catch), put your script, or a link to it in
/etc/dev.d/block/with the extension .dev and you will get both add and remove events that corrisponded to a udev create or remove device node.Quoted 7 lines
just one more stupid question! ;-)
is this
/etc/dev.d/block/directory supposed to already exist? i think so but can't find it. On my debian sid, i have/etc/udevdirectory, but no block in this
Quoted 6 lines
You need the 023 release for this to work.
And no, that directory will not be there, you need to create it yourself.
ok, i've played a bit with this, but can't have anything working. I've created /etc/dev/block directory and put a script called xdrive.dev in this directory.
it contains only a echo "something happens" > /var/log/udevEvent
nothing in /var/log/udevEvent
i've tried to call the script sda1.dev or anything with lower/upper cases, nothing worked. So, would it be possible to have a little example?
thanks
Florian
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 9 lines · Florian Iragne
ok, i've played a bit with this, but can't have anything working. I've created
/etc/dev/blockdirectory and put a script called xdrive.dev in this directory.
it contains only a echo "something happens" >/var/log/udevEventnothing in
/var/log/udevEventi've tried to call the script sda1.dev or anything with lower/upper cases, nothing worked. So, would it be possible to have a little example?
Is it executable?
Is the first line '#!/bin/sh'?
Please build udev with 'make DEBUG=true' and have a look at the output in syslog. You should get something like this:
Mar 28 04:15:06 pim udev[8972]: call_foreach_file: unable to open '/etc/dev.d/net' Mar 28 04:15:06 pim udev[8972]: call_foreach_file: open directory '/etc/dev.d/default' Mar 28 04:15:06 pim udev[8972]: call_foreach_file: put file '/etc/dev.d/default/0.dev' in list Mar 28 04:15:06 pim udev[8972]: run_program: running /etc/dev.d/default/0.dev Mar 28 04:15:06 pim logger: /etc/dev.d/default/0.dev /class/net/blind0
thanks,
Kay
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 9 lines · Florian Iragne
ok, i've played a bit with this, but can't have anything working. I've created
/etc/dev/blockdirectory and put a script called xdrive.dev in this directory.
it contains only a echo "something happens" >/var/log/udevEventnothing in
/var/log/udevEventi've tried to call the script sda1.dev or anything with lower/upper cases, nothing worked. So, would it be possible to have a little example?
Same sittuation her for me: I need a hotplug event when I remove a usb device (bluetooth stick), but I don't get one.
If I add the device my Script /etc/hotplug/usb/hci_usb is executed, but not if I remove the stick.
BTW: is udev necessary for this? My device brought up by the bluetooth-utlis and I just need the event to configure the network...
by, Martin
- --
public key available from
http://ferris.dyndns.info/~blackm/blackm_at_ferris.dyndns.info
Powered by Debian GNU / Linux
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAZtxlGxxhbGlQyAkRAgWMAJ4hAB0zErouSaqfa5T3Xx1X/Qvx7gCeN4ZU prB/qCRHcYzfr0VkqYitAy4=2Wta
-----END PGP SIGNATURE-----
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
I try to do that too.
I have a script called usbst.dev in /etc/dev.d/block it contains :
#!/bin/bash
case $ACTION in
add)
ls -l /dev/usbst1 >> /tmp/udeveventlog mount -t vfat -o sync /dev/usbst1 /mnt/usbst echo "mount done" >> /tmp/udeveventlog ls -l /dev/usbst1 >> /tmp/udeveventlog
esac
if I try to add a case "remove)", it fails on syntax error
it seems udev handles add and remove in the same case (ie "add)"), maybe it is what it should do, but it's not easy to manage.
More, when I plug my usb stick, /tmp/udeveventlog contains :
brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1 brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1 mount done mount done brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1 brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1
This behaviour seems strange for me, isn't it ?
Anyway, my usb stick is well mounted, but I get some messages in console which say (2 times) that my stick is already mounted (it seems that the script is run several times), so it's not very clean.
And I have to remove it manually for the moment.
I think an example could be a good thing too
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 28 lines · jjluza
I try to do that too.
I have a script called usbst.dev in/etc/dev.d/blockit contains :#!/bin/bash
case $ACTION in
add)
ls -l/dev/usbst1>>/tmp/udeveventlogmount -t vfat -o sync/dev/usbst1/mnt/usbstecho "mount done" >>/tmp/udeveventlogls -l/dev/usbst1>>/tmp/udeveventlog
esacif I try to add a case "remove)", it fails on syntax error
it seems udev handles add and remove in the same case (ie "add)"), maybe it is what it should do, but it's not easy to manage.More, when I plug my usb stick,
/tmp/udeveventlogcontains :brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1 brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1 mount done mount done brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1 brw------- 1 root root 8, 1 Mar 28 16:20 /dev/usbst1
Quoted 4 lines
This behaviour seems strange for me, isn't it ?
Anyway, my usb stick is well mounted, but I get some messages in console which say (2 times) that my stick is already mounted (it seems that the script is run several times), so it's not very clean.
The script is called for every device node udev has created. You get one event for the main device and one for the partition. I expect, that you need to look at DEVPATH to catch the "partition call" only.
Kay
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Le dimanche 28 Mars 2004 16:58, vous avez écrit :
Quoted 7 lines
The script is called for every device node udev has created. You get one event for the main device and one for the partition. I expect, that you need to look at DEVPATH to catch the "partition call" only.
Kay
Ok, it works with this script (with the same name and in the same place) :
Quoted 13 lines
#!/bin/bash
case $DEVPATH in
/block/sd?/sd?1)case $ACTION in add) mount -t vfat -o sync /dev/usbst1 /mnt/usbst ;; remove) umount /mnt/usbst ;; esac
Quoted 1 line
esac
Thanks for your tip.
Now, I have still a problem, I just notice (as it is said in the manpage of mount) that I can't use "-o sync" with "-t vfat". I get no error, but the behaviour is like it is not mounted with sync option (I even got a awfull kernel oops).
Is there a workaround since usb stick need to use vfat and only vfat fs ? I would like to stop using supermount with my usb stick, if it's possible. Sorry if it's not udev related, maybe you know someone I can ask about that ?
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 21 lines · Kay Sievers
Quoted 11 lines · Florian Iragne
ok, i've played a bit with this, but can't have anything working. I've created
/etc/dev/blockdirectory and put a script called xdrive.dev in this directory.
it contains only a echo "something happens" >/var/log/udevEventnothing in
/var/log/udevEventi've tried to call the script sda1.dev or anything with lower/upper cases, nothing worked. So, would it be possible to have a little example?
Is it executable?
Is the first line '#!/bin/sh'?Please build udev with 'make DEBUG=true' and have a look at the output in syslog. You should get something like this:
Quoted 10 lines
Mar 28 04:15:06 pim udev[8972]: call_foreach_file: unable to open '/etc/dev.d/net' Mar 28 04:15:06 pim udev[8972]: call_foreach_file: open directory '/etc/dev.d/default' Mar 28 04:15:06 pim udev[8972]: call_foreach_file: put file '/etc/dev.d/default/0.dev' in list Mar 28 04:15:06 pim udev[8972]: run_program: running /etc/dev.d/default/0.dev Mar 28 04:15:06 pim logger: /etc/dev.d/default/0.dev /class/net/blind0thanks,
Kay
maybe i'm wrong, but I understand when Greg told me about this .dev scripts that their name define their framework (e.g. : sda1.dev works only for event on /dev/sda1) and i don't observe this behaviour (actually, all scripts in /et/dev.d/block are called on udev event).
so what is the normal behaviour and is there a way (other than scripting to parse device names or other hack)/ a naming scheme to attribute an event to only one device (e.g. : sda1.dev do its job only for create/destroy of /dev/sda1)?
if it's not the case, is it planned?
thanks a lot
Florian
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 45 lines · Florian Iragne
Quoted 31 lines · Kay Sievers
Quoted 11 lines · Florian Iragne
ok, i've played a bit with this, but can't have anything working. I've created
/etc/dev/blockdirectory and put a script called xdrive.dev in this directory.
it contains only a echo "something happens" >/var/log/udevEventnothing in
/var/log/udevEventi've tried to call the script sda1.dev or anything with lower/upper cases, nothing worked. So, would it be possible to have a little example?
Is it executable?
Is the first line '#!/bin/sh'?Please build udev with 'make DEBUG=true' and have a look at the output in syslog. You should get something like this:
Mar 28 04:15:06 pim udev[8972]: call_foreach_file: unable to open '/etc/dev.d/net' Mar 28 04:15:06 pim udev[8972]: call_foreach_file: open directory '/etc/dev.d/default' Mar 28 04:15:06 pim udev[8972]: call_foreach_file: put file '/etc/dev.d/default/0.dev' in list Mar 28 04:15:06 pim udev[8972]: run_program: running /etc/dev.d/default/0.dev Mar 28 04:15:06 pim logger: /etc/dev.d/default/0.dev /class/net/blind0Quoted 4 lines
thanks,
Kaymaybe i'm wrong, but I understand when Greg told me about this .dev scripts that their name define their framework (e.g. : sda1.dev works only for event on
/dev/sda1) and i don't observe this behaviour (actually, all scripts in /et/dev.d/block are called on udev event).
Quoted 4 lines
so what is the normal behaviour and is there a way (other than scripting to parse device names or other hack)/ a naming scheme to attribute an event to only one device (e.g. : sda1.dev do its job only for create/destroy of
/dev/sda1)?
/etc/dev.d/sda1/name.dev should work.
This is what actual happens for /dev/hda:
Mar 28 19:44:37 pim udev[9323]: dev_d_send: DEVNAME='/udev/hda' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: open directory '/etc/dev.d/hda' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: unable to open '/etc/dev.d/hda' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: open directory '/etc/dev.d/block' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: unable to open '/etc/dev.d/block' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: open directory '/etc/dev.d/default' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: put file '/etc/dev.d/default/1.dev' in list
Kay
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 13 lines · Kay Sievers
/etc/dev.d/sda1/name.devshould work.This is what actual happens for
/dev/hda:Mar 28 19:44:37 pim udev[9323]: dev_d_send: DEVNAME='/udev/hda' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: open directory '/etc/dev.d/hda' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: unable to open '/etc/dev.d/hda' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: open directory '/etc/dev.d/block' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: unable to open '/etc/dev.d/block' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: open directory '/etc/dev.d/default' Mar 28 19:44:37 pim udev[9323]: call_foreach_file: put file '/etc/dev.d/default/1.dev' in list
Quoted 3 lines
Kay
ok, back again!!
with your help, i've almost reached my goals. now, i catch add/remove events specifically for the devices i want. BUT (yes there is a problem, it would have been too easy), i have a problem on device removal.
here is the udev.rules line : BUS="usb", SYSFS{serial}="0A3703002602", KERNEL="sd?1", PROGRAM="/etc/udev/scsi-devfs.sh %k %b %n", NAME="xdrive"
now, i've created a xdrive directory in /etc/dev.d and in this xdrive directory, i've put a script like this one :
echo $ACTION >> /var/log/hotplug
case "$ACTION" in
add)
mount /dev/xdrive /home/florian/xdrive -osync,umask 0 ;;
remove)
umount /home/florian/xdrive
;;esac
exit 0
on device add, it is correctly mounted. on device removal, the system freeze and i have to use magic keys to reboot the machine. I've enabled kernel verbose debug messgaes and other stuffs like this, but can't get any error message.
does anyboddy have an idea to solve this problem? (unfortunately, i can't install udev from sources currently, so i can't activate its debug mode, or maybe it's possible through a configuration file?)
thanks for helping
Florian
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 27 lines · jjluza
Le dimanche 28 Mars 2004 18:56, vous avez écrit :
Quoted 13 lines
Quoted 10 lines · jjluza
Now, I have still a problem, I just notice (as it is said in the manpage of mount) that I can't use "-o sync" with "-t vfat". I get no error, but the behaviour is like it is not mounted with sync option (I even got a awfull kernel oops).
Is there a workaround since usb stick need to use vfat and only vfat fs ? I would like to stop using supermount with my usb stick, if it's possible. Sorry if it's not udev related, maybe you know someone I can ask about that ?Quoted 9 lines
correct me if i'm wrong, but supermount do mount devices in sync mode, so it has the same behaviour as mounting devices with sync option and umount them after removal.
my 2 cents
Florian
Quoted 6 lines
That's what I thought but it seems that it's not what it does. Look at the manpage of mount, you'll see that sync works only with ext2, ext3 et ufs.
I think supermount does more thing than only mounts devices in sync mode.
well, where do you see any mention of the limitation of the sync mode to ext*/ufs? i've read the manpage of mount several times, but did not find anything like the info you mentioned.
Florian
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 8 lines · Florian Iragne
on device add, it is correctly mounted. on device removal, the system freeze and i have to use magic keys to reboot the machine. I've enabled kernel verbose debug messgaes and other stuffs like this, but can't get any error message.
does anyboddy have an idea to solve this problem? (unfortunately, i can't install udev from sources currently, so i can't activate its debug mode, or maybe it's possible through a configuration file?)
The umount is likely hanging. This is probably a file system feature.
Try without your udev rule - unplug the device and then umount it.
-- Patrick Mansfield
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 11 lines · Florian Iragne
echo $ACTION >>
/var/log/hotplug
case "$ACTION" in
add)
mount/dev/xdrive/home/florian/xdrive-osync,umask 0 ;;
remove)umount /home/florian/xdrive ;;esac
exit 0
Hi Florian,
I got it working without udev. I had a look at /etc/hotplug/usb.agent and there REMOVER was mentioned. Here is my script:
#! /bin/sh
#
# /etc/hotplug/usb/hci_usb
#
if [ "$ACTION" = "add" ]; then
cp /etc/hotplug/usb/hci_usb $REMOVER
# configure network here
fiif [ "$ACTION" = "remove" ]; then
touch /tmp/usb_has_been_removed # some debugging
# reconfigure network here fi
by, Martin
- --
public key available from
http://ferris.dyndns.info/~blackm/blackm_at_ferris.dyndns.info
Powered by Debian GNU / Linux
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAaHToGxxhbGlQyAkRApl7AKDWt+Ifow1XFEfhs5u1JS8vYYrGmACfbm7M lyWI+IRrCxr9LNVBIPoRovY=HeZc
-----END PGP SIGNATURE-----
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 4 lines
Florian Iragne wrote :
on device add, it is correctly mounted. on device removal, the system freeze and i have to use magic keys to reboot the machine.
yes, that's the error I get.
I'm pretty sure that's because vfat doesn't support sync mode.
If I don't make udev handle device removal, I can unmount it manually, but it freeze too.
Quoted 3 lines
well, where do you see any mention of the limitation of the sync mode to ext*/ufs? i've read the manpage of mount several times, but did not find anything like the info you mentioned.
I have read it on the manual page from debian sid. I have read such a thing on several web sites too, after searching on google, but some other sites tell we can ... so I'm a bit disappointed.
you can read that from this manpage too :
http://www.netadmintools.com/html/8mount.man.html
Quoted 1 line
the sync option today has effect only for ext2, ext3 and ufs)
It would be so good if vfat be aware of sync and if my kernel doesn't oops on device removal.
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 13 lines · Patrick Mansfield
Quoted 8 lines · Florian Iragne
on device add, it is correctly mounted. on device removal, the system freeze and i have to use magic keys to reboot the machine. I've enabled kernel verbose debug messgaes and other stuffs like this, but can't get any error message.
does anyboddy have an idea to solve this problem? (unfortunately, i can't install udev from sources currently, so i can't activate its debug mode, or maybe it's possible through a configuration file?)
Quoted 5 lines
The umount is likely hanging. This is probably a file system feature.
Try without your udev rule - unplug the device and then umount it.
-- Patrick Mansfield
ok, it's a file system failure, but why?
unplugging the device and then umount it "by hand", or umount the device
automatically when it's unplugged, what is the difference? if i make
umount /dev/myDevice, i believe mount will told me there is a problem, but i make "umount /path/to/the/montpoint", which is perfectly right and works "by hand" but not automatically with the udev remove event.
I just can't says to users : well, ok, when you unplug your usb stick, type umount /home/yourUser/usbStick. I have a working script that does just what i want, but it's heavy and not so clean regarding the logical behaviour of the system. udev and hotplug have the possibilities i'm looking for, so i want to use them.
thanks for helping!
Florian
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 7 lines · jjluza
Quoted 4 lines
Florian Iragne wrote :
on device add, it is correctly mounted. on device removal, the system freeze and i have to use magic keys to reboot the machine.yes, that's the error I get.
I'm pretty sure that's because vfat doesn't support sync mode.
No, i don't think so. I have a script that mount/umount devices automatically (wthout using udev event), and it works (with sync mode for vfat).
Quoted 2 lines
If I don't make udev handle device removal, I can unmount it manually, but it freeze too.
manually, sometimes it hangs, but not always, and without any error message
Quoted 4 lines
Quoted 3 lines
well, where do you see any mention of the limitation of the sync mode to ext*/ufs? i've read the manpage of mount several times, but did not find anything like the info you mentioned.
Quoted 9 lines
I have read it on the manual page from debian sid. I have read such a thing on several web sites too, after searching on google, but some other sites tell we can ... so I'm a bit disappointed.
you can read that from this manpage too :
http://www.netadmintools.com/html/8mount.man.htmlQuoted 1 line
the sync option today has effect only for ext2, ext3 and ufs)
i will read those, but the manpage on my debian sid doesn't seem to be the same than yours. ;-)
Quoted 4 lines
It would be so good if vfat be aware of sync and if my kernel doesn't oops on device removal.
yes, it would be good
Florian
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 2 lines
Florian Iragne wrote :
manually, sometimes it hangs, but not always, and without any error message
Are you sure you wrote on your usb-stick when you did the test ? On my system, it hangs everytime I write on my usb-stick.
Same question about your script which doesn't use udev events. And please, upgrade your system, I see no reason that can explain we have not the same version of the mount manpage. I have the same than the one on the web page I give you before.
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 6 lines · jjluza
Quoted 2 lines
Florian Iragne wrote :
manually, sometimes it hangs, but not always, and without any error messageAre you sure you wrote on your usb-stick when you did the test ? On my system, it hangs everytime I write on my usb-stick.
i'm sure
Quoted 1 line
Same question about your script which doesn't use udev events.
one more time, i'm sure
Quoted 3 lines
And please, upgrade your system, I see no reason that can explain we have not the same version of the mount manpage. I have the same than the one on the web page I give you before.
Oh, well... i see a resaon why... i must be blind since this info about sync is in the manpage, but i didn't see it we i have read it. oups...
so, sync mode doesn't work. i have to find one thing to synchronise writings and i absolutely don't want to use supermount!
Florian
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Florian Iragne wrote
Quoted 5 lines
so, sync mode doesn't work. i have to find one thing to synchronise writings and i absolutely don't want to use supermount!
Florian
Yes, I would like have it too. I really don't find any information about that for the moment, so if someone knows something about this problem with vfat, I will be very thankful.
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel