I had my GRUB partition of 1 MB starting at block 2049. My BIOS did not recognize it, so I decided to move it to the beginning of the disk using the command
dd if=/dev/sda5 of=/dev/sda bs=512 count=2048
Now I cannot see the partitions at all. Before the operation the first 2048 segments( 1MB) had not format at all and where unrecognized by parted.
I made an image in other disk, dev/sdc, and running gdisk on the image got
sudo gdisk -l /dev/sdc
GPT fdisk (gdisk) version 0.8.8
Caution: invalid main GPT header, but valid backup; regenerating main header from backup!
Caution! After loading partitions, the CRC doesn't check out!
Warning! Main partition table CRC mismatch! Loaded backup partition table instead of main partition table!
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: damaged
Found invalid MBR and corrupt GPT. What do you want to do? (Using the GPT MAY permit recovery of GPT data.)
1 - Use current GPT
2 - Create blank GPT
Your answer: 1
Disk /dev/sdc: 1953525168 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 6FEB1F15-70D6-42F9-A4B8-6E960B8C65F5
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 3437 sectors (1.7 MiB)
Number Start (sector) End (sector) Size Code Name
1 4096 1887105023 899.8 GiB 8300
2 1887105024 1920333823 15.8 GiB 8300
3 1920333824 1944627199 11.6 GiB 8300
4 1944627200 1953523711 4.2 GiB 8200
5 2048 4095 1024.0 KiB EF02
sfdisk -l /dev/sdc output still is
WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util sfdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdc: 121601 cylinders, 255 heads, 63 sectors/track
sfdisk: ERROR: sector 0 does not have an msdos signature /dev/sdc: unrecognized partition table type
No partitions found
fsck -y /dev/sdc says
sudo fsck -y /dev/sdc
fsck from util-linux 2.20.1
e2fsck 1.42.9 (4-Feb-2014)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superbloque es inválido, intentando los bloques de respaldo...
fsck.ext2: Bad magic number in super-block mientras se intentaba abrir /dev/sdc
The superbloque could not be read or does not describe a valid ext2/ext3/ext4
sistema de ficheros. If the dispositivo is valid and it really contains an ext2/ext3/ext4
sistema de ficheros (and not swap or ufs or something else), then the superbloque
is corrupt, and you might try running e2fsck with an alternate superbloque:
e2fsck -b 8193 <dispositivo>
or
e2fsck -b 32768 <dispositivo>
Is there is a way to recover my partitions or at least my data? I guess writing something else in these first segments should work.
Best,
Julian
sudo gdisk -l /dev/sda
. – oldfred Feb 24 '19 at 14:46Caution: invalid main GPT header, but valid backup; regenerating main header from backup!
Caution! After loading partitions, the CRC doesn't check out! Warning! Main partition table CRC mismatch! Loaded backup partition table instead of main partition table!
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan: MBR: not present BSD: not present APM: not present GPT: damaged
– JDaich Feb 24 '19 at 19:35sudo parted /dev/sda unit s print Error: /dev/sda: unrecognised disk label
Same result with the rescue oprtion
– JDaich Feb 25 '19 at 15:04`Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63
Current partition structure: Partition Start End Size in sectors
Bad GPT partition, invalid signature. Trying alternate GPT 1 P Unknown 4096 1887105023 1887100928 2 P Unknown 1887105024 1920333823 33228800 3 P Unknown 1920333824 1944627199 24293376 4 P Linux Swap 1944627200 1953523711 8896512 5 P Unknown 2048 4095 2048`
– JDaich Feb 25 '19 at 15:44sudo dd if=/dev/sda of=/dev/sdc
– JDaich Mar 02 '19 at 08:35sudo apt-get install gddresuce
andsudo ddrescue -f -r3 PATH$/mapfile2
– JDaich Mar 04 '19 at 22:07e2fsck -b 8193 <dispositivo> or e2fsck -b 32768 <dispositivo>
. See the updated post above. I guess must run e2fsck -b assigning blocks to unexisting devices. Never did so. – JDaich Mar 05 '19 at 07:34