2

I have installed Windows 10 besides MacOS Big Sur using bootcamp on a Macbook retina 2015 with PCIe based SSD. wubiuefi failed to install Ubuntu 22.04 within the Windows partition and I wonder if there exists any straightforward and trusted method to shrink the BOOTCAMP partition (Windows) and install Ubuntu, without the need for any 3rd party boot manager, and if this can be riskful for further Ubuntu upgrades.

Here is the output of diskutil list:

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI ⁨EFI⁩                     314.6 MB   disk0s1
   2:                 Apple_APFS ⁨Container disk1⁩         220.0 GB   disk0s2
   3:       Microsoft Basic Data ⁨BOOTCAMP⁩                280.0 GB   disk0s3

/dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +220.0 GB disk1 Physical Store disk0s2 1: APFS Volume ⁨MacBook - Data⁩ 24.3 GB disk1s1 2: APFS Volume ⁨Preboot⁩ 333.0 MB disk1s2 3: APFS Volume ⁨Recovery⁩ 623.2 MB disk1s3 4: APFS Volume ⁨VM⁩ 1.1 GB disk1s4 5: APFS Volume ⁨MacBook⁩ 15.3 GB disk1s5 6: APFS Snapshot ⁨com.apple.os.update-...⁩ 15.3 GB disk1s5s1

1 Answers1

0

The Boot Camp Assistant will install Windows 10 to UEFI boot on a 2015 MacBook. This means the hybrid method of partitioning used with older Intel Macs is not employed. Therefore, you can boot to Windows and use the Disk Management (an extension of the Microsoft Management Console) to shrink the Windows partition and create free space for a Ubuntu install.

Note: The file I downloaded was named ubuntu-22.04.2-desktop-amd64.iso.

Below are the steps to install Ubuntu. These steps were adapted from the answer posted by guru431.

Note: The last three steps are optional.

The Ubuntu installer always chooses the first EFI partition on the drive regardless of what you choose. This is why step 4 changes the first efi partition to a ordinary FAT32 volume. The installer will then put the Ubuntu boot files in the new EFI partition created in step 6. The first partition is changed back to EFI in step 9, thus undoing step 4. A second EFI partition is added to avoid overwriting a Windows boot file stored in the first EFI partition.

  1. Go into Windows and use Disk Management to shrink its partition. The free space will be used by Ubuntu.

  2. Boot from Ubuntu install flash drive. From the GRUB menu, select Try or Install Ubuntu. If you wait 30 seconds, this will happen automatically.

  3. When the "Install" popup appears, select Try Ubuntu.

  4. Open the Terminal application and enter the following command to change the first partition type from EFI to FAT32.

    sudo sgdisk -t 1:0700 /dev/nvme0n1
    

    When finished, quit the Terminal application.

  5. Open the Install Ubuntu 22.04.2 LTS application and proceed with installing Ubuntu. During the installation, select the following when each appears.

    • Install third-party software for graphics and Wi-Fi hardware and additional media formats
    • Something else
  6. Select the largest amount of free space and create a new partition. Next, click on the + button, then select the following.

    • Size: 315 MB
    • Type for the new partition: Primary
    • Location for the new partition: Beginning of this space
    • Use as: EFI System Partition
  7. Again, select the largest amount of free space and create a new partition. Next, click on the + button, then select the following.

    • Size: Do not change this value.
    • Type for the new partition: Primary
    • Location for the new partition: Beginning of this space
    • Use as: Ext4 journaling file system
    • Mount point: /
  8. Install Ubuntu.

  9. After rebooting, open the Terminal application and enter the following command. This command changes the first partition type from FAT32 to EFI and removes any hybrid partitioning. (Actually, there should be not be any hybrid partitioning to remove. Therefore, most likely the -h EE option does not change anything.)

    sudo sgdisk -t 1:ef00 -h EE /dev/nvme0n1
    
  10. Boot into macOS.

  11. Goto the URL given below, then download and mount mac-icns.

    https://sourceforge.net/projects/mac-icns/
    
  12. Open the Terminal application and enter the following commands to assign an icon and label to Ubuntu:

    sudo diskutil mount disk0s4
    cp /Volumes/mac-icns/OSX10.11.6/os_ubuntu.icns /Volumes/EFI2/.VolumeIcon.icns
    bless --folder /Volumes/EFI2/EFI/BOOT --label "Ubuntu"
    diskutil unmount disk0s4
    

Note: During the installation of Ubuntu, the UUID of the FAT32 volume stored in the second EFI partition is recorded in the /etc/fstab file. This should cause Ubuntu to keep using the second EFI partition even through upgrades and any changes to the Grub configuration.