Merge ~paride/autopkgtest-cloud:eary-partition-setup into autopkgtest-cloud:master

Proposed by Paride Legovini
Status: Merged
Merged at revision: bd0fd3b95706535af08d12dad5481cc99c10b51b
Proposed branch: ~paride/autopkgtest-cloud:eary-partition-setup
Merge into: autopkgtest-cloud:master
Diff against target: 23 lines (+3/-2)
1 file modified
charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata (+3/-2)
Reviewer Review Type Date Requested Status
Brian Murray Approve
Ubuntu Release Team Pending
Review via email: mp+439540@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paride Legovini (paride) wrote :

Tested by following the steps to create a new arm64 node. Seems to be working fine:

# cloud-init status
status: done

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 9.4G 3.5G 6.0G 37% /

Revision history for this message
Brian Murray (brian-murray) wrote :

My testing of this doesn't actually show the btrfs partition being created specifically I see no evidence that the following commands ran:

 - echo 'mkpart primary btrfs 8495MB 100%\n' | parted /dev/sda
 - for timeout in `seq 10`; do [ -e /dev/sda2 ] && break; sleep 1; done

 - mkfs.btrfs -L autopkgtest /dev/sda2

I checked /dev/sda using fdisk and parted.

review: Needs Information
Revision history for this message
Brian Murray (brian-murray) wrote :

> My testing of this doesn't actually show the btrfs partition being created
> specifically I see no evidence that the following commands ran:
>
> - echo 'mkpart primary btrfs 8495MB 100%\n' | parted /dev/sda
> - for timeout in `seq 10`; do [ -e /dev/sda2 ] && break; sleep 1; done
>
> - mkfs.btrfs -L autopkgtest /dev/sda2
>
> I checked /dev/sda using fdisk and parted.

Oh it actually works with the original sizes, so this is on me.

Revision history for this message
Paride Legovini (paride) wrote :

It doesn't work with the increased btrfs partition size because of the wrong padding between partitions (the thing I was mentioning on MM). I get output similar to this from parted (it's in the cloud-init logs):

Warning: You requested a partition from 10.0GB to 107GB (sectors
19531250..209715199).
The closest location we can manage is 10.6GB to 107GB (sectors
20686848..209715166).

and then the partition is *not* created. By manually trying I found out that a 600MB padding works with a 10GB root partition:

- echo 'mkpart primary btrfs 10600MB 100%\n' | parted /dev/sda

This is kind of ugly and arbitrary, the difference may be due to one tool using MB and the other MiB.

Revision history for this message
Brian Murray (brian-murray) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata
2index 440b2e4..4e432c3 100644
3--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata
4+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata
5@@ -114,8 +114,7 @@ write_files:
6 # use gdisk to fix GPT partition table to span the whole disk
7 # http://askubuntu.com/questions/446991/gparted-claims-whole-hard-drive-is-unallocated-and-gives-warning-about-gpt-table
8 # then create new ~ 80 GB partition and mount it as /srv
9-# use compat_uts_machine=armv7l so that 'linux32 uname -m' shows armv7l, like the buildds
10-runcmd:
11+bootcmd:
12 - printf 'x\ne\nw\ny\n' | gdisk /dev/sda
13 - printf "d\n1\nn\n\n\n+8000M\n\n\nw\ny\n" | gdisk /dev/sda
14 - partprobe
15@@ -125,6 +124,8 @@ runcmd:
16 - echo 'mkpart primary btrfs 8495MB 100%\n' | parted /dev/sda
17 - for timeout in `seq 10`; do [ -e /dev/sda2 ] && break; sleep 1; done
18
19+# use compat_uts_machine=armv7l so that 'linux32 uname -m' shows armv7l, like the buildds
20+runcmd:
21 - mkfs.btrfs -L autopkgtest /dev/sda2
22 - systemctl stop snap.lxd.daemon.service snap.lxd.daemon.unix.socket
23 - echo 'LABEL=autopkgtest /srv btrfs defaults 0 0' >> /etc/fstab

Subscribers

People subscribed via source and target branches