0

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
error from gparted

gparted thinks its ext2 while parted thinks its ntfs

parted (GNU parted) 3.3
gparted 1.0.0

Partitionmanager when using sda system
Partitionmanager when using sda system GPT fdisk (gdisk) version 1.0.5

Partition table scan:
MBR: MBR only

Keith5001
  • 124
  • 1
  • 8
  • 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:16
  • I am in the system right now. I have a Ubuntu on ssd as well. Also the grub has change its top entry from a system on the ssd to the sda. Partitionmanager show everything OK on sda I updated with screen-shot – Keith5001 May 06 '21 at 20:56
  • The loop was added when I was changing the partition it seems. I could just start again with the sda disk. I have a backup. I could just backup home, wipe, re-install. But if I do that the sda will take the primary grub, I wanted the top entry on the ssd. Has the grub anyway now – Keith5001 May 06 '21 at 21:02
  • I have multiple Ubuntu installs. And have to either reinstall grub from my main working install, or edit entries. I update boot order with efibootmgr -o See man 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
  • You info may help, thanks as I always have grub take over issues, If I want to make sda a stand alone boot system would I use a non efi system because I changed my ssd and the sda system had to re-insert ssd ID I was trying to make the sda system stop using the ssd efi – Keith5001 May 06 '21 at 21:50
  • I always suggest gpt partitioning whether UEFI or BIOS. But if BIOS, you have to have a bios_grub partition for grub to correctly install. I have used gpt for 10 years with both BIOS & UEFI. Even converted my 2006 laptop, mostly retired, to gpt. GPT Advantages (older 2010 but still valid) see post#2 by srs5694: http://ubuntuforums.org/showthread.php?t=1457901 & https://wiki.archlinux.org/index.php/GUID_Partition_Table#Advantages_of_GPT But Microsoft requires MBR partitioning for BIOS installs. – oldfred May 07 '21 at 02:28
  • I think I will save any required data, reformat gpt & redo, I can work out a slightly better partition size too. Well its a loop partition I have no other option. It got messed up. I will wait a day, then give this as answer. Only It will take over grub, any suggestions? – Keith5001 May 07 '21 at 03:19
  • If loop from ISO write then, you need to do this first: Reset USB flash that was dd'd to make it usable again, reuse https://askubuntu.com/questions/939230/formatting-a-usb-stick-unable-to-operate-usb/939266#939266 & https://help.ubuntu.com/community/mkusb#Re-use_the_pendrive & https://unix.stackexchange.com/questions/216152/usb-disk-read-only-cannot-format-turn-off-write-protection If UEFI you need an ESP - efi system partition and if BIOS you need a bios_grub partition when you use gpt partitioning. And then always boot in that mode. – oldfred May 07 '21 at 13:28
  • I have re-installed with a gpt partition. It did not boot direct on restart, but in bios I can select the boot drive, it may be just a boot ordering reason. – Keith5001 May 08 '21 at 11:12

0 Answers0