Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save oriondream/fcaf59e4da99acd9fe09e31bf2c65a3b to your computer and use it in GitHub Desktop.

Select an option

Save oriondream/fcaf59e4da99acd9fe09e31bf2c65a3b to your computer and use it in GitHub Desktop.

Revisions

  1. @luispabon luispabon revised this gist May 11, 2022. 1 changed file with 35 additions and 22 deletions.
    57 changes: 35 additions & 22 deletions xps_15_9560__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -59,21 +59,31 @@ You'll need to boot first into a ubuntu installation disk (to use gparted to par
    1. Boot into ubuntu live cd session
    2. Open gparted, create a single ext4 partition with unallocated space. This will be for lvm/luks. The filesystem does not matter, we simply need to create a partition here so that it's allocated a device node and shows in `/dev`).
    3. Create LUKS container on this partition (assuming the partition device is `/dev/nvme0n1p5`):
    a. `sudo cryptsetup luksFormat /dev/nvme0n1p5` <-- `luksFormat` is case sensitive
    b. `sudo cryptsetup luksOpen /dev/nvme0n1p5 cryptdrive` <-- `luksOpen` is case sensitive
    c. `sudo dd if=/dev/zero of=/dev/mapper/cryptdrive bs=16M` <-- optional, this is to ensure nothing can be recovered from before this install you're doing. Took 2h on my 652 GiB partition.
    3. Create LVM physical volume, a volume group & logical volumes:

    ```shell
    # Note luksFormat and luksOpen are case sensitive
    ~ sudo cryptsetup luksFormat /dev/nvme0n1p5
    ~ sudo cryptsetup luksOpen /dev/nvme0n1p5 cryptdrive

    # Optional, rewrite the whole of cryptdrive with crap to ensure no data from before partitioning remains. Took 2h on my 652 GiB partition on an nvme drive
    ~ sudo dd if=/dev/zero of=/dev/mapper/cryptdrive bs=16M
    ```

    4. Create LVM physical volume, a volume group & logical volumes:
    - Volumes are sized as follows (example, you should create as many partitions as you need):
    - OS drive: `60GB`
    - Swap: `16GB`
    - Home: `rest`
    - Commands (add extra lvcreate steps if you have more partitions):
    - `sudo pvcreate /dev/mapper/cryptdrive`
    - `sudo vgcreate vglinux /dev/mapper/cryptdrive`
    - `sudo lvcreate -n root -L 60g vglinux`
    - `sudo lvcreate -n swap -L 16g vglinux`
    - `sudo lvcreate -n home -l 100%FREE vglinux`
    4. Start the installation process using GUI:

    ```shell
    ~ sudo pvcreate /dev/mapper/cryptdrive
    ~ sudo vgcreate vglinux /dev/mapper/cryptdrive
    ~ sudo lvcreate -n root -L 60g vglinux
    ~ sudo lvcreate -n swap -L 16g vglinux
    ~ sudo lvcreate -n home -l 100%FREE vglinux
    ```
    5. Start the installation process using GUI:
    - Connect to WiFi network
    - When asked what to do with the disk, pick the option that allows you to manually repartition stuff (IIRC it was labelled `Something else` on 19.04 installer):
    - Pick `/dev/mapper/vglinux-root` as `ext4` FS & mount it to `/`
    @@ -84,20 +94,23 @@ You'll need to boot first into a ubuntu installation disk (to use gparted to par
    - Without doing this, installation will fail when configuring GRUB
    - Pick "boot drive" (the select list at the bottom, this is where GRUB goes) and assign it to `/dev/nvme0n1p2` or `/dev/nvem0n1`
    - Proceed with the installation
    5. After GUI installation completes, stay within the Live USB environment
    6. Check the UUID of the LUKS drive:
    6. After GUI installation completes, stay within the Live USB environment
    7. Check the UUID of the LUKS drive:
    - `sudo blkid /dev/nvme0n1p5`
    - Example output:
    - `/dev/nvme0n1p5: UUID="abcdefgh-1234-5678-9012-abcdefghijklm" TYPE="crypto_LUKS"`
    7. Mount root & boot drives and chroot into the main mount:
    - `sudo mount /dev/mapper/vglinux-root /mnt`
    - `sudo mount /dev/nvme0n1p2 /mnt/boot`
    - `sudo mount --bind /dev /mnt/dev`
    - `sudo chroot /mnt`
    - `mount -t proc proc /proc`
    - `mount -t sysfs sys /sys`
    - `mount -t devpts devpts /dev/pts`
    8. In chroot env, configure `crypttab` allowing to boot Ubuntu with Encryption unlocker
    8. Mount root & boot drives and chroot into the main mount:
    ```shell
    ~ sudo mount /dev/mapper/vglinux-root /mnt
    ~ sudo mount /dev/nvme0n1p2 /mnt/boot
    ~ sudo mount --bind /dev /mnt/dev
    ~ sudo chroot /mnt
    ~ mount -t proc proc /proc
    ~ mount -t sysfs sys /sys
    ~ mount -t devpts devpts /dev/pts
    ```

    9. In chroot env, configure `crypttab` allowing to boot Ubuntu with Encryption unlocker
    - `sudo nano /etc/crypttab`:
    ```
    # <target name> <source device> <key file> <options>
    @@ -109,7 +122,7 @@ You'll need to boot first into a ubuntu installation disk (to use gparted to par
    cryptdrive UUID=abcdefgh-1234-5678-9012-abcdefghijklm none luks,tries=0,discard,loud
    ```
    - `update-initramfs -k all -c`
    9. Reboot into Ubuntu
    10. Reboot into Ubuntu

    # 5. Ubuntu Tweaks for XPS 9560
    1. XPS 9560 doesn't really need any workarounds or acpi boot options anymore with Ubuntu 19.04. Have a look https://github.com/stockmind/dell-xps-9560-ubuntu-respin if there's something that doesn't work. No need to download any firmware anymore for the killer wifi (always worked fine for me)
  2. @luispabon luispabon revised this gist Jun 16, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xps_15_9560__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    - Installation date: 16-08-2019
    - Additional notes based on my own experience
    - EFI boot
    - Ubuntu 19.04, 20.04, 20.10
    - Ubuntu 19.04 -> 21.04
    - This should work on any computer. Only the `RAID > AHCI` change described below and the device name for the nvme ssd drive are specific to this laptop.
    - The process describes a completely fresh installation with complete repartitioning,
    however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
  3. @luispabon luispabon revised this gist Jun 16, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xps_15_9560__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ You'll need to boot first into a ubuntu installation disk (to use gparted to par
    2. Create Ubuntu installation USB stick
    - Download .ISO file from Ubuntu's webpage
    - Create bootable USB using "whatever" (gnome disks or Startup Disk Creator utility)
    3. Go to BIOS (F2) and switch from SSD's "RAID mode" to "AHCI mode
    3. Go to BIOS (F2) and switch from SSD's "RAID" to "AHCI" mode on some laptop models (like XPS 9560)

    # 2. Partitioning

  4. @luispabon luispabon revised this gist Nov 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xps_15_9560__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    - Installation date: 16-08-2019
    - Additional notes based on my own experience
    - EFI boot
    - Ubuntu 19.04
    - Ubuntu 19.04, 20.04, 20.10
    - This should work on any computer. Only the `RAID > AHCI` change described below and the device name for the nvme ssd drive are specific to this laptop.
    - The process describes a completely fresh installation with complete repartitioning,
    however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
  5. @luispabon luispabon revised this gist Nov 16, 2020. 1 changed file with 10 additions and 3 deletions.
    13 changes: 10 additions & 3 deletions xps_15_9560__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,10 @@
    - Suprisingly, Ubuntu's update manager supports BIOS updates out of the box (make sure you're connected to power then run `sudo fwupdmgr refresh; sudo fwupdmgr update`)
    - My installation did **not** require to disable TPM nor Secure Boot

    # Re-installation

    If you're re-installing your system and have no need to re-shuffle your partitions, you can jump directly to 4.3.b (the `luksOpen` command). Just make sure you re-format all your partitions except for EFI (and perhaps `/home`, if like myself you have one).

    # 1. Installation media

    You'll need to boot first into a ubuntu installation disk (to use gparted to partition your drive), then boot into the windows installation media (to install windows) then back again the ubuntu media (to install ubuntu). So you're going to need to prep either 2 different installation medias (eg usb sticks or DVDs or whatever), or you'll need a second computer to keep overwritting the same usb stick.
    @@ -29,6 +33,9 @@ You'll need to boot first into a ubuntu installation disk (to use gparted to par
    3. Go to BIOS (F2) and switch from SSD's "RAID mode" to "AHCI mode

    # 2. Partitioning

    **Important:** There's currently no easy way to make grub work with an encrypted partition. **Make sure `/boot` and `/boot/EFI` are their own partitions and left unencrypted.**

    1. Boot into an ubuntu live cd session
    2. Open gparted
    3. Delete all partitions on disk
    @@ -52,9 +59,9 @@ You'll need to boot first into a ubuntu installation disk (to use gparted to par
    1. Boot into ubuntu live cd session
    2. Open gparted, create a single ext4 partition with unallocated space. This will be for lvm/luks. The filesystem does not matter, we simply need to create a partition here so that it's allocated a device node and shows in `/dev`).
    3. Create LUKS container on this partition (assuming the partition device is `/dev/nvme0n1p5`):
    - `sudo cryptsetup luksFormat /dev/nvme0n1p5` <-- `luksFormat` is case sensitive
    - `sudo cryptsetup luksOpen /dev/nvme0n1p5 cryptdrive` <-- `luksOpen` is case sensitive
    - `sudo dd if=/dev/zero of=/dev/mapper/cryptdrive bs=16M` <-- optional, this is to ensure nothing can be recovered from before this install you're doing. Took 2h on my 652 GiB partition.
    a. `sudo cryptsetup luksFormat /dev/nvme0n1p5` <-- `luksFormat` is case sensitive
    b. `sudo cryptsetup luksOpen /dev/nvme0n1p5 cryptdrive` <-- `luksOpen` is case sensitive
    c. `sudo dd if=/dev/zero of=/dev/mapper/cryptdrive bs=16M` <-- optional, this is to ensure nothing can be recovered from before this install you're doing. Took 2h on my 652 GiB partition.
    3. Create LVM physical volume, a volume group & logical volumes:
    - Volumes are sized as follows (example, you should create as many partitions as you need):
    - OS drive: `60GB`
  6. @luispabon luispabon revised this gist Mar 19, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xps_15_9560__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -73,7 +73,7 @@ You'll need to boot first into a ubuntu installation disk (to use gparted to par
    - Pick `/dev/mapper/vglinux-home` as `ext4` FS & mount it to `/home`
    - Pick `/dev/mapper/vglinux-swap` as `swap`
    - Do the same as above if you have extra partitions
    - Pick `/dev/nvme0n1p2` (created on step 2.4.1) as `ext4` FS & mount it to `/boot`
    - Pick `/dev/nvme0n1p2` (created on step 2.5.1) as `ext4` FS & mount it to `/boot`
    - Without doing this, installation will fail when configuring GRUB
    - Pick "boot drive" (the select list at the bottom, this is where GRUB goes) and assign it to `/dev/nvme0n1p2` or `/dev/nvem0n1`
    - Proceed with the installation
  7. @luispabon luispabon revised this gist Sep 3, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions xps_15_9560__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -109,6 +109,8 @@ You'll need to boot first into a ubuntu installation disk (to use gparted to par
    2. Install nvidia drivers (latest available in 19.04)
    3. Undervolt? https://github.com/georgewhewell/undervolt I have a systemd service to run `undervolt.py --core -125 --cache -125 --gpu -100`, helps a little with power consumption and temps, especially under heavy load (around 8-10 deg C).
    # 6. Reinstall Ubuntu
    If you need to reinstall ubuntu, you should be able to jump to #4 directly. If you aren't changing your partition layout, you can go straight to #4.4 (install ubuntu), but don't forget to run `sudo cryptsetup luksOpen /dev/nvme0n1p5 cryptdrive` to mount the encrypted partition. If in doubt, just start from #4 and recreate your crypt drive.
    # Additional notes
    - Ubuntu (GRUB) is the default boot option, both Ubuntu and Windows should be there
  8. @luispabon luispabon revised this gist Sep 3, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions xps_15_9560__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -92,15 +92,15 @@ You'll need to boot first into a ubuntu installation disk (to use gparted to par
    - `mount -t devpts devpts /dev/pts`
    8. In chroot env, configure `crypttab` allowing to boot Ubuntu with Encryption unlocker
    - `sudo nano /etc/crypttab`:
    ``
    ```
    # <target name> <source device> <key file> <options>
    # options used:
    # luks - specifies that this is a LUKS encrypted device
    # tries=0 - allows to re-enter password unlimited number of times
    # discard - allows SSD TRIM command, WARNING: potential security risk (more: "man crypttab")
    # loud - display all warnings
    cryptdrive UUID=abcdefgh-1234-5678-9012-abcdefghijklm none luks,tries=0,discard,loud
    ``
    ```
    - `update-initramfs -k all -c`
    9. Reboot into Ubuntu
  9. @luispabon luispabon revised this gist Sep 3, 2019. 1 changed file with 54 additions and 68 deletions.
    122 changes: 54 additions & 68 deletions xps_15_9560__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -3,127 +3,113 @@
    - Additional notes based on my own experience
    - EFI boot
    - Ubuntu 19.04
    - This should work on any computer. Only the `RAID > AHCI` change described below and the device name for the nvme ssd drive are specific to this laptop.
    - The process describes a completely fresh installation with complete repartitioning,
    however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled).
    however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
    - The process was conducted on Dell's XPS 15 9560 (2017) with specs:
    - CPU: i7-7700HQ
    - Screen: 4K with Touch
    - RAM: 32 GB
    - Drive: 1TB
    - Drive: 1TB nvme ssd
    - Windows 10 Pro license
    - BIOS version: 1.3.1
    - Suprisingly, Ubuntu's update manager supports BIOS updates out of the box
    - BIOS version: 1.16.0
    - Suprisingly, Ubuntu's update manager supports BIOS updates out of the box (make sure you're connected to power then run `sudo fwupdmgr refresh; sudo fwupdmgr update`)
    - My installation did **not** require to disable TPM nor Secure Boot

    # 1. Preparation (using another computer with Ubuntu)
    # 1. Installation media

    You'll need to boot first into a ubuntu installation disk (to use gparted to partition your drive), then boot into the windows installation media (to install windows) then back again the ubuntu media (to install ubuntu). So you're going to need to prep either 2 different installation medias (eg usb sticks or DVDs or whatever), or you'll need a second computer to keep overwritting the same usb stick.

    1. Create Windows installation USB stick
    - Download .ISO file from Microsoft's webpage
    - Create bootable USB using ``WoeUSB``
    - Ubuntu has an option to "restore" ISO images using ``Disks`` utility, but it does not work correctly
    (Windows installer asks for additional drivers)
    - I also had to compile ``WoeUSB`` because of some weird bug in the default Ubuntu's (PPA's) supplied package
    that would not let me finish the installation process
    - Create bootable USB using [WoeUSB](https://github.com/slacka/WoeUSB) - do not use Startup Disk Creator utility or the Disks app, won't work for Windows installation media)
    2. Create Ubuntu installation USB stick
    - Download .ISO file from Ubuntu's webpage
    - Create bootable USB using "whatever" (gnome disks)
    3. Go to BIOS (F2) and switch from SSD's "RAID mode" to "AHCI mode"
    - Create bootable USB using "whatever" (gnome disks or Startup Disk Creator utility)
    3. Go to BIOS (F2) and switch from SSD's "RAID mode" to "AHCI mode

    # 2. Partitioning
    1. Boot into an ubuntu live cd session
    2. Open gparted
    3. Delete all partitions on disk
    4. Create GPT partition table: `device` > `new partition table` > choose `GPT` (this is required for EFI)
    5. Create the following:
    1. 550MiB FAT32 (label EFI)
    1. 550MiB FAT32 (label EFI - label is for our own benefit, doesn't actually mark this partition as EFI)
    2. 550MiB EXT4 (for Linux boot)
    3. Create your windows partitions as NTFS
    4. Leave enough unallocated space for Ubuntu and whatever partitions you'll need
    4. Leave enough unallocated space for Ubuntu. Don't create a partition here yet - Windows needs to automatically create an additional 16MiB partition during installation. Dunno what it is for tbh.
    6. Apply changes
    7. Right click on the FAT32 partition you created for EFI partition above > `manage flags`. Set `esp` (`boot` might auto-check itself too). This will mark the partition to use as EFI by both Windows and Ubuntu installations. You might need to apply changes again.

    # 3. Install Windows

    1. Boot from the windows usb pendrive
    2. Install Windows on whatever partition you created earlier
    3. Boot to Windows after installation, install all updates
    4. Enable BitLocker on "Windows data drive" ("Windows OS drive" was already encrypted)
    5. Create recovery data for both Bitlocker-protected drives and store them somewhere (eg. additional USB)
    3. Windows is done at this point - you could go in and setup windows (encryption, drivers, etc) but I'd recommend to set up ubuntu first - the process, if done wrong, can potentially bork your set up and you'll need to start again.

    # 4. Install Ubuntu

    1. Boot into ubuntu live cd session
    2. Open gparted, create an ext4 partition with unallocated space (this will be for lvm/luks, we need something here first so that it shows in `/dev`).
    3. Create LUKS container on this partition (assuming the partition dev is `/dev/nvme0n1p7`):
    - ``sudo cryptsetup luksFormat /dev/nvme0n1p7``
    - ``sudo cryptsetup luksOpen /dev/nvme0n1p7 cryptdrive``
    - ``sudo dd if=/dev/zero of=/dev/mapper/cryptdrive bs=16M`` <-- extra paranoid, optional
    2. Open gparted, create a single ext4 partition with unallocated space. This will be for lvm/luks. The filesystem does not matter, we simply need to create a partition here so that it's allocated a device node and shows in `/dev`).
    3. Create LUKS container on this partition (assuming the partition device is `/dev/nvme0n1p5`):
    - `sudo cryptsetup luksFormat /dev/nvme0n1p5` <-- `luksFormat` is case sensitive
    - `sudo cryptsetup luksOpen /dev/nvme0n1p5 cryptdrive` <-- `luksOpen` is case sensitive
    - `sudo dd if=/dev/zero of=/dev/mapper/cryptdrive bs=16M` <-- optional, this is to ensure nothing can be recovered from before this install you're doing. Took 2h on my 652 GiB partition.
    3. Create LVM physical volume, a volume group & logical volumes:
    - Volumes are sized as follows (example):
    - OS drive: ``60GB``
    - Swap: ``16GB``
    - Home: ``rest``
    - Volumes are sized as follows (example, you should create as many partitions as you need):
    - OS drive: `60GB`
    - Swap: `16GB`
    - Home: `rest`
    - Commands (add extra lvcreate steps if you have more partitions):
    - ``sudo pvcreate /dev/mapper/cryptdrive``
    - ``sudo vgcreate vglinux /dev/mapper/cryptdrive``
    - ``sudo lvcreate -n root -L 60g vglinux``
    - ``sudo lvcreate -n swap -L 16g vglinux``
    - ``sudo lvcreate -n home -l 100%FREE vglinux``
    - `sudo pvcreate /dev/mapper/cryptdrive`
    - `sudo vgcreate vglinux /dev/mapper/cryptdrive`
    - `sudo lvcreate -n root -L 60g vglinux`
    - `sudo lvcreate -n swap -L 16g vglinux`
    - `sudo lvcreate -n home -l 100%FREE vglinux`
    4. Start the installation process using GUI:
    - Connect to WiFi network
    - Installation options:
    - Pick "minimal installation"
    - Pick "install updates during installation"
    - Pick "install 3rd party drivers" (no need to "reset Secure Boot password")
    - Pick "custom installation process" (the one which lets you repartition stuff... might actually be labelled "Something else?")
    - Pick ``/dev/mapper/vglinux-root`` as ``ext4`` FS & mount it to ``/``
    - Pick ``/dev/mapper/vglinux-home`` as ``ext4`` FS & mount it to ``/home``
    - Pick ``/dev/mapper/vglinux-swap`` as ``swap``
    - When asked what to do with the disk, pick the option that allows you to manually repartition stuff (IIRC it was labelled `Something else` on 19.04 installer):
    - Pick `/dev/mapper/vglinux-root` as `ext4` FS & mount it to `/`
    - Pick `/dev/mapper/vglinux-home` as `ext4` FS & mount it to `/home`
    - Pick `/dev/mapper/vglinux-swap` as `swap`
    - Do the same as above if you have extra partitions
    - Pick ``/dev/nvm0n1p1`` (created on step 2.4.1) as ``ext4`` FS & mount it to ``/boot``
    - Pick `/dev/nvme0n1p2` (created on step 2.4.1) as `ext4` FS & mount it to `/boot`
    - Without doing this, installation will fail when configuring GRUB
    - Pick "boot drive" (the select list at the bottom) and assign it to ``/dev/nvm0n1p1``
    - Pick "boot drive" (the select list at the bottom, this is where GRUB goes) and assign it to `/dev/nvme0n1p2` or `/dev/nvem0n1`
    - Proceed with the installation
    5. After GUI installation completes, stay within the Live USB environment
    6. Check the UUID of the LUKS drive:
    - ``sudo blkid /dev/nvme0n1p7``
    - `sudo blkid /dev/nvme0n1p5`
    - Example output:
    - ``/dev/nvme0n1p7: UUID="abcdefgh-1234-5678-9012-abcdefghijklm" TYPE="crypto_LUKS"``
    - `/dev/nvme0n1p5: UUID="abcdefgh-1234-5678-9012-abcdefghijklm" TYPE="crypto_LUKS"`
    7. Mount root & boot drives and chroot into the main mount:
    - ``sudo mount /dev/mapper/vglinux-root /mnt``
    - ``sudo mount /dev/nvme0n1p1 /mnt/boot``
    - ``sudo mount --bind /dev /mnt/dev``
    - ``sudo chroot /mnt``
    - ``mount -t proc proc /proc``
    - ``mount -t sysfs sys /sys``
    - ``mount -t devpts devpts /dev/pts``
    8. In chroot env, configure ``crypttab`` allowing to boot Ubuntu with Encryption unlocker
    - ``sudo nano /etc/crypttab``:
    ```
    - `sudo mount /dev/mapper/vglinux-root /mnt`
    - `sudo mount /dev/nvme0n1p2 /mnt/boot`
    - `sudo mount --bind /dev /mnt/dev`
    - `sudo chroot /mnt`
    - `mount -t proc proc /proc`
    - `mount -t sysfs sys /sys`
    - `mount -t devpts devpts /dev/pts`
    8. In chroot env, configure `crypttab` allowing to boot Ubuntu with Encryption unlocker
    - `sudo nano /etc/crypttab`:
    ``
    # <target name> <source device> <key file> <options>
    # options used:
    # luks - specifies that this is a LUKS encrypted device
    # tries=0 - allows to re-enter password unlimited number of times
    # discard - allows SSD TRIM command, WARNING: potential security risk (more: "man crypttab")
    # loud - display all warnings
    cryptdrive UUID=abcdefgh-1234-5678-9012-abcdefghijklm none luks,tries=0,discard,loud
    ```
    - ``update-initramfs -k all -c``
    ``
    - `update-initramfs -k all -c`
    9. Reboot into Ubuntu

    # 5. Ubuntu Tweaks
    # 5. Ubuntu Tweaks for XPS 9560
    1. XPS 9560 doesn't really need any workarounds or acpi boot options anymore with Ubuntu 19.04. Have a look https://github.com/stockmind/dell-xps-9560-ubuntu-respin if there's something that doesn't work. No need to download any firmware anymore for the killer wifi (always worked fine for me)
    2. Install nvidia drivers (latest available in 19.04)
    3. Undervolt? https://github.com/georgewhewell/undervolt I have a systemd service to run `undervolt.py --core -150 --cache -150 --gpu -100`, helps a little with power consumption and temps.
    4. I don't feel tlp does anything on this laptop anymore
    3. Undervolt? https://github.com/georgewhewell/undervolt I have a systemd service to run `undervolt.py --core -125 --cache -125 --gpu -100`, helps a little with power consumption and temps, especially under heavy load (around 8-10 deg C).


    # Additional notes
    - Switching between OSes:
    - Ubuntu (GRUB) is the default boot option
    - Windows can be accessed using F12's boot option menu
    - It can also be accessed using GRUB's menu, however, then it prompts me to use the BitLocker's recovery key
    - Cancelling the recovery and using F12 -> Windows Boot Manager trick did not prompt to use recovery key again...
    - Both, when installing Ubuntu, and sometimes when rebooting installed Ubuntu, "poweroff" or "reboot" results in prolonged shutdown with locked up display.
    - Fixed with ``dell-xps-9570-ubuntu-respin`` tweak script
    - About BIOS upgrade:
    - An upgrade from 1.3.0 to 1.3.1 required to swap RAM sticks to the original ones again, because the machine would not boot with white & amber LED flashes (supposedly indicating "memory problem"). After booting just once with the original sticks, I've swapped to the 2x16GB sticks again without a problem.
    - Ubuntu (GRUB) is the default boot option, both Ubuntu and Windows should be there
    - Additionally, you can bring up the EFI boot screen pressing F12 as soon as you turn on the laptop
  10. @luispabon luispabon revised this gist Sep 3, 2019. No changes.
  11. @luispabon luispabon revised this gist Sep 3, 2019. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions xps_15_9560__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    - Additional notes based on my own experience
    - EFI boot
    - Ubuntu 19.04
    - The process describes a completely fresh installation with a complete repartitioning,
    - The process describes a completely fresh installation with complete repartitioning,
    however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled).
    - The process was conducted on Dell's XPS 15 9560 (2017) with specs:
    - CPU: i7-7700HQ
    @@ -14,9 +14,6 @@
    - BIOS version: 1.3.1
    - Suprisingly, Ubuntu's update manager supports BIOS updates out of the box
    - My installation did **not** require to disable TPM nor Secure Boot
    - My installation did not force me to recover Bitlocker after Ubuntu's installation
    - Some people report that it was needed in their case
    - See "Additional notes" for more info about GRUB & Booting into Windows

    # 1. Preparation (using another computer with Ubuntu)

    @@ -36,7 +33,8 @@
    1. Boot into an ubuntu live cd session
    2. Open gparted
    3. Delete all partitions on disk
    4. Create the following:
    4. Create GPT partition table: `device` > `new partition table` > choose `GPT` (this is required for EFI)
    5. Create the following:
    1. 550MiB FAT32 (label EFI)
    2. 550MiB EXT4 (for Linux boot)
    3. Create your windows partitions as NTFS
  12. @luispabon luispabon revised this gist Aug 16, 2019. No changes.
  13. @luispabon luispabon revised this gist Aug 16, 2019. No changes.
  14. @luispabon luispabon renamed this gist Aug 16, 2019. 1 changed file with 42 additions and 53 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,23 @@
    - Based on https://askubuntu.com/a/293029/286776
    - Installation date: 15-09-2018
    - Based on https://gist.github.com/mdziekon/221bdb597cf32b46c50ffab96dbec08a
    - Installation date: 16-08-2019
    - Additional notes based on my own experience
    - EFI boot
    - Ubuntu 19.04
    - The process describes a completely fresh installation with a complete repartitioning,
    however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled).
    - The process was conducted on Dell's XPS 15 9570 (2018) with specs:
    - CPU: i7-8750H
    - The process was conducted on Dell's XPS 15 9560 (2017) with specs:
    - CPU: i7-7700HQ
    - Screen: 4K with Touch
    - RAM: 16 GB (original) / 32 GB (manually upgraded)
    - Drive: 512 GB (SK Hynix PC401)
    - RAM: 32 GB
    - Drive: 1TB
    - Windows 10 Pro license
    - BIOS version: 1.3.1
    - Suprisingly, Ubuntu's update manager supports BIOS updates out of the box
    - My installation did **not** require to disable TPM nor Secure Boot
    - My installation did not force me to recover Bitlocker after Ubuntu's installation
    - Some people report that it was needed in their case
    - See "Additional notes" for more info about GRUB & Booting into Windows

    # 1. Preparation (using another computer with Ubuntu)

    1. Create Windows installation USB stick
    @@ -27,43 +29,41 @@
    that would not let me finish the installation process
    2. Create Ubuntu installation USB stick
    - Download .ISO file from Ubuntu's webpage
    - Create bootable USB using "whatever"
    - Create bootable USB using "whatever" (gnome disks)
    3. Go to BIOS (F2) and switch from SSD's "RAID mode" to "AHCI mode"

    # 2. Install Windows
    # 2. Partitioning
    1. Boot into an ubuntu live cd session
    2. Open gparted
    3. Delete all partitions on disk
    4. Create the following:
    1. 550MiB FAT32 (label EFI)
    2. 550MiB EXT4 (for Linux boot)
    3. Create your windows partitions as NTFS
    4. Leave enough unallocated space for Ubuntu and whatever partitions you'll need

    # 3. Install Windows

    1. Insert newly created bootable USB and start the installation process
    2. Re-partition your drive
    - My partitioning scheme (devices might have be labeled differently!):
    1. Boot drive for Linux: ``1GB``
    - ``/dev/nvme0n1p1``
    2. Windows OS drive: ``~75GB``
    - ``/dev/nvme0n1p5``
    - Will automatically create additional drives **before** the actual OS drive
    as soon as you create the first "regular" partition
    3. Windows data drive: ``~100GB``
    - ``/dev/nvme0n1p6``
    4. Ubuntu LUKS drive: ``~300GB``
    - ``/dev/nvme0n1p7``
    - Can be created later
    3. Install Windows on the "Windows OS drive"
    4. Boot to Windows after installation, install all updates
    5. Enable BitLocker on "Windows data drive" ("Windows OS drive" was already encrypted)
    6. Create recovery data for both Bitlocker-protected drives and store them somewhere (eg. additional USB)
    1. Boot from the windows usb pendrive
    2. Install Windows on whatever partition you created earlier
    3. Boot to Windows after installation, install all updates
    4. Enable BitLocker on "Windows data drive" ("Windows OS drive" was already encrypted)
    5. Create recovery data for both Bitlocker-protected drives and store them somewhere (eg. additional USB)

    # 3. Install Ubuntu
    # 4. Install Ubuntu

    1. Insert newly created bootable USB and start the installation process
    2. Create LUKS container on "Ubuntu LUKS drive" and "wipe it":
    1. Boot into ubuntu live cd session
    2. Open gparted, create an ext4 partition with unallocated space (this will be for lvm/luks, we need something here first so that it shows in `/dev`).
    3. Create LUKS container on this partition (assuming the partition dev is `/dev/nvme0n1p7`):
    - ``sudo cryptsetup luksFormat /dev/nvme0n1p7``
    - ``sudo cryptsetup luksOpen /dev/nvme0n1p7 cryptdrive``
    - ``sudo dd if=/dev/zero of=/dev/mapper/cryptdrive bs=16M``
    - ``sudo dd if=/dev/zero of=/dev/mapper/cryptdrive bs=16M`` <-- extra paranoid, optional
    3. Create LVM physical volume, a volume group & logical volumes:
    - Volumes are sized as follows:
    - Volumes are sized as follows (example):
    - OS drive: ``60GB``
    - Swap: ``16GB``
    - Home: ``rest``
    - Commands:
    - Commands (add extra lvcreate steps if you have more partitions):
    - ``sudo pvcreate /dev/mapper/cryptdrive``
    - ``sudo vgcreate vglinux /dev/mapper/cryptdrive``
    - ``sudo lvcreate -n root -L 60g vglinux``
    @@ -75,11 +75,12 @@
    - Pick "minimal installation"
    - Pick "install updates during installation"
    - Pick "install 3rd party drivers" (no need to "reset Secure Boot password")
    - Pick "custom installation process" (the one which lets you repartition stuff)
    - Pick "custom installation process" (the one which lets you repartition stuff... might actually be labelled "Something else?")
    - Pick ``/dev/mapper/vglinux-root`` as ``ext4`` FS & mount it to ``/``
    - Pick ``/dev/mapper/vglinux-home`` as ``ext4`` FS & mount it to ``/home``
    - Pick ``/dev/mapper/vglinux-swap`` as ``swap``
    - Pick ``/dev/nvm0n1p1`` as ``ext4`` FS & mount it to ``/boot``
    - Do the same as above if you have extra partitions
    - Pick ``/dev/nvm0n1p1`` (created on step 2.4.1) as ``ext4`` FS & mount it to ``/boot``
    - Without doing this, installation will fail when configuring GRUB
    - Pick "boot drive" (the select list at the bottom) and assign it to ``/dev/nvm0n1p1``
    - Proceed with the installation
    @@ -110,24 +111,12 @@
    - ``update-initramfs -k all -c``
    9. Reboot into Ubuntu
    # 4. Ubuntu Tweaks
    # 5. Ubuntu Tweaks
    1. XPS 9560 doesn't really need any workarounds or acpi boot options anymore with Ubuntu 19.04. Have a look https://github.com/stockmind/dell-xps-9560-ubuntu-respin if there's something that doesn't work. No need to download any firmware anymore for the killer wifi (always worked fine for me)
    2. Install nvidia drivers (latest available in 19.04)
    3. Undervolt? https://github.com/georgewhewell/undervolt I have a systemd service to run `undervolt.py --core -150 --cache -150 --gpu -100`, helps a little with power consumption and temps.
    4. I don't feel tlp does anything on this laptop anymore
    1. Run some of the [``dell-xps-9570-ubuntu-respin``](https://github.com/JackHack96/dell-xps-9570-ubuntu-respin) tweaks:
    - Main script is here: https://github.com/JackHack96/dell-xps-9570-ubuntu-respin/blob/master/xps-tweaks.sh
    - Modify the GRUB editting code to include ``splash`` option
    - Nvidia & WiFi card changes were not performed
    - Running this script yielded power consumption reduction from ~16W to ~7W (much closer to Windows) in Idle
    2. Additional packages (some might have been included in the Respin):
    - ``sudo apt-get install smbios-utils``
    3. More Tips & Tricks related to Thermals:
    - [``Some useful tips and tricks``](https://github.com/JackHack96/dell-xps-9570-ubuntu-respin/wiki/Some-useful-tips-and-tricks)
    - Switch to Battery-Mode on AC for better Thermals:
    ``sudo tlp bat``
    3. Enable right-mouse-click:
    - Follow these instructions: https://askubuntu.com/a/1029458/286776
    - Latest commit used: [``7486bc9b3bbf3aca26bd8ab48b39788a7f9392aa``](https://github.com/JackHack96/dell-xps-9570-ubuntu-respin/commit/7486bc9b3bbf3aca26bd8ab48b39788a7f9392aa)
    - Nvidia Drivers used: 390
    # Additional notes
    @@ -139,4 +128,4 @@
    - Both, when installing Ubuntu, and sometimes when rebooting installed Ubuntu, "poweroff" or "reboot" results in prolonged shutdown with locked up display.
    - Fixed with ``dell-xps-9570-ubuntu-respin`` tweak script
    - About BIOS upgrade:
    - An upgrade from 1.3.0 to 1.3.1 required to swap RAM sticks to the original ones again, because the machine would not boot with white & amber LED flashes (supposedly indicating "memory problem"). After booting just once with the original sticks, I've swapped to the 2x16GB sticks again without a problem.
    - An upgrade from 1.3.0 to 1.3.1 required to swap RAM sticks to the original ones again, because the machine would not boot with white & amber LED flashes (supposedly indicating "memory problem"). After booting just once with the original sticks, I've swapped to the 2x16GB sticks again without a problem.
  15. @mdziekon mdziekon revised this gist Nov 17, 2018. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -117,10 +117,12 @@
    - Modify the GRUB editting code to include ``splash`` option
    - Nvidia & WiFi card changes were not performed
    - Running this script yielded power consumption reduction from ~16W to ~7W (much closer to Windows) in Idle
    2. Additional packages (some might have been included in the Respin):
    ``sudo apt-get install smbios-utils``
    2. Additional packages (some might have been included in the Respin):
    - ``sudo apt-get install smbios-utils``
    3. More Tips & Tricks related to Thermals:
    [Some useful tips and tricks](https://github.com/JackHack96/dell-xps-9570-ubuntu-respin/wiki/Some-useful-tips-and-tricks)
    - [``Some useful tips and tricks``](https://github.com/JackHack96/dell-xps-9570-ubuntu-respin/wiki/Some-useful-tips-and-tricks)
    - Switch to Battery-Mode on AC for better Thermals:
    ``sudo tlp bat``
    3. Enable right-mouse-click:
    - Follow these instructions: https://askubuntu.com/a/1029458/286776
  16. @mdziekon mdziekon revised this gist Nov 17, 2018. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -117,7 +117,11 @@
    - Modify the GRUB editting code to include ``splash`` option
    - Nvidia & WiFi card changes were not performed
    - Running this script yielded power consumption reduction from ~16W to ~7W (much closer to Windows) in Idle
    2. Enable right-mouse-click:
    2. Additional packages (some might have been included in the Respin):
    ``sudo apt-get install smbios-utils``
    3. More Tips & Tricks related to Thermals:
    [Some useful tips and tricks](https://github.com/JackHack96/dell-xps-9570-ubuntu-respin/wiki/Some-useful-tips-and-tricks)
    3. Enable right-mouse-click:
    - Follow these instructions: https://askubuntu.com/a/1029458/286776
    - Latest commit used: [``7486bc9b3bbf3aca26bd8ab48b39788a7f9392aa``](https://github.com/JackHack96/dell-xps-9570-ubuntu-respin/commit/7486bc9b3bbf3aca26bd8ab48b39788a7f9392aa)
  17. @mdziekon mdziekon revised this gist Nov 17, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -119,6 +119,9 @@
    - Running this script yielded power consumption reduction from ~16W to ~7W (much closer to Windows) in Idle
    2. Enable right-mouse-click:
    - Follow these instructions: https://askubuntu.com/a/1029458/286776
    - Latest commit used: [``7486bc9b3bbf3aca26bd8ab48b39788a7f9392aa``](https://github.com/JackHack96/dell-xps-9570-ubuntu-respin/commit/7486bc9b3bbf3aca26bd8ab48b39788a7f9392aa)
    - Nvidia Drivers used: 390
    # Additional notes
  18. @mdziekon mdziekon revised this gist Oct 20, 2018. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -100,7 +100,12 @@
    - ``sudo nano /etc/crypttab``:
    ```
    # <target name> <source device> <key file> <options>
    cryptdrive UUID=abcdefgh-1234-5678-9012-abcdefghijklm none luks,retry=1,lvm=vglinux
    # options used:
    # luks - specifies that this is a LUKS encrypted device
    # tries=0 - allows to re-enter password unlimited number of times
    # discard - allows SSD TRIM command, WARNING: potential security risk (more: "man crypttab")
    # loud - display all warnings
    cryptdrive UUID=abcdefgh-1234-5678-9012-abcdefghijklm none luks,tries=0,discard,loud
    ```
    - ``update-initramfs -k all -c``
    9. Reboot into Ubuntu
  19. @mdziekon mdziekon revised this gist Sep 18, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -123,6 +123,6 @@
    - It can also be accessed using GRUB's menu, however, then it prompts me to use the BitLocker's recovery key
    - Cancelling the recovery and using F12 -> Windows Boot Manager trick did not prompt to use recovery key again...
    - Both, when installing Ubuntu, and sometimes when rebooting installed Ubuntu, "poweroff" or "reboot" results in prolonged shutdown with locked up display.
    I have no idea why this happens, never seen something like this on Windows.
    - Fixed with ``dell-xps-9570-ubuntu-respin`` tweak script
    - About BIOS upgrade:
    - An upgrade from 1.3.0 to 1.3.1 required to swap RAM sticks to the original ones again, because the machine would not boot with white & amber LED flashes (supposedly indicating "memory problem"). After booting just once with the original sticks, I've swapped to the 2x16GB sticks again without a problem.
    - An upgrade from 1.3.0 to 1.3.1 required to swap RAM sticks to the original ones again, because the machine would not boot with white & amber LED flashes (supposedly indicating "memory problem"). After booting just once with the original sticks, I've swapped to the 2x16GB sticks again without a problem.
  20. @mdziekon mdziekon revised this gist Sep 18, 2018. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -105,6 +105,16 @@
    - ``update-initramfs -k all -c``
    9. Reboot into Ubuntu
    # 4. Ubuntu Tweaks
    1. Run some of the [``dell-xps-9570-ubuntu-respin``](https://github.com/JackHack96/dell-xps-9570-ubuntu-respin) tweaks:
    - Main script is here: https://github.com/JackHack96/dell-xps-9570-ubuntu-respin/blob/master/xps-tweaks.sh
    - Modify the GRUB editting code to include ``splash`` option
    - Nvidia & WiFi card changes were not performed
    - Running this script yielded power consumption reduction from ~16W to ~7W (much closer to Windows) in Idle
    2. Enable right-mouse-click:
    - Follow these instructions: https://askubuntu.com/a/1029458/286776
    # Additional notes
    - Switching between OSes:
  21. @mdziekon mdziekon revised this gist Sep 15, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -110,7 +110,8 @@
    - Switching between OSes:
    - Ubuntu (GRUB) is the default boot option
    - Windows can be accessed using F12's boot option menu
    - It can also be accessed using GRUB's menu, however, then it prompts me to use the BitLocker's recovery key
    - It can also be accessed using GRUB's menu, however, then it prompts me to use the BitLocker's recovery key
    - Cancelling the recovery and using F12 -> Windows Boot Manager trick did not prompt to use recovery key again...
    - Both, when installing Ubuntu, and sometimes when rebooting installed Ubuntu, "poweroff" or "reboot" results in prolonged shutdown with locked up display.
    I have no idea why this happens, never seen something like this on Windows.
    - About BIOS upgrade:
  22. @mdziekon mdziekon revised this gist Sep 15, 2018. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -98,9 +98,10 @@
    - ``mount -t devpts devpts /dev/pts``
    8. In chroot env, configure ``crypttab`` allowing to boot Ubuntu with Encryption unlocker
    - ``sudo nano /etc/crypttab``:
    - ```# <target name> <source device> <key file> <options>
    cryptdrive UUID=abcdefgh-1234-5678-9012-abcdefghijklm none luks,retry=1,lvm=vglinux
    ```
    ```
    # <target name> <source device> <key file> <options>
    cryptdrive UUID=abcdefgh-1234-5678-9012-abcdefghijklm none luks,retry=1,lvm=vglinux
    ```
    - ``update-initramfs -k all -c``
    9. Reboot into Ubuntu
  23. @mdziekon mdziekon revised this gist Sep 15, 2018. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,6 @@
    - Windows 10 Pro license
    - BIOS version: 1.3.1
    - Suprisingly, Ubuntu's update manager supports BIOS updates out of the box
    - An upgrade from 1.3.0 to 1.3.1 required to swap RAM sticks to the original ones again, because the machine would not boot with white & amber LED flashes (supposedly indicating "memory problem"). After booting just once with the original sticks, I've swapped to the 2x16GB sticks again without a problem.
    - My installation did **not** require to disable TPM nor Secure Boot
    - My installation did not force me to recover Bitlocker after Ubuntu's installation
    - Some people report that it was needed in their case
    @@ -112,4 +111,6 @@
    - Windows can be accessed using F12's boot option menu
    - It can also be accessed using GRUB's menu, however, then it prompts me to use the BitLocker's recovery key
    - Both, when installing Ubuntu, and sometimes when rebooting installed Ubuntu, "poweroff" or "reboot" results in prolonged shutdown with locked up display.
    I have no idea why this happens, never seen something like this on Windows.
    I have no idea why this happens, never seen something like this on Windows.
    - About BIOS upgrade:
    - An upgrade from 1.3.0 to 1.3.1 required to swap RAM sticks to the original ones again, because the machine would not boot with white & amber LED flashes (supposedly indicating "memory problem"). After booting just once with the original sticks, I've swapped to the 2x16GB sticks again without a problem.
  24. @mdziekon mdziekon revised this gist Sep 15, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@
    - Windows 10 Pro license
    - BIOS version: 1.3.1
    - Suprisingly, Ubuntu's update manager supports BIOS updates out of the box
    - An upgrade from 1.3.0 to 1.3.1 required to swap RAM sticks to the original ones again, because the machine would not boot with white & amber LED flashes (supposedly indicating "memory problem")
    - An upgrade from 1.3.0 to 1.3.1 required to swap RAM sticks to the original ones again, because the machine would not boot with white & amber LED flashes (supposedly indicating "memory problem"). After booting just once with the original sticks, I've swapped to the 2x16GB sticks again without a problem.
    - My installation did **not** require to disable TPM nor Secure Boot
    - My installation did not force me to recover Bitlocker after Ubuntu's installation
    - Some people report that it was needed in their case
  25. @mdziekon mdziekon revised this gist Sep 15, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,9 @@
    - RAM: 16 GB (original) / 32 GB (manually upgraded)
    - Drive: 512 GB (SK Hynix PC401)
    - Windows 10 Pro license
    - BIOS version: 1.3.1 (suprisingly, Ubuntu's update manager supports BIOS updates out of the box)
    - BIOS version: 1.3.1
    - Suprisingly, Ubuntu's update manager supports BIOS updates out of the box
    - An upgrade from 1.3.0 to 1.3.1 required to swap RAM sticks to the original ones again, because the machine would not boot with white & amber LED flashes (supposedly indicating "memory problem")
    - My installation did **not** require to disable TPM nor Secure Boot
    - My installation did not force me to recover Bitlocker after Ubuntu's installation
    - Some people report that it was needed in their case
  26. @mdziekon mdziekon revised this gist Sep 15, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions xps_15_9570__dualboot_with_encryption__notes.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    - Based on https://askubuntu.com/a/293029/286776
    - Installation date: 15-09-2018
    - Additional notes based on my own experience
    - The process describes a completely fresh installation with a complete repartitioning,
    however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled).
  27. @mdziekon mdziekon renamed this gist Sep 15, 2018. 1 changed file with 0 additions and 0 deletions.
  28. @mdziekon mdziekon created this gist Sep 15, 2018.
    112 changes: 112 additions & 0 deletions notes.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,112 @@
    - Based on https://askubuntu.com/a/293029/286776
    - Additional notes based on my own experience
    - The process describes a completely fresh installation with a complete repartitioning,
    however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled).
    - The process was conducted on Dell's XPS 15 9570 (2018) with specs:
    - CPU: i7-8750H
    - Screen: 4K with Touch
    - RAM: 16 GB (original) / 32 GB (manually upgraded)
    - Drive: 512 GB (SK Hynix PC401)
    - Windows 10 Pro license
    - BIOS version: 1.3.1 (suprisingly, Ubuntu's update manager supports BIOS updates out of the box)
    - My installation did **not** require to disable TPM nor Secure Boot
    - My installation did not force me to recover Bitlocker after Ubuntu's installation
    - Some people report that it was needed in their case
    - See "Additional notes" for more info about GRUB & Booting into Windows

    # 1. Preparation (using another computer with Ubuntu)

    1. Create Windows installation USB stick
    - Download .ISO file from Microsoft's webpage
    - Create bootable USB using ``WoeUSB``
    - Ubuntu has an option to "restore" ISO images using ``Disks`` utility, but it does not work correctly
    (Windows installer asks for additional drivers)
    - I also had to compile ``WoeUSB`` because of some weird bug in the default Ubuntu's (PPA's) supplied package
    that would not let me finish the installation process
    2. Create Ubuntu installation USB stick
    - Download .ISO file from Ubuntu's webpage
    - Create bootable USB using "whatever"
    3. Go to BIOS (F2) and switch from SSD's "RAID mode" to "AHCI mode"

    # 2. Install Windows

    1. Insert newly created bootable USB and start the installation process
    2. Re-partition your drive
    - My partitioning scheme (devices might have be labeled differently!):
    1. Boot drive for Linux: ``1GB``
    - ``/dev/nvme0n1p1``
    2. Windows OS drive: ``~75GB``
    - ``/dev/nvme0n1p5``
    - Will automatically create additional drives **before** the actual OS drive
    as soon as you create the first "regular" partition
    3. Windows data drive: ``~100GB``
    - ``/dev/nvme0n1p6``
    4. Ubuntu LUKS drive: ``~300GB``
    - ``/dev/nvme0n1p7``
    - Can be created later
    3. Install Windows on the "Windows OS drive"
    4. Boot to Windows after installation, install all updates
    5. Enable BitLocker on "Windows data drive" ("Windows OS drive" was already encrypted)
    6. Create recovery data for both Bitlocker-protected drives and store them somewhere (eg. additional USB)

    # 3. Install Ubuntu

    1. Insert newly created bootable USB and start the installation process
    2. Create LUKS container on "Ubuntu LUKS drive" and "wipe it":
    - ``sudo cryptsetup luksFormat /dev/nvme0n1p7``
    - ``sudo cryptsetup luksOpen /dev/nvme0n1p7 cryptdrive``
    - ``sudo dd if=/dev/zero of=/dev/mapper/cryptdrive bs=16M``
    3. Create LVM physical volume, a volume group & logical volumes:
    - Volumes are sized as follows:
    - OS drive: ``60GB``
    - Swap: ``16GB``
    - Home: ``rest``
    - Commands:
    - ``sudo pvcreate /dev/mapper/cryptdrive``
    - ``sudo vgcreate vglinux /dev/mapper/cryptdrive``
    - ``sudo lvcreate -n root -L 60g vglinux``
    - ``sudo lvcreate -n swap -L 16g vglinux``
    - ``sudo lvcreate -n home -l 100%FREE vglinux``
    4. Start the installation process using GUI:
    - Connect to WiFi network
    - Installation options:
    - Pick "minimal installation"
    - Pick "install updates during installation"
    - Pick "install 3rd party drivers" (no need to "reset Secure Boot password")
    - Pick "custom installation process" (the one which lets you repartition stuff)
    - Pick ``/dev/mapper/vglinux-root`` as ``ext4`` FS & mount it to ``/``
    - Pick ``/dev/mapper/vglinux-home`` as ``ext4`` FS & mount it to ``/home``
    - Pick ``/dev/mapper/vglinux-swap`` as ``swap``
    - Pick ``/dev/nvm0n1p1`` as ``ext4`` FS & mount it to ``/boot``
    - Without doing this, installation will fail when configuring GRUB
    - Pick "boot drive" (the select list at the bottom) and assign it to ``/dev/nvm0n1p1``
    - Proceed with the installation
    5. After GUI installation completes, stay within the Live USB environment
    6. Check the UUID of the LUKS drive:
    - ``sudo blkid /dev/nvme0n1p7``
    - Example output:
    - ``/dev/nvme0n1p7: UUID="abcdefgh-1234-5678-9012-abcdefghijklm" TYPE="crypto_LUKS"``
    7. Mount root & boot drives and chroot into the main mount:
    - ``sudo mount /dev/mapper/vglinux-root /mnt``
    - ``sudo mount /dev/nvme0n1p1 /mnt/boot``
    - ``sudo mount --bind /dev /mnt/dev``
    - ``sudo chroot /mnt``
    - ``mount -t proc proc /proc``
    - ``mount -t sysfs sys /sys``
    - ``mount -t devpts devpts /dev/pts``
    8. In chroot env, configure ``crypttab`` allowing to boot Ubuntu with Encryption unlocker
    - ``sudo nano /etc/crypttab``:
    - ```# <target name> <source device> <key file> <options>
    cryptdrive UUID=abcdefgh-1234-5678-9012-abcdefghijklm none luks,retry=1,lvm=vglinux
    ```
    - ``update-initramfs -k all -c``
    9. Reboot into Ubuntu
    # Additional notes
    - Switching between OSes:
    - Ubuntu (GRUB) is the default boot option
    - Windows can be accessed using F12's boot option menu
    - It can also be accessed using GRUB's menu, however, then it prompts me to use the BitLocker's recovery key
    - Both, when installing Ubuntu, and sometimes when rebooting installed Ubuntu, "poweroff" or "reboot" results in prolonged shutdown with locked up display.
    I have no idea why this happens, never seen something like this on Windows.