You are not logged in.
I'm trying to get a wireless usb stick working well, and the last stumbling block I have is getting it to shut down (in a way) on a restart. If it doesn't it won't reinitialize properly, and I'll have remove it, then reload ndiswrapper, and plug it back in again. Windows automatically does this somehow, but I'm not sure what the linux analog would be.
Offline
Gnome does it for you but I'm thinking that you're not using Gnome.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I can use gnome np, or if I can modify the udev rules that's fine too, just point in the right direction.
Offline
umount
Offline
note that omgwtfbyobbq is asking about usb wireless adapter, but not usb flash drive...
and yea, udev is the way to go
Offline
What would a udev rule do in my case? I can't seem to figure out how to turn it off (the kernel power stuff doesn't support suspending the device), so can udev perform the equivalent of safely removing it in windows somehow?
Offline
Try something like :
sdparm --command=stop /dev/sdX
Last edited by Mohandas (2010-08-20 13:06:58)
Offline
try eject /dev/sdx works also for flashdrives not just cd's plus the hardware-cache is flushed befor the device is unmounted and ejected
Offline
Perhaps take a look at 'pmount' - it's meant for user-based permissions mounting.
However, I think this doesn't work for sata/esata drives... if that's the case, then what's a safe way to remove these drives without root and/or gui?
Last edited by o1911 (2010-08-21 02:21:21)
Arch x86_64
Offline
I think I speak for the OP. I have wondered about this for some time. On every Linux I have encountered, unmounting a USB thumbdrive does dismount the device, but leaves the annunciator on the device illuminated.
Certain other operating systems from the US Pacific Northwest manage to turn off the annunciator providing positive feedback that it is safe to unplug the device without the risk of corrupting it.
I had never seen Mohandas' suggestion so I tried it:
ewaller@odin:~/devel/wxwidgetsprojects/spacewar 1181 %sudo sdparm --command=stop /dev/sdb
/dev/sdb: SanDisk Cruzer Mini 0.1
The light blinked, but stayed on. I verified it is truly unmounted.
How does one truly know when the drive has finished all of its house keeping? (Hint that can be thousands of milliseconds after the sync and dismount)?
edit: fixed typo
Last edited by ewaller (2010-08-21 04:50:07)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
You could try lsusb.
Arch x86_64
Offline
I'm trying to get a wireless usb stick working
note that omgwtfbyobbq is asking about usb wireless adapter, but not usb flash drive...
Wireless. Network device. Not a storage device.
You might see if you can turn it off via a utility like rfkill.
Offline
umount is safe to use most of the time. It will perform necessary housekeeping and unmount the drive, however, it does not cut off the power to the drive (which is why most USB sticks will still have an illuminated led). You can use dmesg to ensure the USB is actually dismounted and it will show a message like: usb 2-6: USB disconnect, address 2
Safely remove drive, as I understand it, is just umount with a power kill command. So after the drive is unmounted it kills the USB power and the drive cannot be mounted unless it is unplugged and plugged back in.
The reason most computer OS's have 'safely remove drive' is because many USB controllers (the chip on the USB drive) have a persistent remount feature. If you don't kill the power to the darn thing it will start broadcasting the initialization handshaking sequence again...which will probably be ignored by the OS since, ironically, the computer thinks the hardware space the USB drive is broadcasting from has already been allocated. At this point most users yank the USB drive out of the socket leaving the device in a non-clean state (remember the drive started to handshake with the computer and was waiting for a reply).
however, my knowledge on this stuff is from several years ago, so things may not function the same way today
Last edited by cubeist (2010-08-21 18:51:31)
Offline
as I use dolphin to mount I use it to unmount, too
Offline
try terminal
Bitbucket - DeviantART - Userstyles
*Currently Not Using Arch
Offline
The problem is that it only shows up as a usb storage device in windows. In arch, there's no /dev/sd* besides my hd partitions at /dev/sda*, so I can't unmount it in that context. rfkill list doesn't pick it up unfortunately, but thanks for the ideas everyone!
Offline