Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 resizefs on boot doesn't work #1448

Closed
Tracked by #1066
mudler opened this issue May 24, 2023 · 29 comments
Closed
Tracked by #1066

🐛 resizefs on boot doesn't work #1448

mudler opened this issue May 24, 2023 · 29 comments
Assignees
Labels
ARM bug Something isn't working

Comments

@mudler
Copy link
Member

mudler commented May 24, 2023

Kairos version:
2.0.2

CPU architecture, OS, and Version:
amd64

Describe the bug
After increasing the disk size, COS_PERSISTENT stayed with the same size

To Reproduce

Expected behavior
Due to https://github.com/kairos-io/kairos/blob/3d32a21ea42357fc65787330dab93718002430cf/overlay/files/system/oem/11_persistency.yaml#LL92C6-L92C75, I'd have expected to grow it on the next boot automatically (as it used to work with ARM)

Logs

Additional context
Workaround:

Create a dummy config file:

> cat /oem/11_persistency.yaml 
name: "Configure persistent dirs bind-mounts"
stages:
  resizefs:
    - name: "Grow persistent"
      layout:
        device:
          label: COS_PERSISTENT
        expand_partition:
          # Size 0 is required to specify all remaining space
          size: 0

Run it in recovery mode:

elemental run-stage resizefs
@mudler mudler added bug Something isn't working ARM labels May 24, 2023
@mudler mudler self-assigned this May 24, 2023
@Itxaka
Copy link
Member

Itxaka commented May 24, 2023

Under alpine-opensuse-leap

time="2023-05-24T14:20:41Z" level=info msg="Processing stage step 'Grow persistent'. ( commands: 0, file
s: 0, ... )\n"
time="2023-05-24T14:20:41Z" level=info msg="Extending last partition up to 0 MiB"
time="2023-05-24T14:20:41Z" level=error
time="2023-05-24T14:20:41Z" level=error msg="not enough free space (1) to expand, at least 20480 is requ
ired"

Installed on a 40Gb disk then expanded it to 80Gb

Running it manually kairos-agent run-stage rootfs results in claiming that sgdisk is not available in alpine:

INFO[2023-05-24T14:25:54Z] Processing stage step 'Grow persistent'. ( commands: 0, files: 0, ... ) 
INFO[2023-05-24T14:25:54Z] Extending last partition up to 0 MiB         
ERRO[2023-05-24T14:25:54Z] Failed analyzing disk: error: exec: "sgdisk": executable file not found in $PATH. output:  
ERRO[2023-05-24T14:25:54Z]                                              
ERRO[2023-05-24T14:25:54Z] error: exec: "sgdisk": executable file not found in $PATH. output: 

Not tested on others.

@Itxaka
Copy link
Member

Itxaka commented May 24, 2023

opensuse same behaviour, it seems to think that the disk has 0 size :S

@jimmykarily jimmykarily moved this to Under review 🔍 in 🧙Issue tracking board May 29, 2023
@jimmykarily jimmykarily moved this from Under review 🔍 to Todo 🖊 in 🧙Issue tracking board May 29, 2023
@jimmykarily jimmykarily moved this from Todo 🖊 to In Progress 🏃 in 🧙Issue tracking board Jun 6, 2023
@jimmykarily jimmykarily self-assigned this Jun 6, 2023
@jimmykarily
Copy link
Contributor

The linked file 11_persistency.yaml is no longer there . It has moved here: 62c67e3#diff-b4a9f2fc5731735b01fdefe547c46aa8f5cb837a59508269632c985141be69a4R152-R154

@jimmykarily
Copy link
Contributor

jimmykarily commented Jun 6, 2023

  • I installed kairos on a disk I created with qemu-img create -f qcow2 disk.img 60g
  • Exited the VM and increased the disk size with qemu-img resize disk.img 80g
  • Booted the VM again and run kairos-agent run-stage rootfs (to trigger the cloud-config I linked to above)

This is the output:

