How to convert windows LDM to GPT without loosing data

I was using boot camp on my Late 2011 MacBook Pro and I needed more space, so I followed this tutorial https://www.partitionwizard.com/partitionmagic/reszie-boot-camp-partition.html

but when I combined the 2 partitions in windows 10, it said to restart it, so I did, but it kept BSOD with the error message relating to an invalid boot partition. So I thought so what, there was nothing really on there ill go back to using OSX, but when I went to select the boot drive using option at bootup, it wasn't there.


I went into Target disk mode and hooked it up to a mac mini I have and the whole drive is now Windows_LDM partition.


Does anyone know how to convert the main partition or the entire drive back to GPT so I can boot into OSX again without losing data? I don't care about the windows partition, only the OSX partition is important. Or make it so I can access the data on it and at least create a backup I can restore from later, or just get the important stuff off/


I have no backups or anything. I do have the mac mini to use if need be. I also have a windows PC running windows 10


I have tried booting into recovery mode using command + R but only get internet recovery. I removed the original HDD and installed a 240gb SSD so I don't know if there even is a recovery partition on it. No recovery drive shows up in the boot menu either.


Specs

Late 2011 MBP 15" A1286

Core I7 2.2ghz

12gb RAM

OSX High Sierra or just Sierra, Im not sure if I upgraded to HS


I'm pretty good with computers, but I'm not the best with terminal and its commands.


Also, I know I should back up my computer, but I didn't think it would have damaged my OSX partition when resizing it. If there is no way to do it without reinstalling, then it is what it is. I would like to save the data, but if that's not possible its fine.

MacBook Pro, macOS High Sierra (10.13), null

Posted on Aug 12, 2018 9:09 AM

Reply

Similar questions

30 replies

Aug 12, 2018 12:33 PM in response to Loner T

Disk /dev/disk2: 468862128 sectors, 223.6 GiB

Sector size (logical): 512 bytes

Disk identifier (GUID): 4CE60299-7B9B-424C-AC0F-071CB3290BEA

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 468862094

Partitions will be aligned on 8-sector boundaries

Total free space is 1173 sectors (586.5 KiB)


Number Start (sector) End (sector) Size Code Name

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 342206511 163.0 GiB AF0A Macintosh SSD

3 342206512 369551359 13.0 GiB AF0A

4 369551360 468860927 47.4 GiB 0700

17 18376656804508598272 4613656343264362496 512 bytes FFFF

19 1945555039024119808 1945555039035538674 5.4 GiB FFFF ࠀ



After this line 17 18376656804508598272 4613656343264362496 512 bytes FFFF there was a bunch of Chinese characters

Aug 12, 2018 2:00 PM in response to cam2363

We need to set the alignment to 1 sector. Run


sudo gdisk /dev/disk2

x (Experts)

l (Lowercase L to set alignment to...)

1 (... 1 sector)

m (Main menu)

n (New)

1 (GPT 1 - EFI)

40 (Start address)

409639 (End address)

EF00 (EFI)

n (New)

2 (GPT 2)

409640 (Start address)

342206511 (End address)

AF0A

n (New)

3 (GPT 3)

342206512 (Start address)

369551359 (End address)

AF0A

n (New)

4 (GPT 4)

369551360 (Start address)

468860927 (End address)

0700 (Windows)

p (print)

w (write)

y (Confirm the write)

q (quit, if necessary)


and post the output of


sudo gpt -vv -r show /dev/disk0

Aug 12, 2018 1:53 PM in response to Loner T

cams-Mac-mini:~ cam$ diskutil unmountDisk disk2

Unmount of all volumes on disk2 was successful

cams-Mac-mini:~ cam$ sudo gpt dstroy /dev/disk2

Password:

gpt: unknown command: dstroy

cams-Mac-mini:~ cam$ sudo gpt destroy /dev/disk2

cams-Mac-mini:~ cam$ sudo gpt create -f /dev/disk2

cams-Mac-mini:~ cam$ diskutil unmountDisk disk2

