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
diff --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
index 440b2e4..4e432c3 100644
--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata
+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata
@@ -114,8 +114,7 @@ write_files:
114# use gdisk to fix GPT partition table to span the whole disk114# use gdisk to fix GPT partition table to span the whole disk
115# http://askubuntu.com/questions/446991/gparted-claims-whole-hard-drive-is-unallocated-and-gives-warning-about-gpt-table115# http://askubuntu.com/questions/446991/gparted-claims-whole-hard-drive-is-unallocated-and-gives-warning-about-gpt-table
116# then create new ~ 80 GB partition and mount it as /srv116# then create new ~ 80 GB partition and mount it as /srv
117# use compat_uts_machine=armv7l so that 'linux32 uname -m' shows armv7l, like the buildds117bootcmd:
118runcmd:
119 - printf 'x\ne\nw\ny\n' | gdisk /dev/sda118 - printf 'x\ne\nw\ny\n' | gdisk /dev/sda
120 - printf "d\n1\nn\n\n\n+8000M\n\n\nw\ny\n" | gdisk /dev/sda119 - printf "d\n1\nn\n\n\n+8000M\n\n\nw\ny\n" | gdisk /dev/sda
121 - partprobe120 - partprobe
@@ -125,6 +124,8 @@ runcmd:
125 - echo 'mkpart primary btrfs 8495MB 100%\n' | parted /dev/sda124 - echo 'mkpart primary btrfs 8495MB 100%\n' | parted /dev/sda
126 - for timeout in `seq 10`; do [ -e /dev/sda2 ] && break; sleep 1; done125 - for timeout in `seq 10`; do [ -e /dev/sda2 ] && break; sleep 1; done
127126
127# use compat_uts_machine=armv7l so that 'linux32 uname -m' shows armv7l, like the buildds
128runcmd:
128 - mkfs.btrfs -L autopkgtest /dev/sda2129 - mkfs.btrfs -L autopkgtest /dev/sda2
129 - systemctl stop snap.lxd.daemon.service snap.lxd.daemon.unix.socket130 - systemctl stop snap.lxd.daemon.service snap.lxd.daemon.unix.socket
130 - echo 'LABEL=autopkgtest /srv btrfs defaults 0 0' >> /etc/fstab131 - echo 'LABEL=autopkgtest /srv btrfs defaults 0 0' >> /etc/fstab

Subscribers

People subscribed via source and target branches