Jump to content

michabbs

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by michabbs

  1. My Helios64 is "far away" and I am afraid to change network configuration, because if I miss something I could lose connectivity to the box. I would like to attach COM-to-IP adapter so that I always had serial console available, but... what actually do I need? "Normal" com-to-ip adapter provides COM port. Helios64 has COM-in-USB. So...? How to convert Helios'es serial console to anything accessible via LAN?

  2. I have nfs server. Whenever I do "systemctl stop nfs-kernel-server" I can see this in dmesg:

     

    lockd: couldn't shutdown host module for net f00000a1!

     

    Later when I do "systemctl start nfs-kernel-server" I see this:

     

    NFSD: starting 90-second grace period (net f00000a1)

     

    Of course "systemctl restart" gives me both messages in a row.

    Any idea what does it mean? What the hell is this "f00000a1"?

    Except strange messages everything seems to work fine...

     

  3. 13 hours ago, tionebrr said:

    I have a hard time figuring out what this command does and what partition I would want to create beforehand:

    Quote

    Prepare necessary partitions - for example using fdisk or gdisk.

     

    Well, generally it is good idea to partition your disk before you use it. :-)

    For example like this:

    # gdisk -l /dev/sda
    GPT fdisk (gdisk) version 1.0.5
    
    Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: present
    
    Found valid GPT with protective MBR; using GPT.
    Disk /dev/sda: 3907029168 sectors, 1.8 TiB
    Model: WDC XXX
    Sector size (logical/physical): 512/4096 bytes
    Disk identifier (GUID): XXX
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 3907029134
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 2014 sectors (1007.0 KiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
       1            2048         1050623   512.0 MiB   EF00  EFI System
       2         1050624      3907029134   1.8 TiB     BF01  ZFS draalpool

     

    I use only one partition (here: sda2) for ZFS, and I may use another ones (here: sda1) for another things. It is usually bad idea to use the whole disk for ZFS, because when you take the disk out and put it into another computer it is not guarantied that it will not try to "repair" the partition table (which you do not have...).

    In the above example I created the EFI partition just in case if I needed to move this disk to another computer  (in an unknown future...) and do something (no matter what...). Most likely it will never be used for anything. But it is there - just as an option. :-)

    Anyway - if you already created zfs on the whole disk - it should work just fine.

     

    13 hours ago, tionebrr said:

    I guess you are mirroring instead of creating a raidz.

    Yes, it was just an example. There are plenty of ways you could create zfs pool. Generally 3-disks RAIDZ and 2-disks MIRROR are the most common.

     

    13 hours ago, tionebrr said:

    And also you are specifying the drives by id instead of path. What are the ups and downs of both methods?

    In ZFS you should never specify disks (or partitions...) by /dev/sdXY path.  The path is not guaranteed to be consistent between reboots. Actually it is guaranteed to be inconsistent when you remove a disk or swap disks. Your pool might fail to import after reboot if the disks have different paths assigned. Always use uuids!

     

    14 hours ago, tionebrr said:

    I see you are not using the docker packages available by default. What is wrong with the original? Outdated?

    Possibly nothing is wrong with them. I always use official Docker repository because they support Ubuntu and provide with the newest stable version.

     

  4. Focal / root on eMMC / ZFS on hdd / LXD / Docker

     

    I received my Helios64 yesterday, installed the system, and decided to write down my steps before I forget them. Maybe someone will be interested. :-)

     

    Preparation:

    • Assembly your box as described here.
    • Download Armbian Focal image from here and flash it to SD card. You may use Ether.
    • Insert the SD card to your Helios64 and boot.
    • After 15-20s the box should be accessible via ssh. (Of course you have to find out it's IP address somehow. For example check your router logs or use this.)

     

    First login:

    ssh root@IP
    Password: 1234

     

    After prompt - change password and create your daily user. You should never login as root again. Just use sudo in the future. :-)

    Note: The auto-generated user is member of "disk" group. I do not like it. You may remove it so: "gpasswd -d user disk".

     

    Now move your system to eMMC:

    apt update
    apt upgrade
    armbian-config
    # Go to: System -> Install -> Install to/update boot loader -> Install/Update the bootloader on SD/eMMC -> Boot from eMMC / system on eMMC

     

    You can choose root filesystem. I have chosen ext4. Possibly f2fs might be a better idea, but I have not tested it.

    When finished - power off, eject the sd card, power on. 

    Your system should now boot from eMMC.

     

    If you want to change network configuration (for example set static IP) use this: "sudo nmtui".

    You should also change the hostname:

    sudo armbian-config
    # Go to: Personal -> Hostname

     

     

    ZFS on hard disk:

    sudo armbian-config
    # Go to Software and install headers.
    sudo apt install zfs-dkms zfsutils-linux
    # Optional:
    sudo apt install zfs-auto-snapshot
    # reboot

     

    Prepare necessary partitions - for example using fdisk or gdisk.

    Create your zfs pool. More or less this way:

    sudo zpool create -o ashift=12 -m /mypool -mypool mirror /dev/disk/by-partuuid/abc123 /dev/disk/by-partuuid/xyz789

     

    Reboot and make sure the pool is imported automatically. (For example by typing "zpool status".)

    You should now have working system with root on eMMC and ZFS pool on HDD.

     

    Docker with ZFS:

    Prepare the filesystem:

    sudo zfs create -o mountpoint=/var/lib/docker mypool/docker-root
    sudo zfs create -o mountpoint=/var/lib/docker/volumes mypool/docker-volumes
    sudo chmod 700 /var/lib/docker/volumes
    
    # Option: If you use zfs-auto-snapshot, you might want to consider this:
    sudo zfs set com.sun:auto-snapshot=false mypool/docker-root
    sudo zfs set com.sun:auto-snapshot=true mypool/docker-volumes

     

    Create /etc/docker/daemon.json with the following content:

    {
      "storage-driver": "zfs"
    }

     

    Add /etc/apt/sources.list.d/docker.list with the following content:

    deb [arch=arm64] https://download.docker.com/linux/ubuntu focal stable
    # deb-src [arch=arm64] https://download.docker.com/linux/ubuntu focal stable

     

    Install Docker:

    sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
    sudo apt update
    sudo apt install docker-ce docker-ce-cli containerd.io
    
    #You might want this:
    sudo usermod -aG docker your-user

     

     

    Voila! Your Docker should be ready! Test it: "docker run hello-world".

     

    Option: Install Portainer:

    sudo zfs create rpool/docker-volumes/portainer_data
    # You might omit the above line if you do not want to have separate dataset for the docker volume (bad idea).
    
    docker volume create portainer_data
    docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

     

    Go to http://yourip:9000 and configure.

     

     

    LXD with ZFS:

     

    sudo zfs create -o mountpoint=none mypool/lxd-pool
    sudo apt install lxd
    sudo lxc init
    
    # Configure ZFS this way:
    Do you want to configure a new storage pool (yes/no) [default=yes]?  yes
    Name of the new storage pool [default=default]: 
    Name of the storage backend to use (dir, btrfs, ceph, lvm, zfs) [default=zfs]: zfs
    Create a new ZFS pool (yes/no) [default=yes]? no
    Name of the existing ZFS pool or dataset: mypool/lxd-pool
    [...]
    
    #You might want this:
    sudo usermod -aG lxd your-user
    
    # Option: If you use zfs-auto-snapshot, you might want to consider this:
    sudo zfs set com.sun:auto-snapshot=false mypool/lxd-pool
    sudo zfs set com.sun:auto-snapshot=true mypool/lxd-pool/containers
    sudo zfs set com.sun:auto-snapshot=true mypool/lxd-pool/custom
    sudo zfs set com.sun:auto-snapshot=true mypool/lxd-pool/virtual-machines

     

    That's it. Lxd should work now on ZFS. :-)

     

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines