live system: initramfs unpacking failed: Decoding failed

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
luigi_70
Level 1
Level 1
Posts: 1
Joined: Thu Apr 15, 2021 2:46 pm

live system: initramfs unpacking failed: Decoding failed

Post by luigi_70 »

Hello to everybody

I'm also experiencing the "initramfs unpacking failed" while trying to boot my desktop PC with a linuxmint20.1-cinnamon-64bit USB installation drive.
My problem is that the PC is brand new, so no /etc/initramfs-tools/initramfs.conf on the disk to modify. In the filesystem on the USB drive I see no /etc folder, so I'm struck.

I guess I have 2 options:
1 - Install mint19 on the PC (I tried a linuxmint19-cinnamon USB drive on the same PC and it works), then upgrade to mint 20.1
2 - Modify some conf file (or something else?) on the Mint 20 USB drive and make it boot the PC.

Although an upgrade from a fresh 19 installation should go smooth and would be an excellent exercise for a mint newbie like me, I would prefer the option #2, but I don't know how to "change COMPRESS=lz4 to COMPRESS=gzip".

Can anyone please help me?

The PC is Asrock B560M-HDV MB + Intel i3-10100.

Thanks a lot
PS: I'm not native English, so forgive my mistakes
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pjotr
Level 24
Level 24
Posts: 20116
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: live system: initramfs unpacking failed: Decoding failed

Post by Pjotr »

Try installing with the Edge iso:
http://mirror.cs.jmu.edu/pub/linuxmint/ ... t-edge.iso

After (hopefully) successful installation, do this:
https://easylinuxtipsproject.blogspot.c ... .html#ID26
(item 26)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
bodge99

Re: live system: initramfs unpacking failed: Decoding failed

Post by bodge99 »

Hi,

The "change COMPRESS=lz4 to COMPRESS=gzip" you are referring to is a line in 'initramfs.conf' which is located in /etc/initramfs-tools/.
However, this is referring to an installed system. The Live system works somewhat differently.

The initrd unpack failure can be caused by other things such as having Intel RST (Rapid Store Technology) enabled, if your machine has it. Also having something like Bitlocker in Windows can cause this problem.

There is a known minor problem with the initramfs compression setup on the Live Iso at this time which affects some folk. This appears to be an Ubuntu bug.
I've been meaning to look at this properly but, for me, it was low priority as I've only had one minor glitch caused by this. One of the first things that I do on an installed Mint system is to change the initrd compression setting from 'lz4' to 'gzip' and upgrade the kernel.

Try this:
Boot your computer from the flashdrive. At the Grub boot screen, select "Check the integrity of the medium". If this passes, then your flashdrive is probably O.K.
Now select "Start Linux Mint xxxxx (compatibility mode). Repeat, if necessary, with "OEM install (for manufacturers)".
If the same error occurs, try the flashdrive on another computer, if possible.

Hopefully, at this point, you have either found that your flashdrive is suspect or you have managed to install Mint.

Could you report your progress here. There are a few ways to proceed. I want to have a closer look at this.

Bodge99
Last edited by bodge99 on Fri Apr 16, 2021 6:27 pm, edited 1 time in total.
linux-rox
Level 10
Level 10
Posts: 3334
Joined: Sun Jul 19, 2020 9:17 pm

Re: live system: initramfs unpacking failed: Decoding failed

Post by linux-rox »

luigi_70 wrote: Thu Apr 15, 2021 3:32 pm I guess I have 2 options:
Third option. Do a Forum search. There have been several threads about this problem in a live session. As I recall, there are a couple where the solution was to fix the graphics driver as described in the Release Notes, i.e., the initramfs error is a symptom of a different problem than the one discussed (and solved) in the thread to which you originally posted.

Edit: It will be easier for everyone trying to help if you post complete system information. Please boot the LM19 ISO and, from there, post an inxi report as described here. Notice Firefox is installed in the live session, so you can post directly to the thread.
Last edited by linux-rox on Fri Apr 16, 2021 11:32 am, edited 1 time in total.
bodge99

Re: live system: initramfs unpacking failed: Decoding failed

Post by bodge99 »

Hi,

linux-rox: You are correct in stating that there are several potential causes of this initramfs unpack error. However, it would appear that you are dismissing the possibility of a more insidious bug that is preventing some folk from even booting a Live Mint flashdrive.

I've started looking at this more closely. I've tested several machines here and I've found this behaviour with a rebadged Clevo 14" laptop.

This laptop has Mint 20.1 Mate installed and is used by SWMBO for general surfing & online shopping etc. I installed Mint onto it late last year.
The installation was straightforward. On initial boot, I altered the '/etc/initramfs-tools/initramfs.conf' COMPRESS entry to 'gzip' and rebuilt the 'initrd.img'. The system runs perfectly O.K.

Last night, I booted the machine using a Mint 20.1 Cinnamon Live flashdrive. The machine hardlocked (repeatedly), returning the error "initramfs unpacking failed...".
The flashdrive is valid, as other machines boot from it with no problem.
The machine boots O.K. from a Live Mint Mate Iso.. but briefly shows an initial "initramfs unpacking failed..." message.

As the Live Iso "initrd.lz" should be very similar, if not identical, between Mint 20.1 Cinnamon and Mint 20.1 Mate, then something else must be going on.

