<div dir="ltr">Essentially, the partition table is stored in the first sector of the disk. For me I have stored first 2 sectors (just to be sure) as backup in my home (which still sits in internal flash)<br>dd if=/dev/mmcblk0 of=/home/root/2secSd.save bs=512 count=2<br>
<br>Moreover, as I am not too sure of how many sectors actually get overwritten, so I have configured the first partition as 128Mb of swap.<br><br>Once I notice that the sdcard is gone bad, I simply get the parition table back by:<br>
(1) dd of=/dev/mmcblk0 if=/home/root/2secSd.save bs=512 count=2 ...(get the table back)<br>(2) mount ....(list currently mounted partitions and ensure that none from /dev/mmcblk0 are mounted...unmount those which get mounted)<br>
(3) fdisk /dev/mmcblk0<br>&nbsp;&nbsp;&nbsp;&nbsp; (a) p .....(check that the partition table is intact)<br>&nbsp;&nbsp;&nbsp;&nbsp; (b) 2 .....(flush this table to disk, which was already there....but fdisk would tell kernel about the change and thats what we want)<br>
(4) mount -a ....(mount all that is listed in /etc/fstab)<br><br>You should have the data back<br><br>If you have some data parition as the first partition use &#39;count=1&#39; in the dd commands. I use them that way, just to be sure. They are not needed to get the partition back.<br>
<br>HTH<br><br>--Vikas<br><br><div class="gmail_quote">On Sat, Oct 18, 2008 at 2:42 PM, Joachim Breitner <span dir="ltr">&lt;<a href="mailto:nomeata@debian.org">nomeata@debian.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
Am Samstag, den 18.10.2008, 13:30 +1300 schrieb Robin Paulson:<br>
<div class="Ih2E3d">&gt; for the third time in the past two weeks, my freerunner has corrupted<br>
&gt; my microsd card.<br>
&gt;<br>
&gt; is there anyway of recovering it?<br>
&gt;<br>
&gt; i gather from other posts it&#39;s a problem with the partition table,<br>
&gt; rather than the actual data<br>
&gt;<br>
&gt; i don&#39;t really want to reinstall debian, all the software, and copy<br>
&gt; across 5GB of music; they&#39;re not the quickest of tasks<br>
&gt;<br>
&gt; what software is recommended? and is it best to do on the freerunner,<br>
&gt; or elsewhere, in a card reader?<br>
<br>
</div>If it's just the partition table, and you have used the debian installer<br>
script to partition, you can run the partition stage again.<br>
(./installer.sh partition). This will leave your data intact and makes<br>
it accessible again.<br>
<br>
Greetings,<br>
Joachim<font color="#888888"><br></font></blockquote></div><br></div>