localhost:/home/kairos # kairos-agent run-stage rootfs
INFO[2023-06-06T12:13:31Z] kairos-agent version v2.1.0-rc5              
INFO[2023-06-06T12:13:31Z] Running stage: rootfs.before                 
INFO[2023-06-06T12:13:31Z] Processing stage step 'Pull data from provider'. ( commands: 0, files: 0, ... ) 
[ 1545.824638][   T43] blk_update_request: I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 1545.832354][   T43] floppy: error 10 while reading block 0
ERRO[0000] there were errors probing /dev/sr1: failed mounting /dev/sr1: no medium found no medium found 


2023/06/06 12:14:13 Metaldata: Probing...
ERRO[2023-06-06T12:14:13Z] No metadata/userdata found. Bye              
INFO[2023-06-06T12:14:13Z] Processing stage step 'Sentinel file for userdata'. ( commands: 0, files: 1, ... ) 
INFO[2023-06-06T12:14:13Z] Processing stage step 'Pull data from provider'. ( commands: 0, files: 0, ... ) 
[ 1588.173555][   T43] blk_update_request: I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 1588.177894][   T43] floppy: error 10 while reading block 0
ERRO[0046] there were errors probing /dev/sr1: failed mounting /dev/sr1: no medium found no medium found 
ERRO[2023-06-06T12:14:17Z] No metadata/userdata found. Bye              
INFO[2023-06-06T12:14:17Z] Done executing stage 'rootfs.before'         
INFO[2023-06-06T12:14:17Z] Running stage: rootfs                        
INFO[2023-06-06T12:14:17Z] Processing stage step 'Layout configuration for active/passive mode'. ( commands: 0, files: 0, ... ) 
WARN[2023-06-06T12:14:17Z] (conditional) Skip 'Skipping stage (if statement error: failed to run [ -f "/run/cos/recovery_mode" ]: exit status 1)' stage name: Layout configuration for recovery mode 
WARN[2023-06-06T12:14:17Z] (conditional) Skip 'Skipping stage (if statement error: failed to run grep -q "kairos.boot_live_mode" /proc/cmdline: exit status 1)' stage name: Layout configuration for booting local node from l 
WARN[2023-06-06T12:14:17Z] (conditional) Skip 'Skipping stage (if statement error: failed to run [ -e "/run/cos/uki_mode" ]: exit status 1)' stage name: Layout configuration for UKI 
INFO[2023-06-06T12:14:17Z] Done executing stage 'rootfs'                
INFO[2023-06-06T12:14:17Z] Running stage: rootfs.after                  
WARN[2023-06-06T12:14:17Z] (conditional) Skip 'Skipping stage (if statement error: failed to run [ -r /run/cos/custom-layout.env ] && [ ! -f "/run/cos/recovery_mode" ] && [ ! -f /run/cos/live_mode ]: exit status 1)' stage  
INFO[2023-06-06T12:14:17Z] Processing stage step 'Grow persistent'. ( commands: 0, files: 0, ... ) 
INFO[2023-06-06T12:14:17Z] Extending last partition up to 0 MiB         
ERRO[2023-06-06T12:14:18Z] Warning: Partition /dev/vda5 is being used. Are you sure you want to continue? 
ERRO[2023-06-06T12:14:18Z] exit status 1                                
INFO[2023-06-06T12:14:18Z] Done executing stage 'rootfs.after'          
INFO[2023-06-06T12:14:18Z] Running stage: rootfs.before                 
INFO[2023-06-06T12:14:18Z] Done executing stage 'rootfs.before'         
INFO[2023-06-06T12:14:18Z] Running stage: rootfs                        
INFO[2023-06-06T12:14:18Z] Done executing stage 'rootfs'                
INFO[2023-06-06T12:14:18Z] Running stage: rootfs.after                  
INFO[2023-06-06T12:14:18Z] Done executing stage 'rootfs.after'          
INFO[2023-06-06T12:14:18Z] Some errors found but were ignored. Enable --strict mode to fail on those or --debug to see them in the log 
WARN[2023-06-06T12:14:18Z] 3 errors occurred:
	* No metadata/userdata found. Bye
	* No metadata/userdata found. Bye
	* exit status 1