I'm now going to look at rebuilding the Iso 'initrd.lz' slightly differently and see what I get from this. I also want to see how the Iso kernel is configured.

Bodge99
Last edited by bodge99 on Fri Apr 16, 2021 4:35 pm, edited 1 time in total.
bodge99

Re: live system: initramfs unpacking failed: Decoding failed

Post by bodge99 »

Hi,

The structure of the 'initrd.lz" is now somewhat different to what I was expecting. A simple 'file ./initrd.lz' returns "ASCII cpio archive (SVR4 with no CRC)". However, I can't extract the contents (yet). 'Binwalk' indicates a more complex structure than I was expecting.. The last Iso initrd that I modified was on Mint 17.. and things have "moved on a bit".

I'll dig deeper!

Bodge99
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: live system: initramfs unpacking failed: Decoding failed

Post by rene »

It is a small prepended uncompressed cpio archive containing the CPU microcode; rest is the regular initramfs of old. Not much more info than that in viewtopic.php?p=1853977#p1853977 but FWIW...
bodge99

Re: live system: initramfs unpacking failed: Decoding failed

Post by bodge99 »

Hi,

rene:

Thanks for that.. appreciated!

Bodge99
bodge99

Re: live system: initramfs unpacking failed: Decoding failed

Post by bodge99 »

Hi,

In my particular case I was correct!!

I've eliminated the "initramfs unpacking failed..." problem. The Clevo laptop now boots the Cinnamon Live Iso properly.

What I did:

Extract everything from the Iso. From here, I made a copy of the 'initrd.lz' ( '/casper/initrd.lz' on the Iso.)

Code: Select all

dd bs=3492864 skip=1 if=./initrd.lz of=shorten.bin		{Remove the first 3492864 bytes. }
								{This is a cpio archive that contains AMD microcode.}
								{What's left is the actual initrd, compressed with 'lz4'}
unlz4 -d ./shorten.bin myinitrd					{Decompress to ./myinitrd} 			

cpio -id -D newinit < ./myinitrd 				{Extract to ./newinit/}
find . | cpio -o -H newc -R root:root | gzip -9 > ./initrd.img	{Recompress using gzip to ./initrd.img}
EDIT: The last line above is run from the 'newinit/' directory.

The finished file is now renamed to 'initrd.img' and is ready for use in the next stage.

As I'm only (initially) interested in UEFI booting for now, I located a spare USB external drive. I created a 5GB fat32 partition and set the boot & esp flags.
I then extracted the Mint 20.1 Cinnamon Iso contents to this partition.
I deleted '/casper/initrd.lz' and copied over 'initrd.img' to '/casper/'.

Finally, I edited the 'grub.cfg' in '/boot/grub/', changing the four entries:
'initrd /casper/initrd.lz' to 'initrd /casper/initrd.img'.

Save the file and boot from the external drive.

Perfect boot with a properly unpacked 'initrd'.

I still say that there is a bug with the stock intrd decompression routines..

Bodge99
Last edited by bodge99 on Sun Apr 18, 2021 1:21 pm, edited 4 times in total.
bodge99

Re: live system: initramfs unpacking failed: Decoding failed

Post by bodge99 »

Hi,

luigi_70: If you wish, I can email you with the modified 'initrd.img' & 'grub.cfg' files.

All you need to do is to boot your computer from a Mint 19.x Live flashdrive. This gives you access to a working Linux system.
You would then format another flashdrive and set the boot and esp flags using 'Gparted'.

Now extract the Mint 20.1 Cinnamon Iso contents directly to the flashdrive.
Finally, copy the new 'initrd.img' and 'grub.cfg' over.
You can use "Midnight Commander" for all of the extraction and copy actions.
Install 'mc' into the live environment with 'sudo apt install mc'.

If you want to do this, just ask here..

Bodge99
bodge99

Re: live system: initramfs unpacking failed: Decoding failed

Post by bodge99 »

Hi,

I've had a closer look at the contents of the Iso initrd.

What seems to be happening is this: With an Iso boot, coupled with a failed initrd unpack, the kernel cannot access some modules that exist only (at this time) within the initrd. If the host computer's hardware actually requires one or more modules at this early boot stage, then certain hardware will not be initialised properly or at all. The system may survive this with certain hardware combinations and load the required kernel modules at the latter stage kernel initialisation, if it is able to reach it. Most kit will.. but the key thing is that some will not. Hence the failed boot.

If the '/etc/initramfs-tools/initramfs.conf' COMPRESS setting is left using 'lz4', then this problem passes to any new installed kernels on the host system.

This bug would also appear to increase boot times..

Comments would be appreciated on this opinion..

Bodge99
bodge99

Re: live system: initramfs unpacking failed: Decoding failed

Post by bodge99 »

Hi,

Restore Legacy Boot:

Just for completeness:

I'll assume that your flashdrive is detected as 'sda'. You''ll need to check this.
With your flashdrive prepared as above (i.e. copy the new initrd.img across and modify the 'grub.cfg')..

Install Legacy Grub to the flashdrive:

Code: Select all

sudo su
mount /dev/sda /mnt
grub-install --no-floppy --boot-directory=/mnt/boot --target=i386-pc /dev/sda
I prefer Grub.. so Grub it is.

Bodge99
Locked

Return to “Installation & Boot”