kairos-io / kairos

:penguin: The immutable Linux meta-distribution for edge Kubernetes.
https://kairos.io
Apache License 2.0
1.11k stars 97 forks source link

Partition size in To with RPI4 #1928

Open fafarun opened 12 months ago

fafarun commented 12 months ago

Kairos version:

metal-4ef5:~ # cat /etc/os-release
NAME="openSUSE Leap"
VERSION="15.5"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.5"
PRETTY_NAME="openSUSE Leap 15.5"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.5"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Leap"
LOGO="distributor-logo-Leap"
KAIROS_NAME="kairos-kairos-opensuse-leap-arm-rpi"
KAIROS_VERSION="v2.4.1-k3sv1.26.6+k3s1"
KAIROS_ID="kairos"
KAIROS_ID_LIKE="kairos-kairos-opensuse-leap-arm-rpi"
KAIROS_VERSION_ID="v2.4.1-k3sv1.26.6+k3s1"
KAIROS_PRETTY_NAME="kairos-kairos-opensuse-leap-arm-rpi v2.4.1-k3sv1.26.6+k3s1"
KAIROS_BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues"
KAIROS_HOME_URL="https://github.com/kairos-io/kairos"
KAIROS_IMAGE_REPO="quay.io/kairos/kairos-opensuse-leap-arm-rpi"
KAIROS_IMAGE_LABEL=""
KAIROS_GITHUB_REPO="kairos-io/provider-kairos"
KAIROS_VARIANT="kairos"
KAIROS_FLAVOR="opensuse-leap-arm-rpi"
kairos-agent state
uuid: 4ef5ae26a48d91402d81a24664dcba58-metal-4ef5
persistent:
    mounted: true
    name: /dev/sda5
    label: persistent
    filesystemlabel: COS_PERSISTENT
    mount_point: /usr/local
    size_bytes: 1989321760256
    type: ext4
    read_only: false
    found: true
    uuid: ea5f3529-3edb-4cc7-9f1d-091f6bc7d54a
recovery:
    mounted: false
    name: /dev/sda3
    label: recovery
    filesystemlabel: COS_RECOVERY
    mount_point: ""
    size_bytes: 4404019200
    type: ext4
    read_only: true
    found: true
    uuid: ba8250eb-b8b2-4005-8def-9015495f9166
oem:
    mounted: true
    name: /dev/sda4
    label: oem
    filesystemlabel: COS_OEM
    mount_point: /oem
    size_bytes: 67108864
    type: ext4
    read_only: false
    found: true
    uuid: 8690f371-1a4c-48a8-8d83-8497b5341d66
state:
    mounted: true
    name: /dev/sda2
    label: state
    filesystemlabel: COS_STATE
    mount_point: /run/initramfs/cos-state
    size_bytes: 6501171200
    type: ext4
    read_only: true
    found: true
    uuid: 1873bb97-4702-473b-aa00-d063f2e2b96f
boot: active_boot
system:
    meta:
        version: 1.0.1
        timestamp: 2023-10-19T18:24:02.653378347Z
    node:
        hostname: metal-4ef5
        machineid: 4ef5ae26a48d91402d81a24664dcba58
        hypervisor: ""
        timezone: Etc/UTC
    os:
        name: openSUSE Leap 15.5
        vendor: opensuse-leap
        version: "15.5"
        release: ""
        architecture: ""
    kernel:
        release: 5.14.21-150500.55.19-default
        version: '#1 SMP PREEMPT_DYNAMIC Tue Aug 8 22:15:01 UTC 2023 (9908c29)'
        architecture: aarch64
    product:
        name: rpi
        vendor: raspberrypi
        version: ""
        serial: 10000000a81b9c53
    board:
        name: rpi
        vendor: raspberrypi
        version: ""
        serial: ""
        assettag: ""
    chassis:
        type: 3
        vendor: raspberrypi
        version: ""
        serial: ""
        assettag: ""
    bios:
        vendor: U-Boot
        version: "2021.01"
        date: 04/19/2021
    cpu:
        vendor: ""
        model: ""
        speed: 0
        cache: 0
        cpus: 0
        cores: 0
        threads: 4
    memory:
        type: ""
        speed: 0
        size: 0
    storage:
        - name: sda
          driver: sd
          vendor: ASMT
          model: "2115"
          serial: 22500Q800721
          size: 2000
    network:
        - name: eth0
          driver: bcmgenet
          macaddress: d8:3a:dd:1e:15:b8
          port: tp/mii
          speed: 1000
        - name: wlan0
          driver: brcmfmac
          macaddress: d8:3a:dd:1e:15:b9
          port: ""
          speed: 0
