Re: Low Level read/Write code for USB storage device

Jean-Luc Arnaud <jean-luc-E/[email protected]> Fri, 14 Dec 2018 18:54:33 +0100
Newsgroups gmane.comp.lang.realbasic.user
Organization Centre Direct du Multimédia
Message-ID <[email protected]>
--------------800882A20AB4E656631EE70A
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Many thanks for replying, Jim.

Your information is very interesting and relevant. However, I "need" to 
clone USB stick as it's the only way I can think to, to duplicate 
multi-partition sticks.

Unless you have another idea? If so, I'm highly interested!

Have a nice WE

Jean-Luc Arnaud

Le 14/12/2018 à 17:04, Jim Wagner a écrit :
> Hello, Jean-Luc
>
> I do not think that you should try to “clone” a USB stick at “low 
> level”, that is, at the sector or block level. That is because of a 
> process used on solid-state memories (such as USB stick); this is 
> called “wear leveling”. For example, if you change a document on such 
> memory, it will actually move it to a new place so that the different 
> parts of the memory all have a chance to be written and no  part gets 
> written too many times.
>
> Certainly, you can reconstruct partitions and such, but you need to do 
> it at a file-system level. Perhaps, this is what you are calling “low 
> level”?
>
> Jim
>
> James Wagner
> Oregon Research Electronics
> http://www.orelectronics.net
>
>
>
>
>> On Dec 14, 2018, at 1:56 AM, Jean-Luc Arnaud 
>> <jean-luc-E/[email protected] <mailto:jean-luc-E/[email protected]>> wrote:
>>
>> Hi all,
>>
>> I plan to code for a kind of "USB Stick cloner" running on Windows, 
>> that is to make an
>> image of the entire content of a USB Storage device, in order to copy it
>> to another USB stick.
>>
>> I'd like to read low level information about partition table,
>> catalog, etc.. and of course, to copy this information to another stick.
>>
>> I didn't find nothing useful in the Xojo forum nor in MBS samples.
>>
>> After a lot of searches on Internet (information like APIs, Command 
>> Line tools, shared code, ...), I'm now interested in an open-source 
>> utility, Clonezilla, which does all I need.
>>
>> Does someone know and/or use this utility?
>> My goal is to adapt its source for my own needs, including it in a 
>> Xojo app.
>>
>> Thanks for any help.
>>
>> -- 
>> Jean-Luc Arnaud
>>
>

--------------800882A20AB4E656631EE70A
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Many thanks for replying, Jim.</p>
    <p>Your information is very interesting and relevant. However, I
      "need" to clone USB stick as it's the only way I can think to, to
      duplicate multi-partition sticks.</p>
    <p>Unless you have another idea? If so, I'm highly interested!</p>
    <p>Have a nice WE<br>
    </p>
    <pre class="moz-signature" cols="72">Jean-Luc Arnaud

</pre>
    <div class="moz-cite-prefix">Le 14/12/2018 à 17:04, Jim Wagner a
      écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:932C2719-7B90-4DED-B38C-3447CAC45578-Wuw85uim5zDR7s880joybQ@public.gmane.org">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      Hello, Jean-Luc
      <div class=""><br class="">
      </div>
      <div class="">I do not think that you should try to “clone” a USB
        stick at “low level”, that is, at the sector or block level.
        That is because of a process used on solid-state memories (such
        as USB stick); this is called “wear leveling”. For example, if
        you change a document on such memory, it will actually move it
        to a new place so that the different parts of the memory all
        have a chance to be written and no  part gets written too many
        times.</div>
      <div class=""><br class="">
      </div>
      <div class="">Certainly, you can reconstruct partitions and such,
        but you need to do it at a file-system level. Perhaps, this is
        what you are calling “low level”?</div>
      <div class=""><br class="">
      </div>
      <div class="">Jim</div>
      <div class=""><br class="">
        <div class="">
          <span class="Apple-style-span" style="border-collapse:
            separate; color: rgb(0, 0, 0); font-family: Helvetica;
            font-style: normal; font-variant-ligatures: normal;
            font-variant-position: normal; font-variant-caps: normal;
            font-variant-numeric: normal; font-variant-alternates:
            normal; font-variant-east-asian: normal; font-weight:
            normal; letter-spacing: normal; line-height: normal;
            orphans: 2; text-align: -webkit-auto; text-indent: 0px;
            text-transform: none; white-space: normal; widows: 2;
            word-spacing: 0px; border-spacing: 0px;
            -webkit-text-decorations-in-effect: none;
            -webkit-text-stroke-width: 0px;">
            <div style="word-wrap: break-word; -webkit-nbsp-mode: space;
              -webkit-line-break: after-white-space;" class="">
              <div class="">James Wagner</div>
              <div class="">Oregon Research Electronics</div>
              <div class=""><a href="http://www.orelectronics.net"
                  class="" moz-do-not-send="true">http://www.orelectronics.net</a></div>
              <div class=""><br class="">
              </div>
            </div>
          </span><br class="Apple-interchange-newline">
          <br class="Apple-interchange-newline">
        </div>
        <br class="">
        <div>
          <blockquote type="cite" class="">
            <div class="">On Dec 14, 2018, at 1:56 AM, Jean-Luc Arnaud
              &lt;<a href="mailto:jean-luc-E/[email protected]" class=""
                moz-do-not-send="true">jean-luc-E/[email protected]</a>&gt;
              wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <div class="">Hi all,<br class="">
                <br class="">
                I plan to code for a kind of "USB Stick cloner" running
                on Windows, that is to make an<br class="">
                image of the entire content of a USB Storage device, in
                order to copy it<br class="">
                to another USB stick.<br class="">
                <br class="">
                I'd like to read low level information about partition
                table,<br class="">
                catalog, etc.. and of course, to copy this information
                to another stick.<br class="">
                <br class="">
                I didn't find nothing useful in the Xojo forum nor in
                MBS samples.<br class="">
                <br class="">
                After a lot of searches on Internet (information like
                APIs, Command Line tools, shared code, ...), I'm now
                interested in an open-source utility, Clonezilla, which
                does all I need.<br class="">
                <br class="">
                Does someone know and/or use this utility?<br class="">
                My goal is to adapt its source for my own needs,
                including it in a Xojo app.<br class="">
                <br class="">
                Thanks for any help.<br class="">
                <br class="">
                -- <br class="">
                Jean-Luc Arnaud<br class="">
                <br class="">
              </div>
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
    </blockquote>
  </body>
</html>

--------------800882A20AB4E656631EE70A--