<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> (a) p .....(check that the partition table is intact)<br> (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 'count=1' 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"><<a href="mailto:nomeata@debian.org">nomeata@debian.org</a>></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">> for the third time in the past two weeks, my freerunner has corrupted<br>
> my microsd card.<br>
><br>
> is there anyway of recovering it?<br>
><br>
> i gather from other posts it's a problem with the partition table,<br>
> rather than the actual data<br>
><br>
> i don't really want to reinstall debian, all the software, and copy<br>
> across 5GB of music; they're not the quickest of tasks<br>
><br>
> what software is recommended? and is it best to do on the freerunner,<br>
> 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>