0

When trying to extend a partition from my SSD (which contained my Arch Linux partition), Windows converted it to a dynamic drive, which messed up my GRUB boot since apparently Linux can't read dynamic drives. I reverted back to a simple drive using AOMEI Partition Assistant as suggested on a couple posts.

However, it seems to have messed up the partition table since I still can't boot into GRUB and when checking from a bootable USB, gdisk shows both MBR and GPT partition tables available. Here's all outputs from gdisk:

Disk info:

[[email protected] ~]$ sudo gdisk /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.9.1

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: present

Found valid MBR and GPT. Which do you want to use?
 1 - MBR
 2 - GPT
 3 - Create blank GPT

MBR:

Disk /dev/nvme0n1: 1953525168 sectors, 931.5 GiB
Model: Samsung SSD 970 EVO Plus 1TB            
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 1A0E603E-51F0-4487-B502-11E625DF814E
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 211840366 sectors (101.0 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1      1426096128      1427144703   512.0 MiB   0700  Microsoft basic data
   2      1427144704      1741717503   150.0 GiB   0700  Microsoft basic data
   5           32768      1426096126   680.0 GiB   0700  Microsoft basic data

GPT:

Disk /dev/nvme0n1: 1953525168 sectors, 931.5 GiB
Model: Samsung SSD 970 EVO Plus 1TB            
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): A9089CC8-91CB-4A00-AB2F-F39D643718A8
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 8-sector boundaries
Total free space is 211807631 sectors (101.0 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34            2081   1024.0 KiB  4201  LDM metadata partition
   2            2082           32767   15.0 MiB    0C01  Microsoft reserved ...
   3           32768      1426096127   680.0 GiB   4200  LDM data partition
   4      1426096128      1427144703   512.0 MiB   EF02  
   5      1427144704      1741717503   150.0 GiB   8300  

It appears the GPT table is from before I converted back to simple volume since it contains LDM data as before. The MBR table is correct in how my partitions where distributed before the disk was converted to dynamic but all partitions show as Microsoft basic data, so I'm not sure if I should just roll back to that.

When opening gparted the drive appears fine, the 150Gb partition even shows using ext4 filesystem (gparted screenshot) which is correct and I can even mount it from command line, however, I can't mount them from the bootable's File manager GUI. In fact, I can't mount any partition from that drive from GUI. GRUB also seems to have been corrupted on some step of the way because my PC boots to "Selected boot device failed. Press any button to reboot" when I select that boot partition. I can still boot to Windows since it was installed in another drive. Also, every disk but this one has a GPT partition table, I'm not sure if this one was GPT or MBR before I messed up with the Windows dynamic drive thing.

I'm not sure what to do here, is there a way to recover my old partition table and not lose any data?

Note: I'm using Arch Linux (EndeavourOS) on dual boot with Windows 10.

Edit 1: After converting back to Simple drive, my arch partition is visible (but of course not accessible) from both Windows' explorer and partition manager, where it shows as RAW.

9
  • A disk cannot (or should not) be both MBR and GPT, and if it is somehow, that is the reason Windows while installed in non-Legacy mode (UEFI), cannot boot you should resolve that conflict.
    – Ramhound
    Commented Sep 23, 2023 at 22:49
  • That's what I've been trying to figure out, since both of the partition tables seem to be troublesome I don't know a way to resolve that conflict without potentially losing all my data, so I'm backing up and will probably be formatting the whole drive.
    – Kvothe
    Commented Sep 23, 2023 at 23:30
  • Disk info message provided the option to keep the GPT partition information but unclear if your original partition scheme was MBR or GPT
    – Ramhound
    Commented Sep 24, 2023 at 1:22
  • The GPT and MBR outputs below are the info shown when selecting them in Disk Info, and (i assume) would be the result of keeping each partition table. But GPT seems to be the one from when Windows changed the disk to dynamic, and MBR just shows Microsoft Basic data on all 3 partitions, so none of them seem to be the right way to recover the old table? I'm also afraid that "Create a blank GPT" will just delete my data altogether.
    – Kvothe
    Commented Sep 24, 2023 at 1:55
  • But yeah, I'm not clear either on which was the original partition scheme.
    – Kvothe
    Commented Sep 24, 2023 at 1:56

2 Answers 2

0

To the best of my knowledge and some personal experience, you cannot just convert a dynamic volume to basic. The dynamic disk is owned by the basic disk it is tied to.

You must back off the data, rebuild as a basic volume (format as basic), select only one of MBR or GPT, and then proceed.

If you are able to roll back, then by all means do that.

4
  • My option B for all of this is just backup both the Arch partition and all my files on the NTFS partition and format the whole disk, but I'm really trying to not do that since I would have to (probably?) reinstall Arch. I already saved everything on /home of course, in case I messed something up badly.
    – Kvothe
    Commented Sep 23, 2023 at 22:35
  • Your option B is essentially what I posted.
    – anon
    Commented Sep 23, 2023 at 22:41
  • My bad, I was essentially agreeing with your post. I'm already backing up and figuring out how to restore an arch installation from a backup without having to reinstall everything manually after formatting.
    – Kvothe
    Commented Sep 23, 2023 at 23:28
  • After formatting, you need to reinstall whatever is needed and restore data. So what I have posted is correct in this situation.
    – anon
    Commented Sep 23, 2023 at 23:29
0

Well, I’ll leave this as a final solution for anybody that runs through this particular, personal hell.

Indeed, when reverting back from Windows’ dynamic drive, two partition tables were left conflicting (an MBR with the correct distribution, and the old GPT one with the dynamic distribution). I was scared about the MBR partition since it only had “Windows basic data”, but apparently that code and name only affect whether a partition is visible from Windows or not.

The thing that did it for me then was zapping (lowercase!) the GPT table using:

sudo gdisk /dev/path/to/drive
x
z   # (in lowercase! since uppercase Z will nuke both tables.)
destroy gpt partition? y
wipe mbr partition? n

Then carefully mounting my system, the EFI partition, arch-chroot into my OS and reparing (reinstalling) GRUB.

And after rebooting I can happily say I have everything back in order! :D

If anybody ends up here with a similar problem, BE CAREFUL when doing anything with your partitions (both on Windows and when using fdisk, gdisk, sgdisk, etc.) and always backup your data, what worked for me may not necessarily work for you. I was, several times, a few keys away from doing the completely wrong thing and messing up my data for good because other posts looked very similar to my problem.

Also, thank you to everybody in this post for the help!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .