A Ubuntu disk has corrupted partition table (I assume) what is the best why to handle this?
Here are some outputs from parted fdisk lsblk gparted
lsblk | grep sda
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 93.2G 0 part
└─sda4 8:4 0 829.1G 0 part
(parted) print
Model: ATA WDC WD10EFRX-68J (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0.00B 1000GB 1000GB ntfs
fdisk
Command (m for help): p
Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EFRX-68J
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: dos
Disk identifier: 0xe139b3fe
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 195352575 195350528 93.2G 83 Linux
/dev/sda4 214808576 1953519615 1738711040 829.1G 83 Linux
Command (m for help): v
Remaining 19461552 unallocated 512-byte sectors.
Command (m for help): F
Unpartitioned space /dev/sda: 9.29 GiB, 9964314624 bytes, 19461552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
Start End Sectors Size
195352576 214808575 19456000 9.3G
1953519616 1953525167 5552 2.7M
gparted thinks its ext2 while parted thinks its ntfs
parted (GNU parted) 3.3
gparted 1.0.0
Partitionmanager when using sda system
GPT fdisk (gdisk) version 1.0.5
Partition table scan:
MBR: MBR only
Partition Table: loop
looks like a major issue. The loop entry for an entire drive is usually seen with small flash drives where you have used DD to copy the ISO to a flash drive to make a hybrid live installer. It totally erases the start of the drive by the size of the ISO. And then partition table is erased, effiectively erasing entire drive. If you used newer gpt, you may have backup partition table at end of drive. What does this show.sudo gdisk -l /dev/sda
Only if gpt may you have a chance to recover partition table. And all data at beginning of drive was overwritten with the ISO. – oldfred May 06 '21 at 20:16man efibootmgr
and edit /EFI/ubuntu/grub.cfg to have main working install's UUID & partition, not latest install. I typically do an install to an UEFI on sdb drive, but that is not particularly easy. https://askubuntu.com/questions/1296065/dual-booting-w10-ubuntu-with-2-separate-ssds-in-uefi-mode/1296153#1296153 & Posted work around correct ESP #55 or ( #23 & #26) https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1396379 – oldfred May 06 '21 at 21:46