Re: [RFC] Let non-root users eject their ipods?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 19, 2005 at 07:49:18PM -0800, john stultz wrote:
> On Mon, 2005-12-19 at 22:51 -0500, Wakko Warner wrote:
> > john stultz wrote:
> > > All,
> > > 	I'm getting a little tired of my roommates not knowing how to safely
> > > eject their usb-flash disks from my system and I'd personally like it if
> > 
> > What exactly is ejecting flash media?
> > 
> > I have USB hard disks, USB Flash sticks, USB DVD-RAM, and an Ipod.  The only
> > one that even needs eject is the DVDRam.  IIRC, ALLOW_MEDIUM_MREMOVAL is for
> > CD-Rom (and possibly tape).  If the device is not in use, there's no reason
> > it cannot be unplugged then.  (Not in use as in not mounted, and noone's
> > accessing the raw device).
> 
> Again, I'm not much of a SCSI person, so you might be right here.
> However, ejecting scsi devices, like firewire or usb disks, tends to
> spin the devices down. This, to my understanding, allows for safe
> removal (ipods stop flashing the "do not remove" message). 

It turns out that a lot of USB devices look for ALLOW_MEDIUM_REMOVAL for
various purposes, including flushing internal buffer-cache.  Several CF
readers do this, some "fixed" flash drives do this, etc.

Also, things like the iPod and others (and this group overlaps with the
aforementioned types of devices) give the user a visible indication that
_this_particular_ unit is ready to be removed.

> On USB flash disks, I'd hope umounting the device would suffice in
> flushing out any writes, but it seems quite a bit of writing can go on
> when the eject command is issued. It might be I'm just being paranoid,
> but I've always ejected flash drives as well just to be sure.

The eject shouldn't flush anything from the kernel-level, but it won't
complete until the device's internal buffers are flushed.

Matt

-- 
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

E:  You run this ship with Windows?!  YOU IDIOT!
L:  Give me a break, it came bundled with the computer!
					-- ESR and Lan Solaris
User Friendly, 12/8/1998

Attachment: pgpkxx9bptGRh.pgp
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux