Linux installer crashes on formatting eMMC drive

Unable to install Linux on Asus BR1100CKA laptop. This laptop has an eMMC drive shown as “Generic G1J38E”. The Windows 10 NTFS partition was resized and around 29 GB of unallocated space was available for installing Linux. The installer crashes during formatting this partition to EXT4. I have tried Debian 11, Debian-testing, Q4OS, Ubuntu Server, Xubuntu, GPARTED Live, etc. multiple times and the installation fails at formatting every single time. I also tried to format the partition as EXT4 from Windows using Disk-Genius and AOMEI-Partition-Assistant. The formatting was successful, but the installer keeps crashing. I really like the laptop, but Windows 10 OS is unacceptable for me. Any help or advice would be greatly appreciated.

Then you need to manually format via CLI in verbose mode. Capture all the output in form of logs and post it here.

Before seeing the logs, we cannot be sure what the cause is, but when nothing works, it’s usually a sign of either a critical user error (not the case here, because not even automated formatting worked) or a hardware failure.

Hi Deby
My guess is something must have gone wrong when you resized the Win10 NTFS partition. Did you do that with Gparted?

Look carefully with Gparted. There should be a new 29Gb partition that is not formatted.

  • What does it say when you try to put an ext4 filesystem on this partition?
  • Can you use the Info menu item on this partition? What does it report?
  • Would it be possible that the resizing has mucked up the partition table?
  • What partition table type is it?
  • What happens if you delete the 29Gb partition, then remake it from free space?
I also tried to format the partition as EXT4 from Windows using Disk-Genius and AOMEI-Partition-Assistant. The formatting was successful, but the installer keeps crashing.

So Windows can format it, but what you get is not usable by Linux.
I think it is likely that the partition table is mucked up. To fix that you have to save your Windows, clear the whole disk with Gparted, make a new partiton table (Gparted defaults to MBR, but you can do GPT) , setup your partitions with gparted, restore Windows if you want, try the Linux install again.
That is a big job.

Alternative. There are ways of inspecting the partiton table. I dont know how to do it or what software to use. Look it up, or someone else here may know.

Regards
Neville

This may be helpful

Hello Neville and thank you for a quick reply. I think the problem here is a buggy eMMC controller or firmware. The laptop is brand new, Windows outputs no errors, so faulty hardware is out of the question. GPARTED is able to create partition, but unable to finish formatting is as ext4. Debian installer freezes when formatting the root partition to ext4 and Ubuntu 22.04.1 Server installer crashes on the same step. I am not the only one having this error with exactly the same laptop model. Please take a look at this post: https://www.reddit.com/r/linuxquestions/comments/qy7oqo/unable_to_format_a_128gb_emmc_drive_to_any/ I encountered a similar problem with eMMC drive on Lenovo IdeaPad 1 82GW0047CF where GPARTED couldn’t even detect the drive. It was resolved by using the latest Linux kernel. Apparently any kernel older than 5.13 doesn’t have the driver for the eMMC. Debian 11 with 5.10.46 couldn’t detect the eMMC, but Ubuntu 22.04 with 5.15.0 installed with no errors. The case with Asus BR1100 is more complicated and nothing worked so far. The good news is that there is a NVME M.2 slot on the motherboard, so I might just buy an NVME SSD and install Debian on it. Thanks again for your help.

1 Like

Thank you. The problem seems to be the buggy eMMC controller. Please take a look at this post:

This is another case with the same laptop model:

I’ve ran into the same issue on the same laptop.
Appears that eMMC controller on this laptop has “broken CQE”.
Adding debug_quirks=0x20000 to sdhci module load options makes it work.
(0x20000 is the value for SDHCI_QUIRK_BROKEN_CQE flag, which makes the driver to avoid using CQE).

I am not familiar with how to modify the sdhci module load options. Where is the script at? Thanks again.

Hi Deby,
Looks like I was on the wrong track…never mind it was fun thinking about it.
Linux often has problems with new hardware. It is hard to know whether to wait for Linux to catch up ( which it may do if it is the firmware) or just use the NVME M.2 slot

I looked at the answer on superuser.com. Why dont you try the option of

make system avoid using CQE by specifying debug_quirks=0x20000 option to sdhci module. 

modprobe is easy to use.

That is a nice piece of diagnosis
Regards
Neville

Hi Neville,
Thank you, I appreciate your help. Yes, Linux has to catch up with new hardware, because, unfortunately, most of the hardware is not developed with Linux in mind. Windows dominates the market with around 80% share and Linux is below 2%. I’ve heard that Micro$oft is planning to implement a trick with TPM or similar module to make impossible to install any other OS, the same way as Google does in Chromebooks or Apple with their hardware. The incompatibility of eMMC drives with Linux is the beginning of the future problems. Everything was easy when all computers were modular with CPUs, RAM, Hard Drive, PSU, etc. all as separate, upgradeable and replaceable components. Now all affordable laptops have a motherboard with all other components soldered to the motherboard and non of them can be upgraded or replaced. Well, I only paid $169 for a brand new laptop with Jasper Lake Celeron N4500 and 4 GB RAM, so no complaints here. The 240 GB NVME M.2 SSD costs $28.99 on Amazon, so I decided to buy it. However, I would nevertheless like to try resolving this puzzle and install Linux on eMMC drive by implementing the “avoid using CQE by specifying debug_quirks=0x20000 option to sdhci module” solution. I am not sure how to do it. If you are familiar with the procedure, I would appreciate step by step instructions.
Best regards,
Deby.

Hi Deby,
Look here, one of the answers lists 3 ways to do it

I have not done it but I have done other stuff with modules.
The linux kernel lets you attach and remove modules ( which are like .so dynamically loaded libraries, except they are called .ko)
You can load and unload them, like plugins in a browser.
You can even load them dynamically, ie while the kernel is running, or you can set the system to autoload them at boot. The normal boot loads a default set of modiles. Most of them are drivers for various bits of hardware,

The besy way to work is to try module changes dynamically first. That way they disappear at reboot, so you cant destroy anything.

The commands involved are lsmod, modprobe, modinfo, …
The settings to do it automatically at every boot are in /etc/modprobe.d

I do hope you get your new laptop up and going. It is disapointing to encounter this problem. I would get the NVME djsk first. You need a running Linux to do anything with Modprobe.

I am looking for a new or secondhand laptop myself. I shall avoid anything with eMMC

Therefore, what Linux needs to do is to increase its market share. Simple. Finally make GUIs work! Then market share will increase.
However, most of Linux fanatics do not see this as necessary. This is how the low market share is achieved.

Hi @Deby ,
On reading thru that article at \superuser.com, I can see that there are issues that they do not mention, so I thought I had better add some more hints.
You need to get a live Linux to start with. Lets imagine you have either

  • one of those install iso’s that start with a live linux and run the install script from within that live linux
  • a Linux on your proposed new NVME disk
    So you boot the live linux ( and dont start the install yet if it is an iso)
    Then you start with the following
Way 1: Unload the module and reload it with the option specified.

sudo modprobe -r sdhci_pci
sudo modprobe -r sdhci
sudo modprobe sdhci debug_quirks=0x20000
sudo modprobe sdhci_pci

This works when the system isn't going to access eMMC drive during boot. For example, you are in some kind of linux installer and about to begin installation on the eMMC drive.

what you have done then is add that debug_quirks=0x20000
setting to the sdhci module that is in the kernel you are currently running.
You should then be able to write on the eMMC drive.
So,

  • if you are working from an iso… go ahead and try the install
  • if you are in your NVME linux… do a mount and try and partition the eMMC disk and make filesystems.

If it doesnt work, its a failure… give up now
If it does work

  • if you are working from an iso, you will be at the end of the install. The only option is to reboot, I dont think you can get back to the live iso. You need to get back to the Linux that is now on the eMMC drive and make those modprobe changes permanent.
    So boot it, dont do anything that will cause a write, and try and do the following
Way 3: Use /etc/modprobe.d

Create a file like /etc/modprobe.d/sdhci-disable-cqe.conf which contains:

options sdhci debug_quirks=0x20000

This is usually "the right" way to permanently tweak module load behaviour. However, in order for it to work at early boot, one should make sure the config file gets to initrd image. Ways to do this may differ across distributions. For Ubuntu it's usually running sudo update-initramfs -u after creating/editing a file in /etc/modprobe.d.

It may not work, because it involves a write
So , if it fails, what you have to do is start again with the live .iso, redo the Way1 stuff, then mount the eMMC drive and then do the Way3 stuff on the mounted filesystem. Then escape from the .iso live Linux, boot from the eMMC drive, and it should work

  • if you are in the NVME Linux just make the modprobe changes permanent with
Way 3: Use /etc/modprobe.d

Create a file like /etc/modprobe.d/sdhci-disable-cqe.conf which contains:

options sdhci debug_quirks=0x20000

This is usually "the right" way to permanently tweak module load behaviour. However, in order for it to work at early boot, one should make sure the config file gets to initrd image. Ways to do this may differ across distributions. For Ubuntu it's usually running sudo update-initramfs -u after creating/editing a file in /etc/modprobe.d.

so in this case you are in /etc/modprobe.d on the NVME disk.

Thats about as far ahead as I can forsee.

The other option

Way 2: Specify sdhci.debug_quirks=0x20000 option to the kernel command line.

This often can be done with bootloader menu. It might save the day when the eMMC drive is used during boot and you didn't have a chance to burn the option via /etc/modprobe.d to initramfs.

Yes you can add kernel options to grub. It would be an alternative to Way 3 ie it would be permanent.

You might ask why bother with the temporary changes of Way1. Well that is all you can do on an iso… , it is not writeable.
On your NVME Linux you could just go straight in with the permanent changes.
For some reason, the traditional workflow with modprobe is to do try the temporary changes first.

I hope this makes a bit more sense of it

Regards
Neville

2 Likes