Announcement

Collapse
No announcement yet.

Kubuntu 20.04 on top of ZFS

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Originally posted by GreyGeek View Post
    Thanks for that post. It should prove useful for those who want to run Kubuntu on top of ZFS.
    I'm just pleasant when everything is successful like the people want/wish.
    Here the entire documentation (written for myself) with MarkDown (*.md) syntax for copy, store, modify, improve and interesting links
    Code:
    # Zubuntu.md
    [Link 1.](https://openzfs.github.io/openzfs-docs/Getting%20Started/Ubuntu/Ubuntu%2020.04%20Root%20on%20ZFS.html#), [link 2.](https://linsomniac.gitlab.io/post/2020-04-09-ubuntu-2004-encrypted-zfs/)
    ## Overview
    1. These instruction are collected to permitt install Ubuntu and derivates on full "ZFS-encrypted-ROOT" using [Ubuntu 20.04.1.ISO](https://releases.ubuntu.com/20.04/ubuntu-20.04.1-desktop-amd64.iso)
    2. The installer does not include password support for ZFS, but the installed system does have everything necessary to prompt for and handle the root volume being encrypted. This uses ZFS Native Encryption.
    3. Ensure that UEFI/BIOS on motherboard is set to "UEFI" only, disable "MBR"-start or compatibility mode (CSM), the same in (e.g.) "Virtual-Box/(e.g.)Zubuntu/Settings/System/Motherboard/Enable EFI (special OSes only)".
    4. Works best using "NVMe"-controller for hardware- and virtual-machine, SSD works too. For (e.g.) virtual-box, click "New/Do not add a virtual hard disk" but configure the rest, after VM is created (e.g. "Zubuntu") click "VM/Storage/Add new storage controller/(choose)NVMe", than click on new controller, choose "Add hard disk", choose "create new", give a "size", choose "select", click "OK". 
    ### Step 1. Start installation-medium and access configuration-file
    
    1. Boot the Ubuntu 20.04 Desktop installer/live CD.
    2. Click the “Try Ubuntu” button.
    3. Open a terminal and edit `/usr/share/ubiquity/zsys-setup`:
    ```
    sudo -i
    
    nano /usr/share/ubiquity/zsys-setup
    ```
    ### Step 2. [Modify configuration file](https://pov.es/linux/ubuntu/ubuntu-20-04-install-ubuntu-with-zfs-and-encryption/)
    1. Modify `zsys-setup` configuration-file.
    * This here is around line 316
    * Replace PASSWORD with the encryption password you want to use. You will be prompted to type this at boot
    ```
    # Pools
           # rpool
           echo MYPASSWORD | zpool create -f \
                   -o ashift=12 \
                   -O compression=lz4 \
                   -O acltype=posixacl \
                   -O xattr=sa \
                   -O relatime=on \
                   -O normalization=formD \
                   -O mountpoint=/ \
                   -O canmount=off \
                   -O dnodesize=auto \
                   -O sync=disabled \
                   -O recordsize=1M \
                   -O encryption=aes-256-gcm \
                   -O keylocation=prompt \
                   -O keyformat=passphrase \
                   -O mountpoint=/ -R "${target}" rpool "${partrpool}"
    ```
    
    Around line 270 & line 285 you can define the swap-partitions-sizes.
    ```
    {partprefix}${partswap}  size=8192M,
    ```
    * Save/Store (configuration-file) with [CTRL + O], Quitt (`nano`-editor) with [CTRL + X].
    **Section Note:**
    * On EFI/UEFI install you get as partitioning-result Only "512 MiB" for "EFI" and in the remain capacity (`ext4` partition) is `/boot` as folder and `/swapfile` as file with all the rest as usual. If you see a `/boot` partition and `update-grub` don't work,,, you start the installer not in EFI-Mode 
    At  this point you can/should check and/or modify `sources.list` as described in "Step 3.".
    ###  Step 3. Modify/configure "sources.list"
    **Section NOTE:** Enabling `backports` is very inmportant because you get latest kernel (`5.4`) with latest drivers and grub-version. Afterward you can install even kernel `5.8` used in "20.10"
    1. Open configuration file
    ```
    nano /etc/apt/sources.list
    ```
    2. Basic
    ```
    deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse
    ```
    3. With enabled Source-Code
    ```
    deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
    deb-src  http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse
    deb-src http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse
    ```
    4. "Canonical" Partner
    ```
    deb http://archive.canonical.com/ubuntu focal partner
    deb-src http://archive.canonical.com/ubuntu focal partner
    ```
    5. Complete
    ```
    deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
    deb-src  http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse
    deb-src http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse
    deb http://archive.canonical.com/ubuntu focal partner
    deb-src http://archive.canonical.com/ubuntu focal partner
    ```
    6. Update sources ONLY with:
    ```
    apt update
    ```
    ### Step 4.
    
    Start installer
    * Run installer from CLI (Terminal/Konsole) and let open until installation is concluded.
    * Run ubiquity to start the installer and install as normal, selecting “Use entire disk” and the option to use ZFS.
    * Select "Install Updates during Installation" or similar to get benefit of new kernel and drivers.
    ```
    ubiquity
    ```
    * After installation is concluded click on "Continue Try Ubuntu", than close Terminal and restart PC best over menu.
    ### Step 5. [Modify Size of "Swapfile"](https://bogdancornianu.com/change-swap-size-in-ubuntu/), (optional, standard size is 2GiB)
    1. After "Restart" first OS-Start open Terminal with [CTRL + ALT + T]
    2. Turn off all swap processes 
    ```
    sudo swapoff -a
    ```
    3. Resize the swap
    ```
    sudo dd if=/dev/zero of=/swapfile bs=1G count=8
    ```
    * Explanation:
    ```
    if = input file
    of = output file
    bs = block size
    count = multiplier of blocks
    ```
    Increase or reduce the "count" for modify size of `/swapfile`.
    4. Change permission
    ```
    sudo chmod 600 /swapfile
    ```
    5. Make the file usable as swap 
    ```
    sudo mkswap /swapfile
    ```
    6. Activate the swap file
    ```
    sudo swapon /swapfile
    ```
    7. Edit /etc/fstab and add the new swapfile if it isn’t already there
    ```
    sudo nano /etc/fstab
    
    /swapfile none swap sw 0 0
    ```
    8. Check the amount of swap available
    ```
    grep SwapTotal /proc/meminfo
    ```
    ###  Step 6. Essential after first "Start", this apply for every OS
    1. Assure `/etc/apt/sources.list` (See Step 3.) is accordingly to your OS/your wish, if `CD-ROM` is still activated,,, deactivate it with a `#` like here `#CD-ROM`
    2. Complete update of systen with:
    ```
    apt update; apt upgrade --yes; apt full-upgrade --yes; update-grub
    ```
    * You can use also `dist-upgrade` instead of `full-upgrade` or both e.g.:
    ```
    apt update; apt upgrade --yes; apt full-upgrade --yes; apt dist-upgrade --yes; update-grub
    ```
    * If you installed the OS with `backports` enabled, you should not need to restart the system now/again.
    3. Additional software for ZFS
    ```
    apt install --reinstall --yes zfsutils-linux zfs-dkms
    ```
    4. Additional desktops e.g. Kubuntu
    ```
    apt install --reinstall --yes plasma-desktop kde-full sddm-theme-breeze
    ```
    ### Step 7. [Troubleshooting and extended instructions](https://openzfs.github.io/openzfs-docs/Getting%20Started/Ubuntu/Ubuntu%2020.04%20Root%20on%20ZFS.html)
    
    [x] **Done & ENJOY!**

    Comment

    Working...
    X