Groups | Search | Server Info | Login | Register


Groups > alt.os.linux.mint > #43959

Re: grub: "out of memory" -- time for systemd-boot?

From David <David@example.net>
Newsgroups alt.os.linux.mint
Subject Re: grub: "out of memory" -- time for systemd-boot?
Date 2025-01-27 08:16 +0000
Message-ID <lvotn1Fdod2U1@mid.individual.net> (permalink)
References <lvok6vF7mkuU2@mid.individual.net>

Show all headers | View raw


On 27/01/2025 05:34, vallor wrote:
> So we have a new Linux workstations with this in it:
> 
> 04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8852CE PCIe
> 802.11ax Wireless Network Controller (rev 01)
> 
> The wifi driver a) chugs, and b) throws LOTS of errors
> 
> _[/root]_(root@buzz)🔴_
> # uname -a
> Linux buzz 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec  5
> 13:09:44 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
> _[/root]_(root@buzz)🔴_
> # cat /etc/os-release
> NAME="Linux Mint"
> VERSION="22.1 (Xia)"
> ID=linuxmint
> ID_LIKE="ubuntu debian"
> PRETTY_NAME="Linux Mint 22.1"
> VERSION_ID="22.1"
> HOME_URL="https://www.linuxmint.com/"
> SUPPORT_URL="https://forums.linuxmint.com/"
> BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/
> latest/"
> PRIVACY_POLICY_URL="https://www.linuxmint.com/"
> VERSION_CODENAME=xia
> UBUNTU_CODENAME=noble
> 
>   _ _ _ _ _ _ _
> 
> So , I built 6.13 on the box.  Even though I'm using the Ubuntu
> config for the kernel, the initrd is much larger:
> 
> _[/boot]_(root@buzz)🔴_
> # ll initrd.img-6.8.0-51-generic
> -rw-r--r-- 1 root root 179144039 Jan 22 11:40 initrd.img-6.8.0-51-generic
> _[/boot]_(root@buzz)🔴_
> # ll Hide/initrd.img-6.13.0
> -rw-r--r-- 1 root root 534642362 Jan 23 10:57 Hide/initrd.img-6.13.0
> 
> I think this is why I get "out of memory" when Grub tries to
> unpack the initrd.  However, googling around to figure out how
> to fix this gives multiple causes/fixes, and I haven't yet hit
> on the combination to boot the 6.13 kernel yet.
> 
> One fix is to stop faffing around with grub, and use systemd-boot.
> 
> Is anyone using systemd-boot with Linux Mint 22.1?
> 
> Other info:
> Gigabyte B760I AORUS PRO
> Intel(R) Core(TM) i7-14700F
> 32G of RAM (DDR5)
> 1T NVMe drive
> NVIDIA GeForce RTX 4070 SUPER (AD104-A) (12G)
> Linux Mint 22.1
> 
> Thanks,
> 

It looks like you're tackling a couple of issues here: the problematic 
Realtek RTL8852CE Wi-Fi driver and the large initrd causing GRUB to fail 
during the boot of your custom 6.13 kernel. Here's a detailed breakdown 
of potential solutions:

---

### **1. Realtek RTL8852CE Wi-Fi Driver Issue**
The RTL8852CE Wi-Fi chipset has a history of requiring extra effort for 
proper functionality on Linux. Here’s what you can do:

- **Use the `rtw89` Driver:**
   The kernel 6.2 and newer natively support the RTL8852CE via the 
`rtw89` driver. Ensure it's included and loaded by running:
   ```bash
   lsmod | grep rtw89
   ```
   If it’s not loaded:
   ```bash
   sudo modprobe rtw89pci
   ```

- **Install Realtek Out-of-Tree Driver:**
   If the in-tree driver doesn’t work, use Realtek’s latest out-of-tree 
driver. Clone and compile it:
   ```bash
   sudo apt install build-essential dkms git
   git clone https://github.com/lwfinger/rtw89.git
   cd rtw89
   make
   sudo make install
   sudo modprobe rtw89pci
   ```
   Reboot afterward.

- **Check Logs:**
   Monitor logs for errors related to the driver using:
   ```bash
   dmesg | grep rtw89
   ```

---

### **2. Large Initrd Causing GRUB Issues**
The significant increase in size of the initrd for your custom kernel 
might be due to modules or unnecessary components being included. Here’s 
how to address it:

- **Optimize the Initrd Size:**
   Rebuild the initrd with only necessary modules:
   ```bash
   sudo dracut --hostonly --force /boot/initrd.img-6.13.0 6.13.0
   ```
   Alternatively, for Ubuntu-based systems:
   ```bash
   sudo update-initramfs -c -k 6.13.0
   ```

- **Verify GRUB Memory Allocation:**
   Ensure GRUB has enough memory allocated to load large initrd files:
   - Edit `/etc/default/grub` and add:
     ```bash
     GRUB_CMDLINE_LINUX="rootflags=size=512M"
     ```
   - Update GRUB:
     ```bash
     sudo update-grub
     ```

- **Split Initrd (Optional):**
   If GRUB still runs out of memory, split the initrd:
   ```bash
   split -b 128M /boot/initrd.img-6.13.0 /boot/initrd.img-6.13.0.part
   ```

---

### **3. Consider Switching to `systemd-boot`**
`systemd-boot` is a lightweight and modern bootloader that may handle 
your large initrd better. Here's how to set it up:

- **Install systemd-boot:**
   ```bash
   sudo bootctl install
   ```

- **Configure Entries:**
   Create a boot entry in `/boot/loader/entries/` for your kernel:
   ```bash
   title Linux 6.13
   linux /vmlinuz-6.13.0
   initrd /initrd.img-6.13.0
   options root=UUID=<your-root-partition-uuid> rw
   ```

- **Update Loader Configuration:**
   Edit `/boot/loader/loader.conf`:
   ```bash
   default 6.13.0
   timeout 5
   ```

---

### **Hardware Considerations**
Your hardware is top-notch and shouldn’t encounter memory constraints. 
However, ensure:
- **BIOS/UEFI Settings:**
   - Use UEFI mode.
   - Enable memory remapping and allocate sufficient VRAM for the GPU.

- **Check for Firmware Updates:**
   Update your BIOS and install the latest firmware for the Realtek 
RTL8852CE chipset.

---

### **Community Feedback on systemd-boot with Linux Mint 22.1**
While Linux Mint defaults to GRUB, many users successfully switch to 
`systemd-boot` for its simplicity. The main challenge is managing 
dual-boot configurations, but since your system is likely single-boot 
(Linux-only), this shouldn't be an issue.

-- 
Kind regards,
David

In all honesty .... This is the answer provided by ChatGPT :-D
"Let me know if you'd like more help!" were the final words!

Back to alt.os.linux.mint | Previous | NextPrevious in thread | Find similar


Thread

grub: "out of memory" -- time for systemd-boot? vallor <vallor@cultnix.org> - 2025-01-27 05:34 +0000
  Re: grub: "out of memory" -- time for systemd-boot? Paul <nospam@needed.invalid> - 2025-01-27 02:30 -0500
  Re: grub: "out of memory" -- time for systemd-boot? David <David@example.net> - 2025-01-27 08:16 +0000

csiph-web