Initramfs failure during update. Now have to reflash

So I ssh’ed into my L5 and did

  • sudo apt update
  • sudo apt upgrade

One of the changes was a new kernel. The initramfs initialization step failed at the end. Last time I had this I tried to fix it and bricked the phone and had to reflash. This time, I rebooted and it won’t start. I got past the step where I entered the encryption passphrase for the hard disk but after that nothing. So it looks like I have to reflash again.

Any idea how I can avoid this in the future? Also, BTW, I was continually getting a warning about not enough space (180MB) on root partition. So can I adjust the partition sizes in the flash installation script since I have to reflash anyway?

Hopefully I won’t have to reflash every time there is a new kernel.

Thanks.

I don’t think you can adjust the partition size during installation (it’s burned into the image), but you could resize it using Jumpdrive.

As for the future, we’re working on reducing the initramfs size, so that things won’t run out of space.

Reflashing is not strictly necessary, it’s just simplest. One of the uuu scripts in the flasher repository will boot your L5 with a selected kernel. You need to know what kernel version you had and then edit the script, but I managed to recover my L5 like this at least twice. Sadly, I don’t remember which script it was.

2 Likes

When I updated (Pure Store) some days ago, it was only Millipixels (or Lollypop?).
It failed, saying no space on /boot. I scratched my head why boot would even be touched.
But I solved it with “apt autoremove” which removed the 5.13 kernel, leaving 5.15 and 5.16.
I assume it’s on purpose that a backup kernel stays installed, but the autoremove should be automatic when using the UI for updates.

I now have 105MB available. Wondering whether I should remove one more kernel before the next update.

We are working to make the next kernel updates to take less space in the boot partition.
I assume that you are using full disk encryption. The package osk-sdl the virtual keyboard that allows to type the LUKS passphrase takes some space in the /boot partition. We are working to reduce it.

3 Likes

On Ubuntu

  • it automatically keeps one previous kernel (seems a good idea to me) and any older kernels are candidates for ‘autoremove’
  • nothing is ever automatically removed - the update UI asks whether you would like ‘autoremove’ to occur (when there is something to remove, which there typically will be after a new kernel is installed)
1 Like

I’ve had the same problem and the /boot partition went full, see No space left on device while update-initramfs
I had to remove the 5.13 kernel (see there) and now I only have the 5.16 one:

purism@pureos:~$ ls -l /boot
total 251153
-rw-r--r-- 1 root root     2328 Jan 23 07:12 boot.scr
-rw-r--r-- 1 root root     2328 Jan 23 02:18 boot.scr.bak
-rw-r--r-- 1 root root   187855 Jan 17 11:33 config-5.16.0-1-librem5
lrwxrwxrwx 1 root root       53 Jan 23 07:12 dtb -> dtbs/5.16.0-1-librem5/freescale/imx8mq-librem5-r4.dtb
lrwxrwxrwx 1 root root       53 Jan 23 07:12 dtb-5.16.0-1-librem5 -> dtbs/5.16.0-1-librem5/freescale/imx8mq-librem5-r4.dtb
drwxr-xr-x 5 root root     1024 Jan 23 02:17 dtbs
drwxr-xr-x 2 root root     1024 Jul 13  2021 grub
-rw-r--r-- 1 root root 64325755 Jan 23 07:12 initrd.img
-rw-r--r-- 1 root root 64325755 Jan 23 07:12 initrd.img-5.16.0-1-librem5
-rw-r--r-- 1 root root 64325426 Jan 23 02:18 initrd.img.bak
drwx------ 2 root root    12288 Sep 11 07:31 lost+found
-rw-r--r-- 1 root root  4941866 Jan 17 11:33 System.map-5.16.0-1-librem5
-rw-r--r-- 1 root root 24610824 Jan 23 07:12 vmlinuz
-rw-r--r-- 1 root root  8815340 Jan 17 11:33 vmlinuz-5.16.0-1-librem5
-rw-r--r-- 1 root root 24610824 Jan 23 02:18 vmlinuz.bak
purism@pureos:~$ df -kh /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1  451M  248M  180M  59% /boot