Unmount of all volumes on disk2 was successful

cams-Mac-mini:~ cam$ sudo gdisk /dev/disk2

GPT fdisk (gdisk) version 1.0.4


Partition table scan:

MBR: protective

BSD: not present

APM: not present

GPT: present


Found valid GPT with protective MBR; using GPT.


Command (? for help): n

Partition number (1-128, default 1): 1

First sector (34-468862094, default = 2048) or {+-}size{KMGTP}: 40

Information: Moved requested sector from 40 to 2048 in

order to align on 2048-sector boundaries.

Use 'l' on the experts' menu to adjust alignment

Last sector (2048-468862094, default = 468862094) or {+-}size{KMGTP}: 409639

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = AF00): EF00

Changed type of partition to 'EFI System'


Command (? for help): n

Partition number (2-128, default 2): 2

First sector (34-468862094, default = 411648) or {+-}size{KMGTP}: 409640

Information: Moved requested sector from 409640 to 411648 in

order to align on 2048-sector boundaries.

Use 'l' on the experts' menu to adjust alignment

Last sector (411648-468862094, default = 468862094) or {+-}size{KMGTP}: 342206511

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = AF00): AF0A

Changed type of partition to 'Apple APFS'


Command (? for help): n

Partition number (3-128, default 3): 3

First sector (34-468862094, default = 342208512) or {+-}size{KMGTP}: 342206512

Information: Moved requested sector from 342206512 to 342208512 in

order to align on 2048-sector boundaries.

Use 'l' on the experts' menu to adjust alignment

Last sector (342208512-468862094, default = 468862094) or {+-}size{KMGTP}: 369551359

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = AF00): AF0A

Changed type of partition to 'Apple APFS'


Command (? for help): n

Partition number (4-128, default 4): 4

First sector (34-468862094, default = 369551360) or {+-}size{KMGTP}: 369551360

Last sector (369551360-468862094, default = 468862094) or {+-}size{KMGTP}: 468860927

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = AF00): 0700

Changed type of partition to 'Microsoft basic data'


Command (? for help): p

Disk /dev/disk2: 468862128 sectors, 223.6 GiB

Sector size (logical): 512 bytes

Disk identifier (GUID): FC04082B-FFC2-49A5-A444-F8AF84350FE8

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 468862094

Partitions will be aligned on 2048-sector boundaries

Total free space is 7189 sectors (3.5 MiB)


Number Start (sector) End (sector) Size Code Name

1 2048 409639 199.0 MiB EF00 EFI System

2 411648 342206511 163.0 GiB AF0A Apple APFS

3 342208512 369551359 13.0 GiB AF0A Apple APFS

4 369551360 468860927 47.4 GiB 0700 Microsoft basic data


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/disk2.

Warning: The kernel may continue to use old or deleted partitions.

You should reboot or remove the drive.

The operation has completed successfully.

cams-Mac-mini:~ cam$ q

-bash: q: command not found

cams-Mac-mini:~ cam$ gpt -vv -r show /dev/disk2

gpt show: unable to open device '/dev/disk2': Permission denied

cams-Mac-mini:~ cam$ sudo gpt -vv -r show /dev/disk2

Password:

gpt show: /dev/disk2: mediasize=240057409536; sectorsize=512; blocks=468862128

gpt show: /dev/disk2: PMBR at sector 0

gpt show: /dev/disk2: Pri GPT at sector 1

gpt show: /dev/disk2: Sec GPT at sector 468862127

start size index contents

0 1 PMBR

1 1 Pri GPT header

2 32 Pri GPT table

34 2014

2048 407592 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

409640 2008

411648 341794864 2 GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC

342206512 2000

342208512 27342848 3 GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC

369551360 99309568 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

468860928 1167

468862095 32 Sec GPT table

468862127 1 Sec GPT header

cams-Mac-mini:~ cam$

Aug 12, 2018 11:57 AM in response to Loner T

/dev/disk0

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *120.0 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_HFS Macintosh HD 119.2 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

/dev/disk1

#: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme *8.0 GB disk1

