I have a failed SanDisk Extreme III (30 MB/s 4GB) card.
I successfully recovered everything that mattered a couple of weeks ago using ddrescue: $sudo ddrescue -f -n /dev/sdd ./from-site-`date +%F`.dd logfile
The resulting image is 4110188544 bytes in size.
Today used dd to put the recovered image onto a new Sandisk Extreme 40MB/s 4GB card: $ sudo dd bs=1M if=from-site-2013-06-25.dd of=/dev/sdd dd: writing ‘/dev/sdd’: No space left on device 3816+0 records in 3815+0 records out 4000317440 bytes (4.0 GB) copied, 1313.42 s, 3.0 MB/s
When I boot from the new card, I get "Attempt to access beyond the end of device" in /var/log/messages, although these attempts only come from access to /dev/sda5 which is the swap partition.
So, what do I do?
As far as I can tell all I need to do is fix the partition table and reduce the size of the swap partition. I did try firing up fdisk and deleting and recreating the partition but it just created it the same size, presumably because fdisk believes the disk is the wrong size. How do I fix that?
Possible solutions while booted into the box preferred but if I need to take the card out and transfer to another PC via USB card reader I can do that.
Mark Rogers
-- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) @ 13 Clarke Rd, Milton Keynes, MK1 1LG
On 15 July 2013 10:01, Mark Rogers mark@quarella.co.uk wrote:
As far as I can tell all I need to do is fix the partition table and reduce the size of the swap partition. I did try firing up fdisk and deleting and recreating the partition but it just created it the same size, presumably because fdisk believes the disk is the wrong size.
Turns out I was on the right track...
sda5 is a logical partition living in extended partition sda2. Recreating sda5 just defaulted to the size of sda2, which was still wrong. Deleting sda5 then sda2 (which only contained sda5), then recreating sda2 then sda5, fixed the problem.
The only remaining step, which I initially forgot, was to mkswap /dev/sda5; prior to doing that the partition still "looked like" a swap partition but it's own header information lied about its size, because although I'd deleted and recreated the partition the new one started in the same place on the disk as the old one where the old swap partition data still resided.
Maybe that'll be useful to someone else.
Why one 4GB Sandisk CF card is a different size from another is a different question entirely...
Mark -- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) @ 13 Clarke Rd, Milton Keynes, MK1 1LG
If I am honest having swap files on SD card's has never worked out that well for me.
If you do really need one and can't just run swapless. Then I suggest looking at the vm.swappiness of the kernel to at least reduce when it is going to get used.
On 16 July 2013 07:07, Wayne Stallwood ALUGlist@digimatic.co.uk wrote:
If I am honest having swap files on SD card's has never worked out that well for me.
If you do really need one and can't just run swapless. Then I suggest looking at the vm.swappiness of the kernel to at least reduce when it is going to get used.
Thanks for the tip, I'll look into this.
Mark