Ultimately, I’m trying to build an Ubuntu Core image for an Atmel SAMA5D36-based dev-kit. Since this is my first foray into Snappy, I figured I’d start with a Raspberry Pi 3 first, since it’s officially supported. I’ve managed to get Ubuntu Core up and running just fine on the Pi3, had a bit of a play with it, and am happy enough that it’s working.
Next, I thought I would try and build my own image for the Pi3, and then apply that knowledge to the Atmel board. Following the guide on the Ubuntu docs site, I thought I would try build first using a Canonical signed model assertion just to check I had everything in place to build and run Ubuntu Core on the Pi3.
I have ubuntu-image
installed from a Snap package.
$ mkdir pi3snap
$ cd pi3snap/
$ snap known --remote model series=16 brand-id=canonical model=pi3 > pi3.model
$ sudo ubuntu-image snap -c beta pi3.model
I added the snap
keyword to the ubuntu-image
command, since the docs seem to be slightly out-of-date - but other than that the command seems to be correct.
It starts running, downloads the pieces, but then crashes with this:
Fetching core
Fetching pi2-kernel
Fetching pi3
COMMAND FAILED: sudo cp -dR --preserve=mode,timestamps,ownership /tmp/tmpac3_hgzw/root/* /tmp/tmpjhuelyyw/root-mount
cp: error writing '/tmp/tmpjhuelyyw/root-mount/system-data/var/lib/snapd/snaps/core_4020.snap': No space left on device
cp: error writing '/tmp/tmpjhuelyyw/root-mount/system-data/var/lib/snapd/snaps/pi2-kernel_50.snap': No space left on device
cp: cannot create directory '/tmp/tmpjhuelyyw/root-mount/system-data/var/lib/snapd/seed': No space left on device
cp: cannot create directory '/tmp/tmpjhuelyyw/root-mount/system-data/boot': No space left on device
Crash in state machine
Traceback (most recent call last):
File "/snap/ubuntu-image/98/lib/python3/site-packages/ubuntu_image/__main__.py", line 341, in main
list(state_machine)
File "/snap/ubuntu-image/98/lib/python3/site-packages/ubuntu_image/state.py", line 82, in __next__
step()
File "/snap/ubuntu-image/98/lib/python3/site-packages/ubuntu_image/common_builder.py", line 337, in populate_filesystems
self._populate_one_volume(name, volume)
File "/snap/ubuntu-image/98/lib/python3/site-packages/ubuntu_image/common_builder.py", line 290, in _populate_one_volume
preserve_ownership=True)
File "/snap/ubuntu-image/98/lib/python3/site-packages/ubuntu_image/helpers.py", line 211, in mkfs_ext4
preserve_flags, contents_dir, mountpoint), shell=True)
File "/snap/ubuntu-image/98/lib/python3/site-packages/ubuntu_image/helpers.py", line 112, in run
proc.check_returncode()
File "/snap/ubuntu-image/98/usr/lib/python3.5/subprocess.py", line 349, in check_returncode
self.stderr)
subprocess.CalledProcessError: Command 'sudo cp -dR --preserve=mode,timestamps,ownership /tmp/tmpac3_hgzw/root/* /tmp/tmpjhuelyyw/root-mount' returned non-zero exit status 1
There’s no way I don’t have enough disk space:
Filesystem Size Used Avail Use% Mounted on
udev 7.8G 0 7.8G 0% /dev
tmpfs 1.6G 9.7M 1.6G 1% /run
/dev/sda1 432G 270G 146G 65% /
tmpfs 7.8G 136M 7.7G 2% /dev/shm
tmpfs 5.0M 8.0K 5.0M 1% /run/lock
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/loop0 84M 84M 0 100% /snap/core/3604
...
/dev/loop5 84M 84M 0 100% /snap/core/3748
/dev/loop1 82M 82M 0 100% /snap/core/3887
/dev/loop7 33M 33M 0 100% /snap/ubuntu-image/98
/dev/nvme0n1p4 227G 179G 48G 79% /mnt/windows
/dev/nvme0n1p2 356M 77M 280M 22% /boot/efi
/dev/sda1 432G 270G 146G 65% /home
...
tmpfs 1.6G 540K 1.6G 1% /run/user/1000
/dev/loop8 55M 55M 0 100% /snap/snapcraft/1094
Once when trying this and spamming df -h
, I got this: /dev/loop8 3.9M 52K 3.3M 2% /tmp/tmpvn70tzdq/root-mount
, seemingly suggesting that the loop device being created is only 3.9 MB.
What’s going on here? Am I doing something wrong or is this a bug? I’ve tried it from two machines, one with 16.04 and one with 17.10 - both have the same issue.