0

Hopefully this board can help with my unique situation.

Back ground information: My computer runs debian Jessie with encrypted LVM. I was installing a few python packages onto it through the 'sudo pip install' command, and while 'pandas' was compiling, the terminal froze and the computer went to the screen with the blinking underscore in the top left corner (the underscore was not flashing, just showing).

While this was happening, I had a few firefox windows open and I was running a program in the JVM

To shutdown my computer, I held the power button to force it to shutdown.

The computer booted to grub rescue saying 'error: disk '(,gpt2)' cannot be found', or something similar. I can get the exact phrase and drives that are displaying if it's relevant.

What I have tried so far: I went through the process of creating a bootable xubuntu usb stick, and I installed boot-repair to try and see if that program would solve the issue. The "recommended repair" button did not show up probably because of the LVM. Here is the boot-summary: https://pastebin.com/eTkgyUL9 (I apologize if external links are frowned upon)

I'm trying to fix /dev/sda so it boots again, and it seems that it has a corrupted partition table. I don't have any particular important information on the computer, and everything has already been backed up. I can answer detailed questions about my computer system, so don't hesitate to ask. Any help is greatly appreciated.

UPDATE: It seems like I can restore the partition table on the drive by using the backup. Would someone with more experience with grub, grub-rescue, fdisk, etc. please comment on this? How would I go about this?

xubuntu@xubuntu:~$ sudo fdisk -l /dev/sda
The primary GPT table is corrupt, but the backup appears OK, so that will be used.
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: F87898F5-F345-46E5-B200-FE992BA23671

Device       Start        End    Sectors  Size Type
/dev/sda1     2048    1050623    1048576  512M EFI System
/dev/sda2  1050624    1550335     499712  244M Linux filesystem
/dev/sda3  1550336 3907028991 3905478656  1.8T Linux filesystem
0

I fixed the issue! I'm not sure how the GPT partition table got corrupted, but I was able to fix it using sudo gdisk

  1. I first saw that the primary GPT table is corrupt but the backup seemed to be fine. From a bootable Linux usb drive...

    xubuntu@xubuntu:~$ sudo fdisk -l /dev/sda The primary GPT table is corrupt, but the backup appears OK, so that will be used. Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: F87898F5-F345-46E5-B200-FE992BA23671

    Device Start End Sectors Size Type /dev/sda1 2048 1050623 1048576 512M EFI System /dev/sda2 1050624 1550335 499712 244M Linux filesystem /dev/sda3 1550336 3907028991 3905478656 1.8T Linux filesystem

  2. sudo gdisk /dev/sda

    GPT fdisk (gdisk) version 1.0.1

    Caution: invalid backup GPT header, but valid main header; regenerating backup header from main header.

    Partition table scan: MBR: protective BSD: not present APM: not present GPT: damaged


    Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk verification and recovery are STRONGLY recommended.


    Command (? for help):

  3. You can type ? for command help. In sequence I used p, then w, then the program asks for confirmation with Y/N.

    Command (? for help): w

    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!

    Do you want to proceed? (Y/N): Y OK; writing new GUID partition table (GPT) to /dev/sda. Warning: The kernel is still using the old partition table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) The operation has completed successfully.

  4. Run sudo partprobe and sudo fdisk -l /dev/sdxX to make sure everything turned out okay.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.