Skip to content

Instantly share code, notes, and snippets.

@rhysyngsun
Last active March 2, 2020 21:14
Show Gist options
  • Save rhysyngsun/600a302531f37921148c12f1f4f4d1e8 to your computer and use it in GitHub Desktop.
Save rhysyngsun/600a302531f37921148c12f1f4f4d1e8 to your computer and use it in GitHub Desktop.
Setup steps for a new laptop

These are instructions that are known to work with a Dell Latitude 7400 running Windows 10. This assumes you have completed windows setup.

Dual Boot Windows/Ubuntu

Disable Secure Boot

  • Restart, tapping F2 until you get into BIOS
  • Go into the Secure Boot menu option and disable it
  • Save and Exit

Shrink the Windows parition

We ned to shrink the windows partition so we can setup parition(s) for Ubuntu.

  • Go to Start menu, search for "Disk Management"
  • Right click on the C:\ partion, select "Shrink Volume"
  • Specify the amount to shrink by (note this is not the final size, final size is computed at the bottom of the dialog)
  • Click "Shrink" and close the Disk Management window

Enable AHCI mode for SATA

This is needed so Ubuntu can read the hard drive device, which is required both for the OS you're about to install and for the live USB to see the drive in order to install your OS in the first place. Dell factory installs of Windows are configured to use RAID. We need to reconfigure Windows to boot w/ AHCI by booting it in safe mode first, this causes Windows to load the AHCI drivers, whereas under normal boot mode it will error on boot.

  • In Windows, open the start menu, search for "Command Prompt", right click on it and select "Run as Administrator"
  • Run bcdedit /set {current} safeboot minimal (this )
  • Reboot, tapping F2 at startup to enter BIOS
  • Got to Settings > System Configuration > SATA Operation
  • Switch mode to AHCI
  • Press "Apply", then "Exit", wait for windows to boot in safe mode
  • Open Command Prompt as administrator again, run bcdedit /deletevalue {current} safeboot
  • Reboot, windows should now boot using AHCI

Install Ubuntu

Now we install Ubuntu on the free space

  • Reboot, tapping F12 until you see the boot menu
  • Select the Ubuntu live USB
    • Sometimes the USB device does not show up as a boot option, if this happens, try continuing to boot windows, then restart again, it should appear on the second attempt
  • Configure Ubunto language, locale, etc as you wish
  • When you get to "Installation Type", select "Something else"
  • Create a system partition
    • Select the available free space and click +
    • Configure with a minimum of 15GB (I went with 25GB), Logical, Beginning of this space, ext4, and / as the mount point.
  • Create a swap partition
    • Select the available free space and click +
    • Configure with 2x your system memory, Logical, Beginning of this space, and swap
  • Create a home partition
    • Select the available free space and click +
    • Configure with the rest of the free space, Logical, Beginning of this space, ext4, and /home as the mount point.
  • Click "Install Now"
  • On restart, you should get the GRUB boot menu and be able to boot into both Windows and Ubuntu
Troubleshooting

Issues that had to be addressed post-install:

Frozen on purple boot screen

Under Ubuntu 18.04, after applying upgrades via apt, Ubuntu refused to start and froze on the purple boot screen.

  • This is a known bug in GRUB: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1831789
  • Verify you're seeing the same issue:
    • Restart the computer, but boot Ubuntu in safe mode
    • Confirm it gets stuck on Loading initial ramdisk...
  • We need to boot into Ubuntu to fix grub, so temporarily add the value to the boot options:
  • Restart the computer again, when it gets to the GRUB boot menu, enter e
  • Scroll down to the linux entry, and insert dis_ucode_ldr into the line after ro, but before quiet and/or splash
  • Press F10, Ubuntu should boot successfully
  • We now need to add this option permanently:
    • Open Terminal, type sudo nano /etc/default grub, prepend dis_ucode_ldr to the GRUB_CMDLINE_LINUX_DEFAULT value, save and quit.
    • Run sudo update-grub
    • Reboot
  • Ubuntu should now boot successfully

Docker setup

Since we setup multiple partitions for the system and data, we need to move docker's data directory off the system partition because it will very quickly fill it up.

Follow these instructions: https://linuxconfig.org/how-to-move-docker-s-default-var-lib-docker-to-another-directory-on-ubuntu-debian-linux

I moved the directory into /home/docker/var/lib/docker

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