I understand your goal is to create a bootable Ubuntu USB drive on macOS that also includes a shared storage partition accessible by both macOS and Linux. While macOS doesn't natively support creating a bootable USB with multiple partitions, there is a validated method to achieve this using balenaEtcher and GParted.
-
Download Ubuntu ISO: Obtain the latest Ubuntu ISO from the official Ubuntu website.
-
Download and Install balenaEtcher:
- Visit balena.io to download the macOS version.
- Open the downloaded
.dmgfile and drag balenaEtcher into your Applications folder.
-
Prepare the USB Drive:
- Insert your USB drive (at least 8 GB recommended).
- Open Disk Utility (Applications > Utilities > Disk Utility).
- Select your USB drive (not the volume) and click Erase.
- Set the format to MS-DOS (FAT) and the scheme to GUID Partition Map.
- Click Erase to format the drive.
-
Write the Ubuntu ISO to the USB Drive:
- Launch balenaEtcher.
- Click Flash from file, select the Ubuntu ISO you downloaded.
- Click Select target, choose your USB drive.
- Click Flash! to begin the process.
- Wait for the process to complete.
This process will create a bootable Ubuntu USB drive.
After creating the bootable Ubuntu USB, you can add a shared storage partition:
-
Boot into Ubuntu:
- Insert the USB drive into your Mac.
- Restart your Mac and hold the Option (⌥) key during boot.
- Select the USB drive to boot into Ubuntu.
-
Install GParted:
-
Open a terminal in Ubuntu.
-
Run the following commands to install GParted:
sudo apt update sudo apt install gparted
-
Launch GParted from the application menu.
-
-
Resize the Existing Partition:
- In GParted, select your USB drive.
- Right-click on the existing partition (the Ubuntu partition) and select Resize/Move.
- Shrink the partition to create unallocated space for the new partition.
- Click Resize/Move to apply changes.
-
Create a New ExFAT Partition:
- In the unallocated space, right-click and select New.
- Set the file system to exFAT.
- Label the partition (e.g.,
SHARED). - Click Add to create the partition.
- Click the green checkmark to apply all operations.
-
Exit GParted:
- Close GParted and reboot your system.
Now, your USB drive will have two partitions: one for Ubuntu and one for shared storage accessible by both macOS and Linux.
-
Booting on Mac: Ensure that your Mac's firmware supports booting from USB. Most modern Macs do, but some older models may not.
-
Data Backup: Before making any changes to your USB drive, ensure that all important data is backed up.
-
Partition Sizes: Allocate sufficient space for both Ubuntu and the shared storage partition based on your needs.
-
File System Compatibility: ExFAT is compatible with both macOS and Linux, making it ideal for shared storage.
If you prefer using the command line:
-
Write the Ubuntu ISO to the USB Drive:
-
Open Terminal.
-
Convert the ISO to a raw image:
hdiutil convert -format UDRW -o ~/Downloads/ubuntu.img ~/Downloads/ubuntu-24.04.3-desktop-amd64.iso
-
Identify your USB drive:
diskutil list
-
Unmount the USB drive:
diskutil unmountDisk /dev/diskN
Replace
Nwith your USB drive's disk number. -
Write the image to the USB drive:
sudo dd if=~/Downloads/ubuntu.img.dmg of=/dev/rdiskN bs=1mReplace
Nwith your USB drive's disk number. -
Eject the USB drive:
diskutil eject /dev/diskN
-
-
Add a Shared Storage Partition:
- Follow the steps in the GParted section above to add an ExFAT partition for shared storage.
This method requires careful attention to disk identifiers to avoid overwriting important data.
If you need further assistance or have specific requirements, feel free to ask!