I guess it has to run before the partitions are mounted (?)

@jimmykarily
Copy link
Contributor

jimmykarily commented Jun 6, 2023

When I run with -debug I can at least see that it tried to run the right commands:

DEBU[2023-06-06T12:39:52Z] Reading '/system/oem/00_rootfs.yaml'         
DEBU[2023-06-06T12:39:52Z] Executing stage 'Rootfs Layout Settings.Grow persistent' 
DEBU[2023-06-06T12:39:52Z] {"sysinfo":{"version":"0.9.5","timestamp":"2023-06-06T12:39:06.151664546Z"},"node":{"hostname":"localhost","machineid":"20af309a8948da12ebae458a647f25d8","hypervisor":"kvm","timezone":"Etc/UTC"}, 
DEBU[2023-06-06T12:39:52Z] running command `[ ! -f /run/cos/recovery_mode ] && [ ! -f /run/cos/live_mode ]` 
DEBU[2023-06-06T12:39:52Z] If statement result                          
INFO[2023-06-06T12:39:52Z] Processing stage step 'Grow persistent'. ( commands: 0, files: 0, ... ) 
DEBU[2023-06-06T12:39:52Z] Stage: {"Commands":null,"Files":null,"Downloads":null,"Directories":null,"If":"[ ! -f /run/cos/recovery_mode ] \u0026\u0026 [ ! -f /run/cos/live_mode ]","EnsureEntities":null,"DeleteEntities":nul 
DEBU[2023-06-06T12:39:52Z] Running cmd: 'udevadm settle'                
INFO[2023-06-06T12:39:52Z] Extending last partition up to 0 MiB         
DEBU[2023-06-06T12:39:52Z] Running cmd: 'parted --script --machine -- /dev/vda unit s print' 
DEBU[2023-06-06T12:39:52Z] Running cmd: 'parted --script --machine -- /dev/vda unit s rm 5 mkpart persistent  48369664 100%' 
ERRO[2023-06-06T12:39:52Z] Warning: Partition /dev/vda5 is being used. Are you sure you want to continue? 
ERRO[2023-06-06T12:39:52Z] exit status 1  

This doesn't seem to be triggered on boot though. I can't find any indication that this stage was run automatically during boot.

@jimmykarily
Copy link
Contributor

ok adding rd.immucore.debug to the cmdline produces this:

[    9.198883] immucore[708]: time="2023-06-06T12:53:03Z" level=info msg="Processing stage step 'Grow persistent'. ( commands: 0, files: 0, ... )\n"
[    9.199572] immucore[708]: time="2023-06-06T12:53:03Z" level=info msg="Extending last partition up to 0 MiB"
[    9.200091] immucore[708]: time="2023-06-06T12:53:03Z" level=error
[    9.200426] immucore[708]: time="2023-06-06T12:53:03Z" level=error msg="not enough free space (1) to expand, at least 20480 is required"

I got it reproduced now :) I'll start debugging.

@jimmykarily
Copy link
Contributor

The different behavior between kairos-agent run-stage rootfs and immucore maybe happens because they use a different implementation of a "layout plugin":

kairos-agent fails because it sees the partition being used, immucore fails because it thinks there isn't enough space left. I'm digging more.

@jimmykarily
Copy link
Contributor

This is what immucore sees:

dev.parts = [{Number:1 StartS:0 SizeS:77457408 PLabel: FileSystem:}]

exactly here: https://github.com/kairos-io/elemental-cli/blob/20e40e0256fada8a42ec543a317c8675e7cb082f/pkg/partitioner/disk.go#L343

I'm in dracut emergency shell (rd.immucore.debug rd.shell rd.break=pre-pivot) a for some reason parted doesn't work in Ubuntu ("Segmentation fault"). I was working in opensuse but I had to switch to Ubuntu because the opensuse servers were down (again). I'm not sure which partition is the one listed above. This is blkid:

sh-5.2# blkid
[  194.361287] I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[  194.367760] floppy: error 10 while reading block 0
/dev/vda4: LABEL="COS_STATE" UUID="050767da-bc52-4e39-811a-cb8389eeb212" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="state" PARTUUID="af24b4a2-0c8b-4611-a5fe-62e190b1bb97"
/dev/vda2: LABEL="COS_OEM" UUID="a7fbd232-9ecc-450d-80e2-34691d77e1f1" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="oem" PARTUUID="3bf5f80a-1a2f-45a2-9f73-18a9a642c2cc"
/dev/vda5: LABEL="COS_PERSISTENT" UUID="056f5d55-cbb8-4438-b224-1e88b34bcaba" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="persistent" PARTUUID="d99c56e5-6617-4da2-96b1-5a93daf0109c"
/dev/sr0: BLOCK_SIZE="2048" UUID="2023-06-07-14-11-36-00" LABEL="COS_LIVE" TYPE="iso9660" PTTYPE="dos"
/dev/loop0: LABEL="COS_ACTIVE" UUID="d39a97e8-9ffd-49d8-80fc-41121c414ce3" BLOCK_SIZE="4096" TYPE="ext2"
/dev/vda3: LABEL="COS_RECOVERY" UUID="fd7ce352-17a6-43c5-bfbe-a3af739a1835" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="recovery" PARTUUID="ac7e7c0f-122a-4943-9026-78890149251e"
/dev/vda1: PARTLABEL="bios" PARTUUID="335c1173-6df1-49dd-be34-406b2092eacf"

@jimmykarily
Copy link
Contributor

jimmykarily commented Jun 7, 2023

I wonder if it's related to the bug we fixed here: kairos-io/kairos-agent@5017d51 (e.g. tried to expand before partitions were created).

We never fixed that in the immucore layout plugin, only in the kairos-agent. 🤔

@jimmykarily
Copy link
Contributor

The size of the one partition seen by immucore

dev.parts = [{Number:1 StartS:0 SizeS:77457408 PLabel: FileSystem:}]

matches the size of persistent partition (77457408s):

(parted) unit s
(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 125829120s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start      End         Size       File system  Name        Flags
 1      2048s      4095s       2048s                   bios        bios_grub
 2      4096s      135167s     131072s    ext4         oem
 3      135168s    16912383s   16777216s  ext4         recovery
 4      16912384s  48369663s   31457280s  ext4         state
 5      48369664s  125827071s  77457408s  ext4         persistent

The starting sector doesn't match though.

@jimmykarily
Copy link
Contributor

This is the parted print immucore sees:

prnt = BYT;
/dev/vda5:77457408s:virtblk:512:512:loop:Virtio Block Device:;
1:0s:77457407s:77457408s:ext4::;

this is what I get when I run the same parted command manually:

sh-4.4# parted --script --machine -- /dev/vda unit s print
BYT;
/dev/vda:125829120s:virtblk:512:512:gpt:Virtio Block Device:;
1:2048s:4095s:2048s::bios:bios_grub;
2:4096s:135167s:131072s:ext4:oem:;
3:135168s:16912383s:16777216s:ext4:recovery:;
4:16912384s:48369663s:31457280s:ext4:state:;
5:48369664s:125827071s:77457408s:ext4:persistent:;

and this is when I run parted using the last partition name:

sh-4.4# parted --script --machine -- /dev/vda5 unit s print
BYT;
/dev/vda5:77457408s:virtblk:512:512:loop:Virtio Block Device:;
1:0s:77457407s:77457408s:ext4::;

I think immucore is somehow passing the partition device path, not the disk one. I'll try to verify

@jimmykarily
Copy link
Contributor

Yes, that's the issue: https://github.com/kairos-io/immucore/blob/0811f0f054b086708727a441988d3e93905838a1/internal/utils/layout_plugin.go#L26-L32

While kairos-agent is passing the disk: https://github.com/kairos-io/kairos-agent/blob/acff689bea1c42695240b0e7438873d846920eb1/pkg/cloudinit/layout_plugin.go#L59

And then there is the yip implementation (not used anywhere): https://github.com/mudler/yip/blob/7b3e0174fa3ff75da052cc7e90d03f9d9ca9fe58/pkg/plugins/layout.go#L55

I think we should adapt the yip implementation if needed and use it both in immucore and kairos-agent. @Itxaka what do you think?

@Itxaka
Copy link
Member

Itxaka commented Jun 8, 2023

Yes, that's the issue: https://github.com/kairos-io/immucore/blob/0811f0f054b086708727a441988d3e93905838a1/internal/utils/layout_plugin.go#L26-L32

While kairos-agent is passing the disk: https://github.com/kairos-io/kairos-agent/blob/acff689bea1c42695240b0e7438873d846920eb1/pkg/cloudinit/layout_plugin.go#L59

And then there is the yip implementation (not used anywhere): https://github.com/mudler/yip/blob/7b3e0174fa3ff75da052cc7e90d03f9d9ca9fe58/pkg/plugins/layout.go#L55

I think we should adapt the yip implementation if needed and use it both in immucore and kairos-agent. @Itxaka what do you think?

That would be awesome, so we can drop that plugin for both places and just use the upstream implementation.

Especially now that we are tracking the latest yip version as before we could not bump it due to yip changing it's execution model and breaking our stuff, but that is now solved, we should be able to use the upstream yip as is

Very nice find!

@jimmykarily
Copy link
Contributor

I created a quick fix in case we want to include the fix in some release: https://github.com/kairos-io/immucore/compare/1448-resizefs

I tested manually and it works.

I will work on the refactoring in the meantime.

@jimmykarily
Copy link
Contributor

Preparation PR: mudler/yip#96

@jimmykarily
Copy link
Contributor

I created this PR to run tests using the yip implementation and run tests with it: #1497

@Itxaka
Copy link
Member

Itxaka commented Jul 12, 2023

did a quick test with v2.3.0: the volume did not get expanded, after boot... used kairos-opensuse-leap-arm-rpi:v2.3.0-k3sv1.26.6-k3s1... don't have time to look deeper into it...

will have a test if my rpi doesnt burst into flames....

@Itxaka
Copy link
Member

Itxaka commented Jul 12, 2023

blergh, cant even get it too boot, my usb is broken. @mauromorales will you be able to test this with me?

@mauromorales
Copy link
Member

Does not seem to work with an SD. The stage runs but errors:

journalctl -u kairos-agent
Jul 12 11:59:21 localhost systemd[1]: Started kairos agent.
Jul 12 11:59:21 localhost kairos-agent[1473]: WARNING: jsonschema: '' does not validate with file:///schema.json#/required: missing properties: 'users'
Jul 12 11:59:21 localhost kairos-agent[1473]: [provider event: agent.bootstrap] no kairos or k3s configuration. nothing to do: #cloud-config
Jul 12 11:59:21 localhost kairos-agent[1473]: name: Configure persistent dirs bind-mounts
Jul 12 11:59:21 localhost kairos-agent[1473]: stages:
Jul 12 11:59:21 localhost kairos-agent[1473]:     initramfs:
Jul 12 11:59:21 localhost kairos-agent[1473]:         - name: Set default user/pass
Jul 12 11:59:21 localhost kairos-agent[1473]:           users:
Jul 12 11:59:21 localhost kairos-agent[1473]:             kairos:
Jul 12 11:59:21 localhost kairos-agent[1473]:                 passwd: kairos
Jul 12 11:59:21 localhost kairos-agent[1473]:     resizefs:
Jul 12 11:59:21 localhost kairos-agent[1473]:         - layout:
Jul 12 11:59:21 localhost kairos-agent[1473]:             device:
Jul 12 11:59:21 localhost kairos-agent[1473]:                 label: COS_PERSISTENT
Jul 12 11:59:21 localhost kairos-agent[1473]:             expand_partition:
Jul 12 11:59:21 localhost kairos-agent[1473]:                 size: 0
Jul 12 11:59:21 localhost kairos-agent[1473]:           name: Grow persistent
Jul 12 11:59:21 localhost systemd[1]: kairos-agent.service: Deactivated successfully.
cat /run/immucore/rootfs_stage.log 
time="2023-04-06T12:00:11Z" level=info msg="Running stage: rootfs.before\n"
time="2023-04-06T12:00:11Z" level=info msg="Processing stage step 'Pull data from provider'. ( commands: 0, files: 0, ... )"
time="2023-04-06T12:00:11Z" level=error msg="no metadata/userdata found"
time="2023-04-06T12:00:11Z" level=info msg="Processing stage step 'Sentinel file for userdata'. ( commands: 0, files: 1, ... )"
time="2023-04-06T12:00:11Z" level=info msg="Done executing stage 'rootfs.before'\n"
time="2023-04-06T12:00:11Z" level=info msg="Running stage: rootfs\n"
time="2023-04-06T12:00:11Z" level=warning msg="(conditional) Skip 'Skipping stage (if statement error: failed to run [ ! -e \"/sbin/systemctl\" ] && [ ! -e \"/usr/bin/systemctl\" ] && [ ! -e \"/usr/sbin/systemctl\" ] && [ ! -e \"/usr/bin/systemctl\" ]: exit status 1)' stage name: Mount BPF on Alpine systems"
time="2023-04-06T12:00:11Z" level=info msg="Processing stage step 'Layout configuration for active/passive mode'. ( commands: 0, files: 0, ... )"
time="2023-04-06T12:00:11Z" level=warning msg="(conditional) Skip 'Skipping stage (if statement error: failed to run [ -f \"/run/cos/recovery_mode\" ]: exit status 1)' stage name: Layout configuration for recovery mode"
time="2023-04-06T12:00:11Z" level=warning msg="(conditional) Skip 'Skipping stage (if statement error: failed to run grep -q \"kairos.boot_live_mode\" /proc/cmdline: exit status 1)' stage name: Layout configuration for booting local node from livecd"
time="2023-04-06T12:00:11Z" level=warning msg="(conditional) Skip 'Skipping stage (if statement error: failed to run [ -e \"/run/cos/uki_mode\" ]: exit status 1)' stage name: Layout configuration for UKI"
time="2023-04-06T12:00:11Z" level=info msg="Done executing stage 'rootfs'\n"
time="2023-04-06T12:00:11Z" level=info msg="Running stage: rootfs.after\n"
time="2023-04-06T12:00:11Z" level=warning msg="(conditional) Skip 'Skipping stage (if statement error: failed to run [ -r /run/cos/custom-layout.env ] && [ ! -f \"/run/cos/recovery_mode\" ] && [ ! -f /run/cos/live_mode ]: exit status 1)' stage name: add custom bind and ephemeral mounts to /run/cos/cos-layout.env"
time="2023-04-06T12:00:11Z" level=info msg="Processing stage step 'Grow persistent'. ( commands: 0, files: 0, ... )"
time="2023-04-06T12:00:11Z" level=info msg="Extending last partition to max space"
time="2023-04-06T12:00:11Z" level=error
time="2023-04-06T12:00:11Z" level=error msg="failed to run sgdisk -P -d=4 -n=4:21635072:+0 -c=4:Linux filesystem -t=4:8300 /dev/mmcblk0: exit status 2"
time="2023-04-06T12:00:11Z" level=info msg="Done executing stage 'rootfs.after'\n"
time="2023-04-06T12:00:11Z" level=info msg="Running stage: rootfs.before\n"
time="2023-04-06T12:00:11Z" level=info msg="Done executing stage 'rootfs.before'\n"
time="2023-04-06T12:00:11Z" level=info msg="Running stage: rootfs\n"
time="2023-04-06T12:00:11Z" level=info msg="Done executing stage 'rootfs'\n"
time="2023-04-06T12:00:11Z" level=info msg="Running stage: rootfs.after\n"
time="2023-04-06T12:00:11Z" level=info msg="Done executing stage 'rootfs.after'\n"

@mauromorales
Copy link
Member

for RPi it only works when passing -g to sgdisk

g, --mbrtogpt
              Convert an MBR or BSD disklabel disk to a GPT disk. As a safety measure,  use  of  this
              option is required on MBR or BSD disklabel disks if you intend to save your changes, in
              order to prevent accidentally damaging such disks.

@mauromorales mauromorales reopened this Jul 12, 2023
@github-project-automation github-project-automation bot moved this from Done ✅ to Under review 🔍 in 🧙Issue tracking board Jul 12, 2023
@mauromorales
Copy link
Member

I've reopened but if you guys prefer another ticket for RPi just let me know

@mauromorales mauromorales moved this from Under review 🔍 to In Progress 🏃 in 🧙Issue tracking board Jul 12, 2023
@Itxaka
Copy link
Member

Itxaka commented Jul 12, 2023

this is ok for me

Alos I added a pr for osbuilder to make sure we create real gpt images: kairos-io/osbuilder#66

@mauromorales mauromorales moved this from In Progress 🏃 to Todo 🖊 in 🧙Issue tracking board Jul 12, 2023
@mauromorales mauromorales moved this to In Progress 🏃 in 🧙Issue tracking board Jul 12, 2023
@Itxaka
Copy link
Member

Itxaka commented Jul 14, 2023

After the Patch linke was merged, and bumped on kairos to use that newer version, I cna confirm that partition was extended:

time="2023-04-06T12:00:14Z" level=info msg="Processing stage step 'Grow persistent'. ( commands: 0, files: 0, ... )"
time="2023-04-06T12:00:16Z" level=info msg="Extending last partition to max space"



Disk /dev/sda: 58.59 GiB, 62914560000 bytes, 122880000 sectors
Disk model: PHILIPS         
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F6358B22-2755-D446-960D-252904FBB1AE

Device        Start       End   Sectors  Size Type
/dev/sda1      8192    204799    196608   96M Microsoft basic data
/dev/sda2    204800  12902399  12697600  6.1G Linux filesystem
/dev/sda3  12902400  21635071   8732672  4.2G Linux LVM
/dev/sda4  21635072 122877952 101242881 48.3G Linux filesystem

@Itxaka
Copy link
Member

Itxaka commented Jul 18, 2023

Unfortunately for rpi systems there is no choice if we support rpi3.

rpi3 supports only MBR disks
our expansion plugin can only work in GPT disks
hence, no expansion automatically for rpi images.

We are looking for a solution, including:

  • dropping rpi3 support
  • adding docs on how to manually do this
  • creating a different image for rpi3/rpi4 and support expanding under rpi4 only

@Itxaka Itxaka moved this from In Progress 🏃 to Todo 🖊 in 🧙Issue tracking board Jul 18, 2023
@jimmykarily
Copy link
Contributor

Poll shows that pi3 is still used out there: #1608

Let's do the third option above: different images for the 2 boards.
This case is already covered by our naming strategy: #1109

@jimmykarily
Copy link
Contributor

jimmykarily commented Jul 24, 2023

To summarize this otherwise huge issue:

Currently, resizing works an all non-arm platforms. Although pi4 could work, we don't differentiate in the code between rpi 3 and 4 and we just don't resize (because the plugin doesn't support MBR which is what rpi3 supports only).

Let's close this issue in favor of:

@github-project-automation github-project-automation bot moved this from Todo 🖊 to Done ✅ in 🧙Issue tracking board Jul 24, 2023
jimmykarily added a commit to kairos-io/packages that referenced this issue Aug 28, 2023
mauromorales pushed a commit to kairos-io/packages that referenced this issue Aug 29, 2023
* Automatically expand persistent partition on RPI 4

Fixes: kairos-io/kairos#1762
and: kairos-io/kairos#1448

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Bump overlay file version to release the package

Signed-off-by: Dimitris Karakasilis <[email protected]>

---------

Signed-off-by: Dimitris Karakasilis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

5 participants