I install manjaro 21.3 today. I need a fs that support compression and encrypt, so I use F2FS for my rootfs. Because grub cannot correctly read its boot files from an F2FS partition that was created with the extra_attr
flag enabled, I created a EXT4 partition with mount point /boot.
Calamares wouldn’t enable compression and encrypt for me, so I created a shell script to do this.
cat /usr/sbin/mkfs.f2fs #!/bin/bash
/usr/sbin/mkfs.f2fs.real -O extra_attr,inode_checksum,sb_checksum,compression,encrypt $@
After partition, my disk look like:
sudo fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: Micron MTFDKBA512TFH
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B16FB978-14F7-FB47-947C-628D2BFC4FE3
Device Start End Sectors Size Type
/dev/nvme0n1p1 4096 413695 409600 200M EFI System
/dev/nvme0n1p2 413696 1462271 1048576 512M Linux filesystem
/dev/nvme0n1p3 1462272 964780518 963318247 459.3G Linux filesystem
/dev/nvme0n1p4 964780519 1000215182 35434664 16.9G Linux swap
But grub-mkconfig failed. From calamares’ log, I saw
Starting job "bootloader" ( 36 / 38 )
00:54:52 [6]: virtual Calamares::JobResult Calamares::PythonJob::exec()
Job file "/usr/lib/calamares/modules/bootloader/main.py"
.. Job description from pretty_name "bootloader" = "Install bootloader."
[PYTHON JOB]: "Bootloader: grub (efi)"
.. Running ("grub-install", "--target=x86_64-efi", "--efi-directory=/boot/efi", "--bootloader-id=Manjaro", "--force")
[PYTHON JOB]: "UEFI Fallback: True"
[PYTHON JOB]: " .. installing 'bootx64.efi' fallback firmware"
.. Running ("grub-mkconfig", "-o", "/boot/grub/grub.cfg")
.. Target cmd: ("grub-mkconfig", "-o", "/boot/grub/grub.cfg") Exit code: 1 output:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15-x86_64
Found initrd image: /boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-5.15-x86_64.img
Found initrd fallback image: /boot/initramfs-5.15-x86_64-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
grub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your device.map.
Adding boot menu entry for UEFI Firmware Settings ...
WARNING: [PYTHON JOB]: "Command 'grub-mkconfig -o /boot/grub/grub.cfg' returned non-zero exit status 1."
[PYTHON JOB]: "stdout:Generating grub configuration file ...\nFound linux image: /boot/vmlinuz-5.15-x86_64\nFound initrd image: /boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-5.15-x86_64.img\nFound initrd fallback image: /boot/initramfs-5.15-x86_64-fallback.img\nWarning: os-prober will be executed to detect other bootable partitions.\nIts output will be used to detect bootable binaries on them and create new boot entries.\ngrub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your device.map.\ngrub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your device.map.\nAdding boot menu entry for UEFI Firmware Settings ..."
[PYTHON JOB]: "stderr:None"
00:54:55 [6]: virtual void Calamares::JobThread::run()
Skipping non-emergency job "postcfg"
.. Skipping non-emergency job "Unmount file systems."
00:54:55 [1]: void Calamares::ViewManager::onInstallationFailed(const QString&, const QString&)
ERROR: Installation failed: "Bootloader installation error"
.. - message: "Bootloader installation error"
.. - details: The bootloader could not be installed. The installation command <pre>grub-mkconfig -o /boot/grub/grub.cfg</pre> returned error code 1。
00:54:55 [6]: void Calamares::ViewManager::onInstallationFailed(const QString&, const QString&)
Calamares will quit when the dialog closes.
00:54:55 [6]: void Config::doNotify(bool, bool)
Notification not sent; completion: failed
But I can run grub-mkconfig successful when I chroot to the target.
sudo chroot /tmp/calamares-root-__v5jvf9
[root@manjaro /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-5.15-x86_64
Found initrd image: /boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-5.15-x86_64.img
Found initrd fallback image: /boot/initramfs-5.15-x86_64-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
grub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your device.map.
Adding boot menu entry for UEFI Firmware Settings ...
Found memtest86+ image: /boot/memtest86+/memtest.bin
/usr/bin/grub-probe: warning: unknown device type nvme0n1.
done
[root@manjaro /]# echo $?
0
So, what’s wrong with my installation? How to fixed it?