• How to "Reset" an USB stick after it has been low-level changed ?

    From R.Wieser@21:1/5 to All on Fri Mar 19 09:25:58 2021
    Hello all,

    I just read the "testing USB-ZIP images" post, and would like to ask a
    question that has some relation to it.

    Some time ago on Win XP I wrote some code to make an USB stick bootable
    (either as FDD or HDD), which worked (using the DeviceIOControl function and stuff like IOCTL_DISK_CREATE_DISK).

    The idea was that I could (re)create USB sticks to look like any old OS
    (from DOS upto W98).

    The thing is I always needed to eject the stick and re-inserted it before
    being able to place files onto it (starting with MSDOS.SYS and the like), as I've never found how to tell the OS to re-initialize what it knew about the stick ...

    tl;dr:
    Does anyone perhaps know how programmatically to tell the OS to
    re-initialize an USB stick (so it becomes aware of newly created, removed or resized volumes etc.) ?

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kerr-Mudd,John@21:1/5 to All on Wed Mar 24 14:02:58 2021
    On Fri, 19 Mar 2021 08:25:58 GMT, "R.Wieser" <address@not.available>
    wrote:

    []

    tl;dr:
    Does anyone perhaps know how programmatically to tell the OS to
    re-initialize an USB stick (so it becomes aware of newly created,
    removed or resized volumes etc.) ?


    For Windows (cmdline) there's
    RemoveDrive
    Homepage: http://www.uwe-sieber.de/drivetools_e.html
    he also has a restart

    Another option:
    C++ code source for USB device ejecting can be had from http://www.withopf.com/tools/deveject/

    but I don't think there's restart code in there.

    --
    Bah, and indeed, Humbug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Mar 24 17:47:33 2021
    John,

    For Windows (cmdline) there's
    RemoveDrive
    Homepage: http://www.uwe-sieber.de/drivetools_e.html
    he also has a restart

    Another option:
    C++ code source for USB device ejecting can be had from http://www.withopf.com/tools/deveject/

    Thanks. I've downloaded the C++ code and will take a peek to see how they
    are dooing it.

    but I don't think there's restart code in there.

    Maybe I've not used the right term for it.. How else can I partition a
    drive (USB or not), format it and use it directly afterwards without needing
    to restart the OS ? As some point the OS needs to be made ware of the
    changes ...

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kerr-Mudd,John@21:1/5 to All on Fri Mar 26 12:33:26 2021
    On Wed, 24 Mar 2021 16:47:33 GMT, "R.Wieser" <address@not.available>
    wrote:

    John,

    For Windows (cmdline) there's
    RemoveDrive
    Homepage: http://www.uwe-sieber.de/drivetools_e.html
    he also has a restart

    Another option:
    C++ code source for USB device ejecting can be had from
    http://www.withopf.com/tools/deveject/

    Thanks. I've downloaded the C++ code and will take a peek to see how
    they are dooing it.

    but I don't think there's restart code in there.

    Maybe I've not used the right term for it.. How else can I partition
    a drive (USB or not), format it and use it directly afterwards without needing to restart the OS ? As some point the OS needs to be made
    ware of the changes ...

    Regards,
    Rudy Wieser


    Sorry I don't know.
    I recall DOS's Fdisk required a reboot; I don't know about modern OS's (especially EUFI).

    I recall that usb device driver installs required a manual "unplug &
    replug" in 2004.






    --
    Bah, and indeed, Humbug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)