ceene | i've overwritten my hard disk contents with an SD card image | 15:49 |
---|---|---|
ceene | the first 512MB of /dev/sdc, which a single ext4 partition have been written with the contents of a 512MB sized five-partition SD card image | 15:50 |
ceene | is there any way to recover from this? I should hope to restore the basics of the filesystem and access the files that have not been overwritten | 15:50 |
KotCzarny | what was on the sdc? | 15:51 |
ceene | a 1tb sized ext4 partition with my /home | 15:51 |
KotCzarny | ext2/3/4 stores meteadata across whole hdd | 15:52 |
KotCzarny | so yeah, some restoration might be possible | 15:52 |
KotCzarny | first i would start with dumping that 1tb to some other place | 15:52 |
KotCzarny | thenhttps://askubuntu.com/questions/337541/how-to-recover-partially-formatted-ext4-partition-testdisk-did-not-help | 15:54 |
KotCzarny | random google answer | 15:54 |
KotCzarny | basically, restore mbr, then try running e2fsck | 15:55 |
KotCzarny | but first, do a backup of the device | 15:55 |
KotCzarny | s/restore mbr/restore partition table/ | 15:55 |
ceene | i don't think i'm gonna need any of that, but i've been extremely lucky | 16:02 |
ceene | the whole story is this | 16:02 |
ceene | i mistyped cat sd.img > /dev/sde and wrote to /dev/sdc | 16:02 |
ceene | /dev/sdc1 was already mounted | 16:02 |
ceene | i realized the mistake when cat took so very little time: it was not writing to an SD card but to a sata drive | 16:03 |
ceene | since i didn't umount /dev/sdc1, i could see its contents on /home | 16:03 |
ceene | so i did rsync -Pa /home /mnt/another_External_disk | 16:04 |
ceene | and I went to eat. When I was back, the computer was completely frozen | 16:04 |
ceene | but! /mnt/another_External_disk mounts perfectly and the contents of /home are there! | 16:04 |
ceene | so a inplace backup has hust saved me | 16:04 |
ceene | of course those first 512mb are lost, who knows now what was there | 16:05 |
KotCzarny | rsync copies data | 16:05 |
KotCzarny | but some files might be corrupted anyway | 16:05 |
KotCzarny | you can find out by looking at inodes lists, but up to you how much you need to know | 16:06 |
ceene | i'm still going to try to recover this overwritten disk, it may be a nice learning experience | 16:06 |
ceene | it seems that e2fsck should be able to use one of the superblock backups (from your link above) | 16:08 |
ceene | well, i have now lots of files under lost+found | 16:43 |
ceene | it definitely has recovered a lot | 16:43 |
ceene | i would say that everything is there | 16:44 |
Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!