kairos:
    flavor: opensuse-leap-arm-rpi
    version: v2.4.1-k3sv1.26.6+k3s1

CPU architecture, OS, and Version:

uname -a
Linux metal-4ef5 5.14.21-150500.55.19-default #1 SMP PREEMPT_DYNAMIC Tue Aug 8 22:15:01 UTC 2023 (9908c29) aarch64 aarch64 aarch64 GNU/Linux

Describe the bug

I use a rpi4 with disk SSD (sata), my cloud-init works.

Now, I try with a ssd (M2) 2to, and I have an issue to resize the partition. The size of the persistent partition is not good. K3s failed to start, not enough space. There is a difference between df -hand lsblk

lsblk -o NAME,SIZE,LABEL
NAME    SIZE LABEL
loop0     2G COS_ACTIVE
sda     1.8T
|-sda1   96M COS_GRUB
|-sda2  6.1G COS_STATE
|-sda3  4.1G COS_RECOVERY
|-sda4   64M COS_OEM
`-sda5  1.8T COS_PERSISTENT
 df -h
Filesystem                         Size  Used Avail Use% Mounted on
devtmpfs                           4.0M     0  4.0M   0% /dev
tmpfs                              3.9G  8.0K  3.9G   1% /dev/shm
tmpfs                              1.6G  8.9M  1.6G   1% /run
tmpfs                              4.0M     0  4.0M   0% /sys/fs/cgroup
/dev/loop0                         2.0G  1.8G  123M  94% /
/dev/disk/by-label/COS_OEM          55M   17K   51M   1% /oem
tmpfs                              2.0G   12M  2.0G   1% /run/overlay
/dev/disk/by-label/COS_PERSISTENT   55M   37M   15M  73% /usr/local
overlay                            2.0G   12M  2.0G   1% /var
overlay                            2.0G   12M  2.0G   1% /etc
overlay                            2.0G   12M  2.0G   1% /srv
tmpfs                              3.9G  4.0K  3.9G   1% /tmp
/dev/sda2                          5.9G  3.7G  1.9G  66% /run/initramfs/cos-state
tmpfs                              785M     0  785M   0% /run/user/0

Here my cloud-init :

#cloud-config
debug: true

hostname: metal-{{ trunc 4 .MachineID }}

users:
  - name: "kairos"                       
    passwd: "kairos"                      
    ssh_authorized_keys:                  
      - 'remove key'
ssh_pwauth: False  
p2p:
  disable_dht: true 
  vpn:
    create: true 
    use: true 
    auto: true
    dns: true
    env:
      DHCP: "true"
      EDGEVPNDHT: "false"
      ADDRESS: "10.5.0.30/24"
  auto:
    enable: true
    ha:
      enable: true
      master_nodes: 2
  network_token:

To Reproduce

Try to boot a RPI4 with a SSD M2 disk large size >To.

Expected behavior

Logs

Additional context

Itxaka commented 12 months ago

probably same issue as https://github.com/kairos-io/kairos/issues/1928

fafarun commented 12 months ago

probably same issue as #1928

It's the same issue number. I think it's a copy past error.

Itxaka commented 12 months ago

probably same issue as #1928

It's the same issue number. I think it's a copy past error.

wops!

correct link: https://github.com/kairos-io/kairos/issues/1599

Seems to be the same issue, a race condition. We expand the partition then the FS but sometimes the partition table is not updated on time so the resizer of the FS thinks that the FS is already at max expansion. No errors and the same output form lsblk and df.

jimmykarily commented 11 months ago

probably same issue as #1928

It's the same issue number. I think it's a copy past error.

wops!

correct link: #1599

Seems to be the same issue, a race condition. We expand the partition then the FS but sometimes the partition table is not updated on time so the resizer of the FS thinks that the FS is already at max expansion. No errors and the same output form lsblk and df.

thus (possibly) fixed here: https://github.com/mudler/yip/pull/116 ?

fafarun commented 11 months ago

I try the same image with a SDD M2 disk 1To (943 Go), everything works on kairos.
I still think, we have a problem with large partition > Go. I'am not really strong to investigate this issue.