1: DOS_FAT_32 UNTITLED 8.0 GB disk1s1

/dev/disk2

#: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme *240.1 GB disk2

1: Windows_LDM 189.2 GB disk2s1

2: Windows_LDM 50.4 GB disk2s2

3: Windows_LDM 471.4 MB disk2s3

/dev/disk3

#: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme *1.0 TB disk3

1: Apple_HFS MAXTOR 1TB 1.0 TB disk3s1



I didnt know, I just followed the guide. The 120GB disk is the mac mini drive

The 8gb is a flash drive

the 240gb disk is where the problem is. The 190gb is the osx partition and the 50gb is windows

The 1tb is an external HDD

Aug 12, 2018 2:41 PM in response to Loner T

cams-Mac-mini:~ cam$ diskutil unmountDisk disk2

Unmount of all volumes on disk2 was successful

cams-Mac-mini:~ cam$ sudo gpt destroy /dev/disk2

cams-Mac-mini:~ cam$ sudo gpt create -f /dev/disk2

cams-Mac-mini:~ cam$ sudo gdisk /dev/disk2

GPT fdisk (gdisk) version 1.0.4


Partition table scan:

MBR: protective

BSD: not present

APM: not present

GPT: present


Found valid GPT with protective MBR; using GPT.


Command (? for help): x


Expert command (? for help): l

Enter the sector alignment value (1-65536, default = 2048): 1


Expert command (? for help): m


Command (? for help): n

Partition number (1-128, default 1): 1

First sector (34-468862094, default = 34) or {+-}size{KMGTP}: 40

Last sector (40-468862094, default = 468862094) or {+-}size{KMGTP}: 409639

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = AF00): EF00

Changed type of partition to 'EFI System'


Command (? for help): m

b back up GPT data to a file

c change a partition's name

d delete a partition

i show detailed information on a partition

l list known partition types

n add a new partition

o create a new empty GUID partition table (GPT)

p print the partition table

q quit without saving changes

r recovery and transformation options (experts only)

s sort partitions

t change a partition's type code

v verify disk

w write table to disk and exit

x extra functionality (experts only)

? print this menu


Command (? for help): n

Partition number (2-128, default 2): 2

First sector (34-468862094, default = 409640) or {+-}size{KMGTP}: 409640

Last sector (409640-468862094, default = 468862094) or {+-}size{KMGTP}: 342206511

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = AF00): AF0A

Changed type of partition to 'Apple APFS'


Command (? for help): n

Partition number (3-128, default 3): 3

First sector (34-468862094, default = 342206512) or {+-}size{KMGTP}: 342206512

Last sector (342206512-468862094, default = 468862094) or {+-}size{KMGTP}: 369551359

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = AF00): AF0A

Changed type of partition to 'Apple APFS'


Command (? for help): n

Partition number (4-128, default 4): 4

First sector (34-468862094, default = 369551360) or {+-}size{KMGTP}: 369551360

Last sector (369551360-468862094, default = 468862094) or {+-}size{KMGTP}: 468860927

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = AF00): 0700

Changed type of partition to 'Microsoft basic data'


Command (? for help): p

Disk /dev/disk2: 468862128 sectors, 223.6 GiB

Sector size (logical): 512 bytes

Disk identifier (GUID): B8D918C0-E513-40B4-887B-EB65A8A78BF4

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 468862094

Partitions will be aligned on 1-sector boundaries

Total free space is 1173 sectors (586.5 KiB)


Number Start (sector) End (sector) Size Code Name

1 40 409639 200.0 MiB EF00 EFI System

2 409640 342206511 163.0 GiB AF0A Apple APFS

3 342206512 369551359 13.0 GiB AF0A Apple APFS

4 369551360 468860927 47.4 GiB 0700 Microsoft basic data


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/disk2.

Warning: The kernel may continue to use old or deleted partitions.

You should reboot or remove the drive.

The operation has completed successfully.

cams-Mac-mini:~ cam$

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to convert windows LDM to GPT without loosing data

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.