Skip to content

Instantly share code, notes, and snippets.

@pdcastro
Last active December 29, 2018 16:40
Show Gist options
  • Save pdcastro/7b5d3cf05b25bb79ddb77dd09b842644 to your computer and use it in GitHub Desktop.
Save pdcastro/7b5d3cf05b25bb79ddb77dd09b842644 to your computer and use it in GitHub Desktop.
Manually deleting a partition table in a NUC device

About

These instructions were written in response to a specific support request for the installation of balenaOS on an Intel NUC device. These steps are not normally required. The standard balenaOS installation instructions for the NUC can be found at: https://www.balena.io/docs/learn/getting-started/intel-nuc/nodejs/

Steps to manually delete the partition table in a NUC device using the parted command-line tool

Note: scroll down for the screenshots!

  • Download an amd64 Ubuntu installer ISO image file. I've chosen the small (67MB instead of 2GB) "mini.iso" network installer from: http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/netboot/
    Note: this small network installer needs to download a few rescue packages (including 'parted') after it boots, so your NUC would need internet access. An ethernet cable saves the trouble of configuring WiFi. If this is an issue, download the full installer image instead of the network installer.

  • Use balenaEtcher to write the ISO file you've downloaded to the USB stick: https://www.balena.io/etcher/

  • Plug the USB stick to the NUC, power it on and press F10 to enter the boot menu. Select the UEFI:USB partition -- here I got two of those, Part 0 and Part 1, and I selected Part 0. Screenshot: step00.jpg.

  • The next screen will be the GRUB menu for the Ubuntu installer. Select "Rescue mode". Screenshot: step01.jpg.

  • Follow the installer instructions, including network setup if you chose a network installer. Eventually, it will ask you to select the "device to use as root file system". Select "Do not use a root file system". Screenshot: step02.jpg.

  • Select "Execute a shell in the installer environment". Screenshot: step03.jpg.

  • On the rescue shell, type parted -l (that's lowercase L, not number one) to list the partition tables of all disks. Here, parted complained that the partition table of my USB stick was invalid and asked me if I wanted to Ignore or Cancel. I selected Cancel and parted proceeded to list the partition table of the internal hard disk, which is what we are interested in. Screenshot: step04.jpg.

  • Here, parted listed my hard disk device name as /dev/nvme0n1, so the next command to run was parted /dev/nvme0n1. If your disk has a different name, replace it accordingly. Screenshot: step04.jpg.

  • Now we are in parted's command prompt. Run print to print your existing partition table. Check the line that shows the partition table type, something like Partition Table: msdos or Partition Table: gpt. Screenshot: step05.jpg

  • Still in parted's command prompt, type mklabel gpt or mklabel msdos - I recommend using the same partition type listed by the print command. Screenshot: step05.jpg.

  • Now type quit to quit parted and exit to exit the rescue shell. You will be brought back to the installer menu. Remove the USB stick and then select "Reboot the system". Screenshot: step06.jpg.

  • Press F10 during boot to enter the NUC's firmware boot menu. You should no longer see the Windows Boot Manager partition. In the unlikely event you still see a Windows partition, repeat parted's mklabel command using a different partition table type: gpt instead of msdos, or msdos instead of gpt.

  • Now follow the standard steps to install balenaOS: https://www.balena.io/docs/learn/getting-started/intel-nuc/nodejs/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment