Re: Reattach/redetect allways connected umass device - is it possible ?

From: Bernd Walter (ticso_at_cicely12.cicely.de)
Date: 03/28/05

  • Next message: Bernd Walter: "Re: Reattach/redetect allways connected umass device - is it possible ?"
    Date: Mon, 28 Mar 2005 16:38:02 +0200
    To: Poul-Henning Kamp <phk@phk.freebsd.dk>
    
    

    On Mon, Mar 28, 2005 at 04:24:30PM +0200, Poul-Henning Kamp wrote:
    > In message <20050328134856.GF14532@cicely12.cicely.de>, Bernd Walter writes:
    >
    > >> Driver support for this is not really meaterialized and therefore
    > >> the model now is that when the media is ejected the geom device
    > >> is removed and a new one created right away, even if a new media
    > >> is not inserted right away.
    > >
    > >Do you get eject notifications from any device type?
    >
    > Right now I belive floppy disks DTRT.

    Interesting.

    > >One of my problems is that it is possible with SCSI MO drives to
    > >eject the media, reinsert a new one and errously continue to work
    > >with the old GEOM layout.
    > >I already trashed the data on one media by forgetting to trigger
    > >a reprobe - since then I use a mount script.
    >
    > Well, I have no idea how to pull the information out of the CAM/SCSI
    > code, but I'm sure there is _some_ way it can be done.

    There is the test unit ready command.
    Either it returns OK, or you may get usefull sense data.
    Here is an example:

    No media in the drive:
    [60]cicely13# camcontrol tur -n da -u 0 -v
    Unit is not ready
    (pass0:ahc0:0:1:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
    (pass0:ahc0:0:1:0): CAM Status: SCSI Status Error
    (pass0:ahc0:0:1:0): SCSI Status: Check Condition
    (pass0:ahc0:0:1:0): NOT READY asc:3a,0
    (pass0:ahc0:0:1:0): Medium not present
    Exit 1

    Media just inserted and give the drive some time to spin up:
    [61]cicely13# camcontrol tur -n da -u 0 -v
    Unit is not ready
    (pass0:ahc0:0:1:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
    (pass0:ahc0:0:1:0): CAM Status: SCSI Status Error
    (pass0:ahc0:0:1:0): SCSI Status: Check Condition
    (pass0:ahc0:0:1:0): UNIT ATTENTION asc:28,0
    (pass0:ahc0:0:1:0): Not ready to ready change, medium may have changed
    Exit 1

    Just retry TUR command:
    [62]cicely13# camcontrol tur -n da -u 0 -v
    Unit is ready

    Media ejected:
    [63]cicely13# camcontrol tur -n da -u 0 -v
    Unit is not ready
    (pass0:ahc0:0:1:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
    (pass0:ahc0:0:1:0): CAM Status: SCSI Status Error
    (pass0:ahc0:0:1:0): SCSI Status: Check Condition
    (pass0:ahc0:0:1:0): NOT READY asc:3a,0
    (pass0:ahc0:0:1:0): Medium not present
    Exit 1

    Media reinserted without waiting the drive to spin up:
    [64]cicely13# camcontrol tur -n da -u 0 -v
    Unit is not ready
    (pass0:ahc0:0:1:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
    (pass0:ahc0:0:1:0): CAM Status: SCSI Status Error
    (pass0:ahc0:0:1:0): SCSI Status: Check Condition
    (pass0:ahc0:0:1:0): NOT READY asc:98,0
    (pass0:ahc0:0:1:0): Vendor Specific ASC
    Exit 1

    After the drive spun up:
    [65]cicely13# camcontrol tur -n da -u 0 -v
    Unit is not ready
    (pass0:ahc0:0:1:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
    (pass0:ahc0:0:1:0): CAM Status: SCSI Status Error
    (pass0:ahc0:0:1:0): SCSI Status: Check Condition
    (pass0:ahc0:0:1:0): UNIT ATTENTION asc:28,0
    (pass0:ahc0:0:1:0): Not ready to ready change, medium may have changed
    Exit 1

    Retry TUR:
    [66]cicely13# camcontrol tur -n da -u 0 -v
    Unit is ready

    -- 
    B.Walter                   BWCT                http://www.bwct.de
    bernd@bwct.de                                  info@bwct.de
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Bernd Walter: "Re: Reattach/redetect allways connected umass device - is it possible ?"

    Relevant Pages

    • Growisofs IO errors
      ... I am trying to burn Verbatim Datalife 4x DVD+RW media using a Panasonic SW-9573 drive on Suse 9.1 Linux 2.6.5. ... However, when I do the same commands from a script, I get very frequent problems. ...
      (comp.os.linux.misc)
    • RE: turning off media center via remote
      ... If you navigate back to the Media Center startup screen, you can exit by ... > I can start MCE by pressing the green button on the remote. ...
      (microsoft.public.windows.mediacenter)
    • Re: turning off media center via remote
      ... Dana Cline - MVP ... got the MCE box hooked up to the big TV in the basement. ... >> How do you exit the MCE software from the remote? ... I want to turn off the Media Center program. ...
      (microsoft.public.windows.mediacenter)
    • .net winform support
      ... developing an mce html application which contains .net component. ... from media center environment: ... exit media center - ehshell process is still running ...
      (microsoft.public.windows.mediacenter)
    • Re: "How Does Light "Know" How Fast to Travel?"
      ... | or the atmospher is known as a medium not a media. ... | Maxwell's equation applies to the permeability and permitivity of ANY ... | space (permittivity and permeability = porosity/opacity of a medium). ...
      (sci.physics.relativity)