Chasing AOSP: How to Install Ubuntu 18.04 on sda

After several attempts—and a fair share of trial and error—installing Ubuntu 18.04 on Docker and other platforms, I eventually gave up and opted to install the older OS directly on my System76 Galago Pro laptop. However, because AOSP recommends using legacy Ubuntu 18.04, I couldn’t completely abandon the idea of setting it up on my desktop machine instead.

This time, I decided to install the OS on an HDD and even created a swappable storage area. Here’s how I approached it.

sda           8:0    0   3.6T  0 disk 
├─sda1        8:1    0     2T  0 part /mnt/seagate/part1_2T
├─sda2        8:2    0     1T  0 part /mnt/seagate/part2_1T
└─sda3        8:3    0   654G  0 part /mnt/seagate/part3_600G

Step-by-Step:

  1. Download Ubuntu 18.04 ISO
  2. Create a Bootable USB
    • Use balenaEtcher, Rufus, or dd to flash the ISO to a USB stick.
  3. Boot From USB
    • Reboot and press F12, ESC, or DEL (depends on your machine) to enter the boot menu.
  4. Start Ubuntu Installer
  5. Partition Selection
    • When prompted during installation, choose:
      • “Something Else” (manual partitioning)
      • Then select /dev/sda or /dev/sda3
      • Format it to ext4
      • Mount point /
  6. Install the Bootloader
    • Point GRUB to install on /dev/sda or your current EFI /dev/nvme0n1p1 if you want to dual-boot.

STEP-BY-STEP INSTALL

Open Terminal and Confirm Target Disk

lsblk

You should see /dev/sda (3.6T). Double check this is the correct target!

Wipe the Disk

This will zero out the partition table.

sudo wipefs -a /dev/sda
sudo dd if=/dev/zero of=/dev/sda bs=1M count=100

Tips

sudo wipefs -a /dev/sda

sudo wipefs -a /dev/sda will delete the current partitioning and filesystem signatures from the entire disk /dev/sda.

🔥 What it does:

  • Removes partition table signatures (like GPT or MBR).
  • Removes filesystem signatures (e.g., ext4, ntfs, etc.).
  • It does not zero out all data, but it effectively makes the disk look empty to the OS.

🧨 WARNING:

Once executed, your OS will no longer recognize any partitions or data on /dev/sda. This is irreversible unless you use advanced data recovery tools — and even then, it’s not guaranteed.

✅ Safe Use Case:

Use wipefs -a when:

  • You want to start fresh on a disk.
  • You’re going to create new partitions and install a new OS (like Ubuntu 18.04 in your case).

🛡️ If you want to preview what it will erase:

sudo wipefs /dev/sda

This shows existing signatures without deleting them.

Create New GPT Partition Table

sudo parted /dev/sda --script mklabel gpt

Create Partitions (Root + Swap)

Create 100GB root (ext4)

sudo parted -a opt /dev/sda --script mkpart primary ext4 0% 1000GB

Create 8GB swap

sudo parted -a opt /dev/sda --script mkpart primary linux-swap 1000GB 1016GB

Create /home with remaining space

sudo parted -a opt /dev/sda --script mkpart primary ext4 1016GB 100%

Format the Partitions

# Replace with actual partition numbers (check with lsblk if unsure)
sudo mkfs.ext4 /dev/sda1   # root
sudo mkswap /dev/sda2      # swap
sudo mkfs.ext4 /dev/sda3   # /aosp or data

Mount and test them

# Make mount points
sudo mkdir /mnt/root_disk
sudo mkdir /mnt/aosp_data

# Mount the partitions
sudo mount /dev/sda1 /mnt/root_disk
sudo mount /dev/sda3 /mnt/aosp_data

# Activate swap
sudo swapon /dev/sda2

Check with

df -h
free -h

Launch Ubuntu 18.04 Installer

ubiquity

If you’re in the Live USB GUI, just click “Install Ubuntu” from the desktop instead.

In Installer → Choose “Something Else”

DeviceMount PointUse asFormat
/dev/sda1/ext4✔️ Yes
/dev/sda2swapswap✔️ Yes
/dev/sda3/homeext4✔️ Yes

Set the bootloader installation to: /dev/sda

This is where you must choose “Something else”.

You’ll see the list of sdb drives.

Choose “Ext4 journaling file system” to format the disks.

The mount point must be root.

Press “Continue”.

When booting Ubuntu 18.04, set the Hard Disk as the primary booting disk in BIOS.

Reboot

Once installed, reboot and remove the USB.

Your system should now boot into Ubuntu 18.04 from your freshly wiped 3.6TB disk 🎉

Leave a Reply

Your email address will not be published. Required fields are marked *