Still, Purism aims to make devices that can be used by non-techies. Even for advanced users, having to open a terminal on a phone just to clean up boot is not ideal. I’m okay with being asked “To make space for this system update, old unused packages need to be removed [packages: kernel 5.13]”.
Something like that :slight_smile:

2 Likes

On Ubuntu that behaviour applies to both UIs i.e. terminal when you do apt upgrade or GUI - either way it tells you when apt autoremove would remove something and prompts you in some way about it.

(In the case of the GUI, the update itself by default includes updating anything that needs updating and removing anything that autoremove would remove, but you can uncheck whatever you want in either the update section or the remove section.)

For non-techies it would probably be best to click OK without unchecking anything i.e. one click automation and leave it to the operating system.

1 Like

Thanks for posting this. I was unable to update.

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-5.16.0-1-librem5 with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1  451M  398M   30M  94% /boot

After autoclean/autoremove, got my space back and the update-initramfs process automatically kicked off, and this time, completed successfully.

/dev/mmcblk0p1  451M  323M  105M  76% /boot

I had tried the UI (PureOS Store) and it did not accomplish what the autoremove did.

2 Likes

ETA?
autoremove just moved the cursor to a blank spot on the cmd lines…It still shows 0 space. FYI, I tried the other magic potions with no success.

Following is DETAILS for FYI.
Have a crazy Alert:

Notifications
Disk Space:
Low Disk Space on boot"
The volume “Boot” has only 0 bytes disk space remaining
Ignore

I am not at all familiar yet with Pure OS nuances and have been unable find a “drive” with any “boot” on it. I have a 64G card in it on top of the phones default.

I wonder if space needed on boot was chipped away at via inbound images in chat. Looking to see a easy way to preview each file in “Pictures” folder, much like Win with icons dressed to use the image and make a small icon of the image - a preview?

Heads Up:

only does a magic trick removing the cursor and line prompt in Terminal.

~s

When I view the contents of the Pictures folder in the Files app, I see thumbnail views of my pictures without having to open each one. You don’t?

What are you viewing w/ amarok?

Correct I don’t.
DETAILS:
When I use “Files” (file browser) to view list of images, I just see the micro-print (wee-tiny font size). Images all have the same generic default icon.(AKA here “thumbnail”)
It’s why I use a hub to incorporate keyboard/mouse/monitor. I can read them. Except the WpordPress fad of very, very light grey on white background.

I want to save the images I need, and maybe a doc or 2 before Flashing
Maybe the best thing is just to back up the whole 254 images to external drive. and operate using a different OS and tool. It’s taken way too long as it is.

~s

Using the default Files app (also called nautilus), click on the 3-dot/3-line button at the bottom right of the Files app user interface (UI). That switches the display between list view and icon view.

Then click the 3-line “hamburger” menu at the top right of the Files UI. Select Preferences, scroll down to Performance, Show Thumbnails, and select All Files.

If you need to increase the size of the thumbnails for better viewing, use the Ctrl and + keys to enlarge. (Ctrl and - keys to make smaller.) Don’t forget to deactivate the Ctrl key after, as it’s sticky.

That should do it.

An alternate Files app, called nemo behaves similarly. I have both installed.

EDIT: If you don’t see the Ctrl key on the on-screen keyboard, then click the “globe” button and choose “Terminal” view.

P.S. The .dng (Digital Negative) files will not have a thumbnail view. A .dng file is generated for each .jpg file, and contains info that can be used to manipulate the raw image into a better photo. Keep the corresponding .dng files for the images you save, if you think you might use them someday. The .dng file names are numbered the same as the .jpg files, unless you’ve renamed them.

4 Likes