<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Julie:<div><br></div><div> The major bug that I found when trying to create a regular dd file by loopback mounting it for Voyage installation is documented and worked around in the code snippet below (appears in my project's voyage-<custom>.sh). Prior to this code block I had loopback mounted a 2Gb regular file intended for burning to CF on /dev/loop0 and partition 1 within that file on /dev/loop1.</div><div><br></div><div>...</div><div>#</div><div># Work around grub bug #1771:</div><div>#</div><div># http://savannah.gnu.org/bugs/?func=detailitem&item_id=11771</div><div>#</div><div># This simply allows the grub install to a loopback mounted file to succeed.</div><div>#</div><div>rm -f /dev/loop01</div><div>ln -s /dev/loop1 /dev/loop01<br><div>...</div><div><br></div><div> You can read the original bug report for
yourself. In a nutshell, legacy grub's device directive just takes what you supply and postpends a partition number to it. So in my special case:</div><div><br></div><div>res = `/usr/sbin/grub --batch --device-map=/dev/null 2>&1 <<EOM</div><div>device (hd0) /dev/loop0 # usually something like /dev/hda or /dev/sda</div><div>root (hd0,0)</div><div>setup (hd0)</div><div>quit</div><div>EOM`</div><div><br></div><div>grub was hunting around for a /dev/loop01 for the partition (usually this would be something like /dev/hda1 or /dev/sda1, right?) and never finding it - and the setup always failed. Took me days to find the bug and five minutes to grok and work around it with this symlink.</div><div><br></div><div> There was indeed another more minor bug that I'd have to dig through the scripts to find - but it was nowhere near as intrusive as this one
was.</div><div><br></div><div> For now I'm fine with staying with `legacy' grub v0.97 because upgrading to grub2 changes the whole show, including the partition semantics !? ... thank you GNU guys. But I suspect it will be a smarter grub overall and will be worth the investment.</div><div><br></div><div>--Frank<br><br>--- On <b>Wed, 3/7/12, jfh@greenhousepc.com <i><jfh@greenhousepc.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: jfh@greenhousepc.com <jfh@greenhousepc.com><br>Subject: RE: [Voyage-linux] Cloning a system<br>To: "Frank Hoeflich" <frankhoeflich@yahoo.com>, "voyage-linux@list.voyage.hk" <voyage-linux@voyage.hk>, "Stanislav Sinyagin" <ssinyagin@yahoo.com><br>Date: Wednesday, March 7, 2012, 11:18 AM<br><br><div id="yiv429900235"><div><span
style="font-family:Verdana;color:#000000;font-size:10pt;"><div>Frank,<br></div><div><br></div><div>What are these "grub legacy bugs" of which you speak? That's of particular interest since trying to update GRUB on my older Voyage systems results in being told GRUB is up to date ..<br></div><div><br></div><div>I am extremely disappointed in how GRUB works. Considering its importance, it should work far more reliably than it seems to work, particularly in the embedded space. The only reason I've not switched to LILO is because I can't seem to find ways to shut it up completely.<br></div><div>--<br>Julie Haugh<br>Senior Design Engineer<br>greenHouse Computers, LLC // jfh at <a rel="nofollow" target="_blank" href="http://greenhousepc.com">greenhousepc.com</a> // greenHousePC on Skype</div><div><br><br></div>
<blockquote id="yiv429900235replyBlockquote" style="border-left:2px solid blue;margin-left:8px;padding-left:8px;font-size:10pt;color:black;font-family:verdana;">
<div id="yiv429900235wmQuoteWrapper">
-------- Original Message --------<br>
Subject: Re: [Voyage-linux] Cloning a system<br>
From: Frank Hoeflich <<a rel="nofollow" ymailto="mailto:frankhoeflich@yahoo.com" target="_blank" href="/mc/compose?to=frankhoeflich@yahoo.com">frankhoeflich@yahoo.com</a>><br>
Date: Wed, March 07, 2012 12:21 pm<br>
To: "<a rel="nofollow" ymailto="mailto:voyage-linux@list.voyage.hk" target="_blank" href="/mc/compose?to=voyage-linux@list.voyage.hk">voyage-linux@list.voyage.hk</a>" <<a rel="nofollow" ymailto="mailto:voyage-linux@voyage.hk" target="_blank" href="/mc/compose?to=voyage-linux@voyage.hk">voyage-linux@voyage.hk</a>>, Stanislav<br>
Sinyagin <<a rel="nofollow" ymailto="mailto:ssinyagin@yahoo.com" target="_blank" href="/mc/compose?to=ssinyagin@yahoo.com">ssinyagin@yahoo.com</a>><br>
<br>
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit;" valign="top">Stanislav:<div><br></div><div> While I agree that cloning your ro system live ought to work, I didn't spend much time on it. Once I have a CF that works OK then I clone offline:</div><div><br></div><div>host# dd if=/dev/sdb of=mycf.bin bs=512 count=3931200</div><div>host# eject /dev/sdb</div><div><switch CF in /dev/sdb to a new one></div><div><format new CF however you like></div><div>host# dd if=mycf.bin of=/dev/sdb bs=512 count=3931200</div><div>host# eject /dev/sdb</div><div><br></div><div>Then the new CF works just fine. You'll have to adjust the count for your device. Is this good enough for you?</div><div><br></div><div> On my last project we went a step further and modified the SDK to produce a regular file from the gitgo, so you directly produce mycf.bin and then dd it to CF whenever you want
to make a copy. Works great in Voyage 0.6.5 and 0.7.5 once you get past a couple of known grub legacy (v0.97) bugs, haven't verified in 0.8.0 yet ...<br><div><br></div><div>--Frank<br><br>--- On <b>Wed, 3/7/12, Stanislav Sinyagin <i><<a rel="nofollow" ymailto="mailto:ssinyagin@yahoo.com" target="_blank" href="/mc/compose?to=ssinyagin@yahoo.com">ssinyagin@yahoo.com</a>></i></b> wrote:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;">From: Stanislav Sinyagin <<a rel="nofollow" ymailto="mailto:ssinyagin@yahoo.com" target="_blank" href="/mc/compose?to=ssinyagin@yahoo.com">ssinyagin@yahoo.com</a>><br>Subject: [Voyage-linux] Cloning a system<br>To: "<a rel="nofollow" ymailto="mailto:voyage-linux@list.voyage.hk" target="_blank" href="/mc/compose?to=voyage-linux@list.voyage.hk">voyage-linux@list.voyage.hk</a>" <<a rel="nofollow" ymailto="mailto:voyage-linux@voyage.hk" target="_blank"
href="/mc/compose?to=voyage-linux@voyage.hk">voyage-linux@voyage.hk</a>><br>Date: Wednesday, March 7, 2012, 9:36 AM<br><br><div id="yiv429900235"><div><div style="color:#000;background-color:#fff;font-family:arial, helvetica, sans-serif;font-size:10pt;"><div>hi,</div><div><br></div><div>I'm trying to clone a live system to a new CF, and GRUB fails. Please advise, as I'm not a too deep specialist in Grub.</div><div><br></div><div>My sequence is as follows. The board is alix2d13 from PC Engines. The new CF card is attached via USB card reader at /dev/sdb.</div><div><br></div><div>remountro<br>/usr/local/sbin/<a rel="nofollow" target="_blank" href="http://format-cf.sh">format-cf.sh</a> -t /dev/sdb -b 1 -y<br>mkdir /tmp/cf<br>mount /dev/sdb1 /tmp/cf<br>cd /tmp/cf<br>dump -f - /dev/hda1 | restore -r -f -<br></div><div><br></div><div><br>That was easy, and now Grub fails:</div><div><br></div><div>root@alix102:~# /usr/sbin/grub-install
--root-directory=/tmp/cf /dev/sdb<br>The file /tmp/cf/boot/grub/stage1 not read correctly.</div>root@alix102:~# ls -al /tmp/cf/boot/grub/stage1<br><div>-rw-r--r-- 1 root root 512 Mar 7 17:31 /tmp/cf/boot/grub/stage1<br>root@alix102:~# <br></div><div><br></div><div><br></div><div>The system is 0.8.0 release.<br></div><div></div></div></div></div><br>-----Inline Attachment Follows-----<br><br><div class="yiv429900235plainMail">_______________________________________________<br>Voyage-linux mailing list<br><a rel="nofollow">Voyage-linux@list.voyage.hk</a><br><a rel="nofollow" target="_blank" href="http://list.voyage.hk/mailman/listinfo/voyage-linux">http://list.voyage.hk/mailman/listinfo/voyage-linux</a><br></div></blockquote></div></div></td></tr></tbody></table><hr>_______________________________________________<br>
Voyage-linux mailing list<br>
<a rel="nofollow" ymailto="mailto:Voyage-linux@list.voyage.hk" target="_blank" href="/mc/compose?to=Voyage-linux@list.voyage.hk">Voyage-linux@list.voyage.hk</a><br>
<a rel="nofollow" target="_blank" href="http://list.voyage.hk/mailman/listinfo/voyage-linux">http://list.voyage.hk/mailman/listinfo/voyage-linux</a><br>
</div>
</blockquote></span></div>
</div></blockquote></div></div></td></tr></table>