Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
1 answers
437 views
How to prevent the re-creation of default mkinitcpio preset file upon kernel update?
Since I’m using custom mkinitcpio presets to generate UKIs, I deleted the default preset file inside `/etc/mkinitcpio.d/` that came during system installation. Unfortunately, when pacman updates the kernel, the default preset file comes back, and the associated initramfs images get recreated automat...
Since I’m using custom mkinitcpio presets to generate UKIs, I deleted the default preset file inside /etc/mkinitcpio.d/ that came during system installation. Unfortunately, when pacman updates the kernel, the default preset file comes back, and the associated initramfs images get recreated automatically on top of my UKIs. The minor consequence is the waste of space on my boot partition, the major one is the inability to boot my system again if I forget to delete the undesired images before shutdown. I haven’t found how is triggered the creation of the preset file. The linux kernel package file does not include it. However there is a skeleton preset at /usr/share/mkinitcpio/hook.preset but I have no idea if it is really used during kernel update and how to prevent the generation of a new one.
Bogey Jammer (199 rep)
Jun 20, 2024, 09:17 PM • Last activity: Sep 17, 2024, 07:45 PM
0 votes
0 answers
118 views
HoloISO/Archlinux Running pacman -Syu(u) results in the next boot becoming an endless black screen
I have been running both pacman -Syu and -Syuu with the following packages: > glibc make icu qt6-base linux-firmware pcaman-contrib > archlinux-contrib gcc-libs sh python wireplumber pipewire lha > base-devel fwupd linux-firmware-qlogic linux-firmware-bnx2x > linux-firmware-liquidio linux-firmware-m...
I have been running both pacman -Syu and -Syuu with the following packages: > glibc make icu qt6-base linux-firmware pcaman-contrib > archlinux-contrib gcc-libs sh python wireplumber pipewire lha > base-devel fwupd linux-firmware-qlogic linux-firmware-bnx2x > linux-firmware-liquidio linux-firmware-mellanox linux-firmware-nfp The subsequent log gives no errors, only warnings. One is related to consolefonts in the mkinitcpio file. I've just been removing that element from the file and it doesn't seem to result in further problems. Another set of warnings relates to the AUR packages mentioned here https://wiki.archlinux.org/title/Mkinitcpio#Possibly_missing_firmware_for_module_XXXX . I've been installing them after the first -Syu and then re-runnign -Syu afterwards to check if they need any packages. However, every time I install upd72020x-fw, it always comes empty. I have no idea why or what effect this has. The last set of warnings mention permissions being different on the system than the package apparently wants. I've tried pre-empting these by manually changing the permissions using chmod to the numbers stated, but that just makes other packages warn about differing permissions. I've tried running -Syu without the extra packages, which leads to the same result. I've been saying yes to all of the "replace (package) with extra_main/(package)5" requests. If I do need to say no to them every time, is there a way to do so without having to type n for each? The system works fine if I don't use -Syu, but that limits what I can do with it severely. Processors: 4 x AMD Ryzen 3 2300X Quad-Core Processor Memory: 7.7 GiB Graphic Processor: AMD Radeon RX 570
Let A be the Unknown (1 rep)
Jun 5, 2024, 07:13 PM • Last activity: Jun 6, 2024, 06:21 AM
0 votes
1 answers
155 views
mkinitcpio and bundled files' location
after passing files to mkinitcpio via `FILES` or `BINARIES` in `mkinitcpio.conf`, where exactly do they end up? let's say I added `FILES=(/usr/lib/firmware/edid/abc.bin)` for example, with the above line: ``` # mkinitcpio -p linux ... ==> Creating zstd-compressed initcpio image: '/boot/initramfs-lin...
after passing files to mkinitcpio via FILES or BINARIES in mkinitcpio.conf, where exactly do they end up? let's say I added FILES=(/usr/lib/firmware/edid/abc.bin) for example, with the above line:
# mkinitcpio -p linux
...
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux.img'
==> Initcpio image generation successful
# cpio -t < /boot/initramfs-linux.img
early_cpio
kernel/
kernel/x86/
kernel/x86/microcode/
kernel/x86/microcode/AuthenticAMD.bin
# ???
how can I make sure the generate init file do contain the file? And how can I be certain of the path to pass to kernel parameters?
gcb (632 rep)
Apr 29, 2024, 05:28 PM • Last activity: Apr 29, 2024, 06:02 PM
2 votes
1 answers
3140 views
How do I uncompress or unarchive the contents of initramfs img file in Arch Linux?
I have been using **Arch Linux** for a while and studying about the **initramfs**. I thought of looking into the contents of the file to get a clear idea of it. I googled for various ways to peek through the file but I was not able to. Initially, I checked the file type of initramfs using the below...
I have been using **Arch Linux** for a while and studying about the **initramfs**. I thought of looking into the contents of the file to get a clear idea of it. I googled for various ways to peek through the file but I was not able to. Initially, I checked the file type of initramfs using the below command and got the following output: file /boot/initramfs-linux.img /boot/initramfs-linux.img: Zstandard compressed data (v0.8+), Dictionary IS: None I found that the file was **Zstandard compressed** and used the **zstd** tool to fetch the content of the file as follows: zstd -d /boot/initramfs-linux.img -o SOME_FILE_NAME That yielded gibberish result. I gave a file name as it's argument since it complained when I gave a directory. I thought that the initramfs file contains the initial root file system (set of files and directories). I am **naive** to Arch Linux and it's internals. Kindly help me through this. Thanks.
Panther Coder (408 rep)
Jul 31, 2022, 08:09 PM • Last activity: Aug 1, 2022, 07:44 AM
1 votes
1 answers
371 views
Data-loss safety of "cryptsetup luksOpen <root device>" between suspend and resume
I'm setting up suspend-to-disk and resume in an 2021.12.x Arch Linux install. My question is about safely (without data-loss) unlocking partitions when resuming. Here is my configuration. The bootloader is grub 2.06, and I'm using a busybox-based initramfs. The relevant partitions are below. I'm not...
I'm setting up suspend-to-disk and resume in an 2021.12.x Arch Linux install. My question is about safely (without data-loss) unlocking partitions when resuming. Here is my configuration. The bootloader is grub 2.06, and I'm using a busybox-based initramfs. The relevant partitions are below. I'm not using LVM.
# partition	 encrypted	 mountpoint		decrypted volume name
- ---------  ---------   ----------     ---------------------
...
3 root		     luks2	 /				cryptroot
4 swap		     luks2	 [SWAP]			cryptswap
...
In /etc/mkinitcpio.conf I've configured these hooks.
HOOKS=(base udev ... openswap openroot ... resume ... filesystems fsck)
I'm not using the built-in encrypt hook. It can only unlock one device (typically only the root device which is specified in the cryptdevice kernel parameter), but I need to unlock the encrypted swap device, too. So instead of the encrypt hook I use two custom hooks: openswap and openroot. The openswap hook, in essence, runs: cryptsetup luksOpen cryptswap which prompts for a password. The openroot hook does the same for the root partition device: cryptsetup luksOpen cryptroot. Next, the built-in resume hook writes the swap device's major and minor numbers to /sys/power/resume .
printf "$devmajor:$devminor" >/sys/power/resume
There are two scenarios at this point. ### Scenario 1: If starting up after full shutdown When starting the computer after a full shutdown, there is no hibernation image in the unlocked swap partition. There is nothing to resume from, so a regular boot occurs. The root partition has been unlocked by this point (by the openroot hook), so booting can proceed correctly. No question of safety in this scenario. ### Scenario 2: If starting up after suspend-to-disk Earlier, when I would have initiated a suspend-to-disk, the root partition would have been in an unlocked and mounted state, and the hibernation image would have captured this state as is. Now, after kernel uses this hibernation image to resume, the system will continue to use this (already) unlocked/mounted root partition device. **This is where my question arises:** I know it is bad to *mount* a device in between suspend and resume. For example, kernel.org says : "If you touch anything on disk between suspend and resume… …kiss your data goodbye." My configuration doesn't do this. Is it similarly bad to cryptsetup luksOpen a device in between suspend and resume? Does cryptsetup luksOpen constitute touching (kernel.org terminology above) the disk? Recall that the initramfs openroot hook runs cryptsetup luksOpen cryptroot between suspend and resume. If so, how does one handle this?
typically (113 rep)
Dec 17, 2021, 11:11 PM • Last activity: Dec 18, 2021, 01:27 AM
0 votes
0 answers
248 views
Need help figuring out why this LUKS setup isn't working
Problem: I'm trying to set up an encrypted raid0 device with btrfs. I'm able to get beyond the first password prompt to enter the LUKS device but after that I get an error from fsck saying something like device UUID=187a468c-cab5-4a29-861e-8c5b2c7cca98 not found. I've been messing with it for about...
Problem: I'm trying to set up an encrypted raid0 device with btrfs. I'm able to get beyond the first password prompt to enter the LUKS device but after that I get an error from fsck saying something like device UUID=187a468c-cab5-4a29-861e-8c5b2c7cca98 not found. I've been messing with it for about 12 hours now and I cant figure it out. I made sure to run grub-mkconfig before I reboot. Let me know if you need anymore info ``` $ blkid -o full /dev/mapper/zion: LABEL="root" UUID="187a468c-cab5-4a29-861e-8c5b2c7cca98" UUID_SUB="6cd2134e-5817-455a-a216-c41ce0495e63" BLOCK_SIZE="4096" TYPE="btrfs" /dev/sdc2: UUID="30786a7f-df33-4f36-8c80-4a4f7b4e145d" TYPE="crypto_LUKS" PARTUUID="07f3b77e-02" # /etc/crypttab zion UUID="30786a7f-df33-4f36-8c80-4a4f7b4e145d" none luks # /etc/fstab UUID=187a468c-cab5-4a29-861e-8c5b2c7cca98 / btrfs rw,relatime,space_cache,subvolid=5,subvol=/ 0 0 # /etc/mkinitcpio.conf HOOKS=(base udev keyboard autodetect modconf block mdadm_udev encrypt fsck btrfs filesystems fsck) # /etc/default/grub GRUB_DEFAULT=0 GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="Arch" GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet" GRUB_CMDLINE_LINUX="" GRUB_PRELOAD_MODULES="part_gpt part_msdos usb usb_keyboard ohci uhci ehci" GRUB_ENABLE_CRYPTODISK=y GRUB_DISABLE_OS_PROBER=y # other default values omitted # /etc/mdadm.conf ARRAY /dev/md/imsm0 metadata=imsm UUID=2c9194b5:2dc765c7:deb29150:22b74163 ARRAY /dev/md/zion_0 container=/dev/md/imsm0 member=0 UUID=533a48be:25fa4cb7:4111a783:7d68bb14 $ grub-mkconfig -o /boot/grub/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-linux-zen Found initrd image: /boot/initramfs-linux-zen.img Found fallback initrd image(s) in /boot: initramfs-linux-zen-fallback.img Found linux image: /boot/vmlinuz-linux Found initrd image: /boot/initramfs-linux.img Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img Detecting snapshots ... # /boot/grub/grub.cfg # # DO NOT EDIT THIS FILE # # It is automatically generated by grub-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub # ### BEGIN /etc/grub.d/00_header ### insmod part_gpt insmod part_msdos insmod usb insmod usb_keyboard insmod ohci insmod uhci insmod ehci if [ -s $prefix/grubenv ]; then load_env fi if [ "${next_entry}" ] ; then set default="${next_entry}" set next_entry= save_env next_entry set boot_once=true else set default="0" fi if [ x"${feature_menuentry_id}" = xy ]; then menuentry_id_option="--id" else menuentry_id_option="" fi export menuentry_id_option if [ "${prev_saved_entry}" ]; then set saved_entry="${prev_saved_entry}" save_env saved_entry set prev_saved_entry= save_env prev_saved_entry set boot_once=true fi function savedefault { if [ -z "${boot_once}" ]; then saved_entry="${chosen}" save_env saved_entry fi } function load_video { if [ x$feature_all_video_module = xy ]; then insmod all_video else insmod efi_gop insmod efi_uga insmod ieee1275_fb insmod vbe insmod vga insmod video_bochs insmod video_cirrus fi } if [ x$feature_default_font_path = xy ] ; then font=unicode else insmod part_msdos insmod cryptodisk insmod luks insmod gcry_rijndael insmod gcry_rijndael insmod gcry_sha256 insmod btrfs cryptomount -u 30786a7fdf334f368c804a4f7b4e145d set root='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' 187a468c-cab5-4a29-861e-8c5b2c7cca98 else search --no-floppy --fs-uuid --set=root 187a468c-cab5-4a29-861e-8c5b2c7cca98 fi font="/usr/share/grub/unicode.pf2" fi if loadfont $font ; then set gfxmode=auto load_video insmod gfxterm set locale_dir=$prefix/locale set lang=en_US insmod gettext fi terminal_input console usb_keyboard terminal_output gfxterm if [ x$feature_timeout_style = xy ] ; then set timeout_style=menu set timeout=5 # Fallback normal timeout code in case the timeout_style feature is # unavailable. else set timeout=5 fi ### END /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/10_linux ### menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-187a468c-cab5-4a29-861e-8c5b2c7cca98' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod cryptodisk insmod luks insmod gcry_rijndael insmod gcry_rijndael insmod gcry_sha256 insmod btrfs cryptomount -u 30786a7fdf334f368c804a4f7b4e145d set root='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' 187a468c-cab5-4a29-861e-8c5b2c7cca98 else search --no-floppy --fs-uuid --set=root 187a468c-cab5-4a29-861e-8c5b2c7cca98 fi echo 'Loading Linux linux-zen ...' linux /boot/vmlinuz-linux-zen root=UUID=187a468c-cab5-4a29-861e-8c5b2c7cca98 rw loglevel=3 quiet echo 'Loading initial ramdisk ...' initrd /boot/initramfs-linux-zen.img } submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-187a468c-cab5-4a29-861e-8c5b2c7cca98' { menuentry 'Arch Linux, with Linux linux-zen' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-zen-advanced-187a468c-cab5-4a29-861e-8c5b2c7cca98' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod cryptodisk insmod luks insmod gcry_rijndael insmod gcry_rijndael insmod gcry_sha256 insmod btrfs cryptomount -u 30786a7fdf334f368c804a4f7b4e145d set root='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' 187a468c-cab5-4a29-861e-8c5b2c7cca98 else search --no-floppy --fs-uuid --set=root 187a468c-cab5-4a29-861e-8c5b2c7cca98 fi echo 'Loading Linux linux-zen ...' linux /boot/vmlinuz-linux-zen root=UUID=187a468c-cab5-4a29-861e-8c5b2c7cca98 rw loglevel=3 quiet echo 'Loading initial ramdisk ...' initrd /boot/initramfs-linux-zen.img } menuentry 'Arch Linux, with Linux linux-zen (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-zen-fallback-187a468c-cab5-4a29-861e-8c5b2c7cca98' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod cryptodisk insmod luks insmod gcry_rijndael insmod gcry_rijndael insmod gcry_sha256 insmod btrfs cryptomount -u 30786a7fdf334f368c804a4f7b4e145d set root='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' 187a468c-cab5-4a29-861e-8c5b2c7cca98 else search --no-floppy --fs-uuid --set=root 187a468c-cab5-4a29-861e-8c5b2c7cca98 fi echo 'Loading Linux linux-zen ...' linux /boot/vmlinuz-linux-zen root=UUID=187a468c-cab5-4a29-861e-8c5b2c7cca98 rw loglevel=3 quiet echo 'Loading initial ramdisk ...' initrd /boot/initramfs-linux-zen-fallback.img } menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-187a468c-cab5-4a29-861e-8c5b2c7cca98' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod cryptodisk insmod luks insmod gcry_rijndael insmod gcry_rijndael insmod gcry_sha256 insmod btrfs cryptomount -u 30786a7fdf334f368c804a4f7b4e145d set root='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' 187a468c-cab5-4a29-861e-8c5b2c7cca98 else search --no-floppy --fs-uuid --set=root 187a468c-cab5-4a29-861e-8c5b2c7cca98 fi echo 'Loading Linux linux ...' linux /boot/vmlinuz-linux root=UUID=187a468c-cab5-4a29-861e-8c5b2c7cca98 rw loglevel=3 quiet echo 'Loading initial ramdisk ...' initrd /boot/initramfs-linux.img } menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-187a468c-cab5-4a29-861e-8c5b2c7cca98' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod cryptodisk insmod luks insmod gcry_rijndael insmod gcry_rijndael insmod gcry_sha256 insmod btrfs cryptomount -u 30786a7fdf334f368c804a4f7b4e145d set root='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='cryptouuid/30786a7fdf334f368c804a4f7b4e145d' 187a468c-cab5-4a29-861e-8c5b2c7cca98 else search --no-floppy --fs-uuid --set=root 187a468c-cab5-4a29-861e-8c5b2c7cca98 fi echo 'Loading Linux linux ...' linux /boot/vmlinuz-linux root=UUID=187a468c-cab5-4a29-861e-8c5b2c7cca98 rw loglevel=3 quiet echo 'Loading initial ramdisk ...' initrd /boot/initramfs-linux-fallback.img } } ### END /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/30_os-prober ### ### END /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/30_uefi-firmware ### ### END /etc/grub.d/30_uefi-firmware ### ### BEGIN /etc/grub.d/40_custom ### # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. ### END /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/41_custom ### if [ -f ${config_directory}/custom.cfg ]; then source ${config_directory}/custom.cfg elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then source $prefix/custom.cfg fi ### END /etc/grub.d/41_custom ### ### BEGIN /etc/grub.d/41_snapshots-btrfs ### ### END /etc/grub.d/41_snapshots-btrfs ###
Dominic (329 rep)
Dec 12, 2021, 01:07 AM • Last activity: Dec 13, 2021, 10:18 AM
1 votes
0 answers
654 views
How to debug a loop in systemd-shutdown / initrd ? (Arch Linux)
I've recently installed Arch Linux to a virtual disk, under a custom configuration for root on ZFS. This was in using some scripting I've put together for managing a multiboot configuration, with separate boot and root pools, each to be used both for Arch and FreeBSD. Presently, the ZFS pool configu...
I've recently installed Arch Linux to a virtual disk, under a custom configuration for root on ZFS. This was in using some scripting I've put together for managing a multiboot configuration, with separate boot and root pools, each to be used both for Arch and FreeBSD. Presently, the ZFS pool configuration was created with FreeBSD under a VM. The Arch Linux installation was then created from another VM, where Arch was installed on an Ext4 partition. With Arch installed on the boot/root ZFS configuration and after some configuration for Grub, the Arch installation on ZFS now boots successfully. Presently, the virtual disk with the ZFS pools on it is running under a separate virtual machine. Arch Linux is the only OS installed on that machine's virtual disk, at this time. It boots successfully now, with a corresponding Grub2 configuration. However, I'm noticing a loop during shutdown.
[ 1561.324253] systemd-shutdown[1] : Sending SIGKILL to remaining processes...
[ 1561.336930] systemd-shutdown[1] : Unmounting file systems.
[ 1561.341650] : Remounting '/var' read-only in with options 'noxattr,noacl'.
[ 1561.783555] : Unmounting '/var'.
[ 1561.790194] : Remounting '/usr' read-only in with options 'noxattr,noacl'.
[ 1561.796853] : Remounting '/' read-only in with options 'noxattr,noacl'.
[ 1561.803420] systemd-shutdown[1] : All filesystems unmounted.
[ 1561.809423] systemd-shutdown[1] : Deactivating swaps.
[ 1561.813672] systemd-shutdown[1] : All swaps deactivated.
[ 1561.818688] systemd-shutdown[1] : Detaching loop devices.
[ 1561.824354] systemd-shutdown[1] : All loop devices detached.
[ 1561.829085] systemd-shutdown[1] : Stopping MD devices.
[ 1561.833346] systemd-shutdown[1] : All MD devices stopped.
[ 1561.837982] systemd-shutdown[1] : Detaching DM devices.
[ 1561.842299] systemd-shutdown[1] : All DM devices detached.
[ 1561.847501] systemd-shutdown[1] : All filesystems, swaps, loop devices, MD devices and DM devices detached.
[ 1561.856852] systemd-shutdown[1] : Successfully changed into root pivot.
[ 1561.863478] systemd-shutdown[1] : Returning to initrd...
[ 1562.306958] shutdown[1] : Syncing filesystems and block devices.
[ 1562.311377] shutdown[1] : Sending SIGTERM to remaining processes...
[ 1562.316903] shutdown[1] : Sending SIGKILL to remaining processes...
[ 1562.329374] shutdown[1] : Unmounting file systems.
[ 1562.334319] sd-remou: Remounting '/' read-only in with options 'noxattr,noacl'.
[ 1562.346902] sd-umoun: Unmounting '/oldroot/sys/kernel/config'.
[ 1562.354595] sd-umoun: Unmounting '/oldroot/sys/fs/fuse/connections'.
[ 1562.361525] sd-umoun: Unmounting '/oldroot/sys/kernel/tracing'.
[ 1562.368232] sd-umoun: Unmounting '/oldroot/sys/kernel/debug'.
[ 1562.373715] sd-umoun: Unmounting '/oldroot/dev/mqueue'.
[ 1562.380105] sd-umoun: Unmounting '/oldroot/dev/hugepages'.
[ 1562.386843] sd-umoun: Unmounting '/oldroot/sys/fs/bpf'.
[ 1562.391984] sd-umoun: Unmounting '/oldroot/sys/fs/pstore'.
[ 1562.397417] sd-umoun: Unmounting '/oldroot/sys/fs/cgroup'.
[ 1562.404234] audit: type=1334 audit(1635363440.667:81): prog-id=8 op=UNLOAD
[ 1562.410100] sd-umoun: Unmounting '/oldroot/dev/pts'.
[ 1562.414579] audit: type=1334 audit(1635363440.667:82): prog-id=6 op=UNLOAD
[ 1562.420101] sd-umoun: Unmounting '/oldroot/dev/shm'.
[ 1562.426852] sd-umoun: Unmounting '/oldroot/sys/kernel/security'.
[ 1562.432165] sd-umoun: Unmounting '/oldroot/usr'.
[ 1562.443869] sd-remou: Remounting '/oldroot/run' read-only in with options 'noxattr,noacl'.
[ 1562.456905] sd-umoun: Unmounting '/oldroot/run'.
[ 1562.461323] sd-umoun: Unmounting '/oldroot'.
[ 1562.466800] sd-umoun: Failed to unmount /oldroot: Device or resource busy
[ 1562.473458] sd-umoun: Unmounting '/oldroot/dev'.
[ 1562.478395] sd-umoun: Unmounting '/oldroot/sys'.
[ 1562.483288] sd-umoun: Unmounting '/oldroot/proc'.
[ 1562.488082] sd-umoun: Unmounting '/oldroot'.
[ 1562.493279] shutdown[1] : All filesystems unmounted.
[ 1562.498851] shutdown[1] : Deactivating swaps.
[ 1562.502456] shutdown[1] : All swaps deactivated.
[ 1562.506839] shutdown[1] : Detaching loop devices.
[ 1562.511505] shutdown[1] : All loop devices detached.
[ 1562.515404] shutdown[1] : Stopping MD devices.
[ 1562.520083] shutdown[1] : All MD devices stopped.
[ 1562.523666] shutdown[1] : Detaching DM devices.
[ 1562.527617] shutdown[1] : All DM devices detached.
[ 1562.531822] shutdown[1] : All filesystems, swaps, loop devices, MD devices and DM devices detached.
[ 1562.540145] shutdown[1] : Successfully changed into root pivot.
[ 1562.544940] shutdown[1] : Returning to initrd...
I've only encountered this with the Arch Linux installation on ZFS. Using the same systemd, mkinitcpio, linux, and zfs-linux versions under another VM installation, with Arch on an Ext4 partition there, there's no such loop occurring during shutdown in that machine. May it be due to the root on ZFS configuration? I'm at a loss for trying to figure out how to debug this loop any further. To my best guess, this may be related to some scripting for systemd-shutdown on mkinticpio, such that was introduced in 2013 (Bächler2013 ). What appears to be the main code in the mkinitcpio-generate-shutdown-ramfs service, introduced around that time - an excerpt of /usr/lib/systemd/system/mkinitcpio-generate-shutdown-ramfs.service
[Service]
Type=oneshot
# /tmp could be umounted at this point
# use /run as temporary directory
Environment=TMPDIR=/run
ExecStart=/usr/bin/mkinitcpio -A sd-shutdown -k none -c /dev/null -d /run/initramfs
Furthermore, the contents of the file /usr/lib/initcpio/install/sd-shutdown
#!/bin/bash

build() {
    add_binary /usr/lib/systemd/systemd-shutdown /shutdown

    if type -P kexec >/dev/null; then
        add_binary kexec
    fi
}

help() {
    cat <
I'm not certain if that's actually making it into the shutdown process, on the VM - the system might not meet the stated preconditions for that much. I've tried masking the mkinitcpio-generate-shutdown-ramfs service under systemd, then running mkinitcpio -P again, rebooting ... and it still goes into that loop during system shutdown. The system is still usable under the VM installation - at least, up to the point of that event in the shutdown, when the machine begins to loop indefinitely. Ideally I'd like to be able to work this knot out of the configuration, before installing anything beside Arch or putting this onto a machine's internal hard disk. I'm not certain what may be resulting in the message, Failed to unmount /oldroot: Device or resource busy. It may be something related to the root on ZFS installation? But that's just a guess, really. To my own perspective, the systemd-shutdown process - is it running under initrd, from what the console output says? I believe it seems nontrivial to debug, at this point. I'm certain I could continue towards using Arch for keeping the Grub configuration up to date, after installing FreeBSD beside Arch, in the ZFS pool configuration under the VM's virtual disk. If it's possible to fix this issue with the shutdown loop under Arch, however, I'd like to be able to maintain the Arch installation as a working desktop system - in the VM installation, or finally on the PC's hard disk. While I'm at a loss for trying to figure out how to debug this loop any further, for that loop during shutdown, maybe there's a patch that I just haven't found yet? **Update** I've found source code for systemd-shutdown, at the version in use on Arch Linux. I think it looks like some fairly straightforward code. There may not be a lot there about the 'oldroot' mount point, or how it could become unmountable under systemd-shutdown. It doesn't appear to be due to logging. I've set Storage=volatile in /etc/systemd/journald.conf and created a oneshot systemd service that runs /usr/bin/journalctl --flush after boot. The /var/ filesystem gets successfully umounted now, and I don't believe I'm loosing all of the log data across reboots. The loop is still occurring during the shutdown, however, along with the message Failed to unmount /oldroot... from systemd-shutdown. Is there something hanging it up by side effect?
Sean Champ (266 rep)
Nov 2, 2021, 02:40 AM • Last activity: Nov 2, 2021, 03:41 PM
0 votes
0 answers
647 views
Does it matter if the `encrypt` mkinitcpio hook is included on a system without full disk encryption?
Can I share an `/etc/mkinitcpio.conf` between two Arch Linux systems, where one requires the `encrypt` hook for LUKS disk encryption, and the other does not? i.e. will it cause a problem booting the latter when the hook is called and there's nothing to decrypt, no `/dev/mapper/luksdev` in fstab? (I...
Can I share an /etc/mkinitcpio.conf between two Arch Linux systems, where one requires the encrypt hook for LUKS disk encryption, and the other does not? i.e. will it cause a problem booting the latter when the hook is called and there's nothing to decrypt, no /dev/mapper/luksdev in fstab? (I gather cryptsetup must be installed, but that's fine, and it actually already is as a dependency of something else anyway.)
OJFord (2073 rep)
Oct 22, 2021, 12:27 PM • Last activity: Oct 22, 2021, 09:54 PM
3 votes
1 answers
967 views
Which format is the correct format to use for mkinitcpio.conf?
I am confused about which is the proper formatting to use within mkinitcpio.conf ... I have noticed sometimes double quotes are used and other times parentheses to close off the users desired hooks, modules, etc. settings. **Example:** HOOKS="base udev autodetect block filesystems" HOOKS=(base udev...
I am confused about which is the proper formatting to use within mkinitcpio.conf ... I have noticed sometimes double quotes are used and other times parentheses to close off the users desired hooks, modules, etc. settings. **Example:** HOOKS="base udev autodetect block filesystems" HOOKS=(base udev autodetect block filesystems) So which format is the right one to use?
Anonymous (533 rep)
Mar 9, 2019, 10:39 AM • Last activity: Oct 22, 2021, 03:05 PM
9 votes
2 answers
28264 views
No mkinitcpio preset present
My laptop lost battery during an update, so the linux kernel got truncated. After `arch-chroot`ing into it and reinstalling `linux`, it's OK, but `/boot/initramfs-linux.img` (and the fallback) are empty. Also, `/etc/mkinitcpio.d/linux.preset` is empty. How can I fix this, and how can I generate a pr...
My laptop lost battery during an update, so the linux kernel got truncated. After arch-chrooting into it and reinstalling linux, it's OK, but /boot/initramfs-linux.img (and the fallback) are empty. Also, /etc/mkinitcpio.d/linux.preset is empty. How can I fix this, and how can I generate a preset? ls /etc/mkinitcpio.d/ returns nothing
R Harrington (223 rep)
Mar 4, 2020, 04:49 PM • Last activity: Jul 12, 2021, 09:52 AM
2 votes
1 answers
1733 views
Arch boot: Echo asterisks when typing cryptsetup password
I am trying to setup my initramfs with `mkinitcpio -P` so it decrypts my LUKS/LVM partition containing the root file system on startup. I followed the steps on [here][1] . Everything already works fine, by adding HOOKs `encrypt` and `lvm2` among others, see `mkinitcpio.conf` below. Now I would like...
I am trying to setup my initramfs with mkinitcpio -P so it decrypts my LUKS/LVM partition containing the root file system on startup. I followed the steps on here . Everything already works fine, by adding HOOKs encrypt and lvm2 among others, see mkinitcpio.conf below. Now I would like to have asterisk characters being echoed when I enter the password for the LUKS encrypted partition. I found a nice command line tool for doing so: systemd-ask-password. So I modified /etc/mkinitcpio.conf accordingly, so it adds systemd-ask-password as a binary, and /usr/lib/initcpio/hooks/encrypt to use systemd-ask-password for querying the password and pipe the output to cryptsetup and ran mkinitcpio -P. But it does not mask the password characters with asterisks! It echoes them one by one, which is not secure and not what I intended. In a readily booted system, in a regular terminal and bash, it works perfectly fine. But it seems like the "terminal" during bootup behaves differently. Or the systemd-ask-password command behaves differently in that environment. How can I get systemd-ask-password to work properly in the boot terminal environment? Or: Is there a better way to achieve what I want, to echo the password characters as asterisks? /usr/lib/initcpio/hooks/encrypt: #!/usr/bin/ash run_hook() { modprobe -a -q dm-crypt >/dev/null 2>&1 [ "${quiet}" = "y" ] && CSQUIET=">/dev/null" # Get keyfile if specified ckeyfile="/crypto_keyfile.bin" if [ -n "$cryptkey" ]; then IFS=: read ckdev ckarg1 ckarg2 /dev/null 2>&1 umount /ckey ;; *) # Read raw data from the block device # ckarg1 is numeric: ckarg1=offset, ckarg2=length dd if="$resolved" of="$ckeyfile" bs=1 skip="$ckarg1" count="$ckarg2" >/dev/null 2>&1 ;; esac fi [ ! -f ${ckeyfile} ] && echo "Keyfile could not be opened. Reverting to passphrase." fi if [ -n "${cryptdevice}" ]; then DEPRECATED_CRYPT=0 IFS=: read cryptdev cryptname cryptoptions &2 ;; esac done set +f IFS="$OLDIFS" unset OLDIFS if resolved=$(resolve_device "${cryptdev}" ${rootdelay}); then if cryptsetup isLuks ${resolved} >/dev/null 2>&1; then [ ${DEPRECATED_CRYPT} -eq 1 ] && warn_deprecated dopassphrase=1 # If keyfile exists, try to use that if [ -f ${ckeyfile} ]; then if eval cryptsetup --key-file ${ckeyfile} open --type luks ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}; then dopassphrase=0 else echo "Invalid keyfile. Reverting to passphrase." fi fi # Ask for a passphrase if [ ${dopassphrase} -gt 0 ]; then echo "" echo "A password is required to access the ${cryptname} volume:" #loop until we get a real password while ! eval systemd-ask-password | cryptsetup open --type luks ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}; do sleep 2; done fi if [ -e "/dev/mapper/${cryptname}" ]; then if [ ${DEPRECATED_CRYPT} -eq 1 ]; then export root="/dev/mapper/root" fi else err "Password succeeded, but ${cryptname} creation failed, aborting..." return 1 fi elif [ -n "${crypto}" ]; then [ ${DEPRECATED_CRYPT} -eq 1 ] && warn_deprecated msg "Non-LUKS encrypted device found..." if echo "$crypto" | awk -F: '{ exit(NF == 5) }'; then err "Verify parameter format: crypto=hash:cipher:keysize:offset:skip" err "Non-LUKS decryption not attempted..." return 1 fi exe="cryptsetup open --type plain $resolved $cryptname $cryptargs" IFS=: read c_hash c_cipher c_keysize c_offset c_skip ' for # help on a given hook. # 'base' is _required_ unless you know precisely what you are doing. # 'udev' is _required_ in order to automatically load modules # 'filesystems' is _required_ unless you specify your fs modules in MODULES # Examples: ## This setup specifies all modules in the MODULES setting above. ## No raid, lvm2, or encrypted root is needed. # HOOKS=(base) # ## This setup will autodetect all modules for your system and should ## work as a sane default # HOOKS=(base udev autodetect block filesystems) # ## This setup will generate a 'full' image which supports most systems. ## No autodetection is done. # HOOKS=(base udev block filesystems) # ## This setup assembles a pata mdadm array with an encrypted root FS. ## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. # HOOKS=(base udev block mdadm encrypt filesystems) # ## This setup loads an lvm2 volume group on a usb device. # HOOKS=(base udev block lvm2 filesystems) # ## NOTE: If you have /usr on a separate partition, you MUST include the # usr, fsck and shutdown hooks. HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 filesystems fsck) # COMPRESSION # Use this to compress the initramfs image. By default, zstd compression # is used. Use 'cat' to create an uncompressed image. #COMPRESSION="zstd" #COMPRESSION="gzip" #COMPRESSION="bzip2" #COMPRESSION="lzma" #COMPRESSION="xz" #COMPRESSION="lzop" #COMPRESSION="lz4" # COMPRESSION_OPTIONS # Additional options for the compressor #COMPRESSION_OPTIONS=()
Bernd (31 rep)
May 24, 2021, 08:05 AM • Last activity: Jun 28, 2021, 08:17 AM
0 votes
1 answers
470 views
Can no longer boot to RAID array after update
I recently updated my system and after a reboot I get the following: ERROR: device ‘UUID=...’ not found. Skipping fsck. mount: /new_root: can’t find UUID=... You are now being dropped into an emergency shell. My root file system is on a RAID array and running `blkid` from the emergency shell shows t...
I recently updated my system and after a reboot I get the following: ERROR: device ‘UUID=...’ not found. Skipping fsck. mount: /new_root: can’t find UUID=... You are now being dropped into an emergency shell. My root file system is on a RAID array and running blkid from the emergency shell shows that the array is not listed. I have /dev/sda2 and /dev/sdb2 in RAID1 and typically it mounts to /boot. They have a UUID="b45... and are assembled into /dev/md1 with a UUID="436.... While /dev/sda3 and /dev/sdb3 in RAID0 typically mounted to /. They have a UUID="8dc... and are assembled into /dev/md2 with a UUID="d0d.... The error at boot is looking for d0d.... I booted to live USB and ran blkid and the array was there. So I mounted the arrays, proc, sys, dev, and and boot. I checked /etc/mdadm.conf and saw that all the ARRAY lines were commented out so I ran: # mdadm --detail --scan >> /mnt/etc/mdadm.conf I checked that the UUIDs matched the two partitions I am using in the arrays (b45... and 8dc...). I then chrooted in. I then checked /etc/mkinitcpio.conf and saw that mdadm_udev was missing from the HOOKS setting. So I readded that. From there, I tried each of the following followed by a reboot: # pacman -S linux # mkinitcpio -p linux # mkinitcpio -P For each I can see it build the mdadm_udev hook and it tells me that: > `Custom /etc/mdadm.conf file will be used in initramfs for assembling > arrays` But when I reboot, I get the same error and using blkid in the emergency shell shows that my RAID arrays are not listed (but the partitions that make it up are there and the UUIDs match what is in mdadm.conf) . I also added the kernel parameter raid0.default_layout=2 with the same result. It's never been there before but the wiki seems to indicate that I need it. The Linux package is linux-5.12.6.arch1-1 and before the ERROR on boot it tells me that it is: > Starting version 248.3-2-arch What am I missing that is causing the array not to be assembled on boot?
embedded.kyle (282 rep)
May 25, 2021, 12:16 AM • Last activity: May 25, 2021, 10:41 PM
4 votes
1 answers
8506 views
How to boot into root btrfs file system with minimal initramfs without udev hook?
Arch Linux is UEFI booted from USB flash drive with GPT and three partitions: 1. EFI (vfat file system) 2. root (btrfs file system, was converted from ext4) 3. home (btrfs file system, was converted from ext4) The btrfs partitions have no sub-volumes and are on a single disk (the USB flash memory dr...
Arch Linux is UEFI booted from USB flash drive with GPT and three partitions: 1. EFI (vfat file system) 2. root (btrfs file system, was converted from ext4) 3. home (btrfs file system, was converted from ext4) The btrfs partitions have no sub-volumes and are on a single disk (the USB flash memory drive). LVM is not in use here. ### Task Trying to create a **minimal initramfs** by removing udev and a lot of other hooks. Optimizing Bootup With mkinitcpio was used as inspiration too.
The effective mkinitcpio hooks are: base , autodetect and modconf . ### Btrfs hook The btrfs hook is not enabled because mkinitcpio hooks documentation lists for btrfs hook: > This hook is not required for using Btrfs on a single device. ### Regression 1. I have tried to remove udev -> boot error 2. I have tried to add the btrfs module -> boot error 3. I have added btrfs hook -> boot error 4. Changed root=PARTUUID= to root=UUID= notation -> boot error 5. adding paramters rootfstype=btrfs -> boot error 6. rootdelay=0 -> boot error 7. rootdelay=10 -> boot error 8. Mounting using /dev/sda2 from emergency shell -> ok ### Error Only after inserting udev or systemd hooks the system will root into the btrfs root partition, otherwise this error appears: ERROR: device 'PARTUUID=c2...c13' not found. Skipping fsck. :: mounting 'PARTUUID=c2...c13' on real root mount: can't find 'PARTUUID=c2...c13' You are now being dropped into an emergency shell. ### Runtime init debug/log output Enabling boot parameters rd.debug and rd.log shows that "premount" calls the resolve_device function and that returns an empty lookup. resolve_device PARTUUID=c2...c13 local major minor dev tag device=PARTUUID=c2...c13 blkid -lt PARTUUID=c2...c13 -o device dev= The last empty dev is causing the device not found error. ### initramfs mount command mount_handler=default_mount_handler ... # Mount root at /new_root "$mount_handler" /new_root source: https://git.archlinux.org/mkinitcpio.git/tree/init default_mount_handler() { msg ":: mounting '$root' on real root" mount ${rootfstype:+-t $rootfstype} -o ${rwopt:-ro}${rootflags:+,$rootflags} "$root" "$1" source: https://git.archlinux.org/mkinitcpio.git/tree/init_functions#n375 ### initramfs mount version [rootfs ]# mount -V mount from util-linux 2.29.2 (libmount 2.29.2: btrfs, assert, debug) ### initramfs contents $ lsinitcpio -a /boot/initramfs-linux-tiny.img ==> Image: /boot/initramfs-linux-tiny.img ==> Created with mkinitcpio 23 ==> Kernel: 4.10.3-1-ARCH ==> Size: 3.53 MiB ==> Compressed with: lz4 -l -> Uncompressed size: 8.32 MiB (.424 ratio) -> Estimated extraction time: 0.028s ==> Included modules: ahci [explicit] hid-generic [explicit] raid6_pq usbcore atkbd [explicit] i8042 [explicit] scsi_mod usbhid [explicit] btrfs [explicit] libahci sd_mod [explicit] xhci-hcd crc32c-intel [explicit] libata serio xhci-pci [explicit] crc32c_generic libcrc32c serio_raw [explicit] xor ehci-hcd libps2 uas [explicit] ehci-pci [explicit] ohci-hcd usb-common hid ohci-pci [explicit] usb-storage ==> Included binaries: blkid busybox dosfsck fsck fsck.vfat kmod mount switch_root The emergency shell its blkid command lists the correct (PART)UUID value. Could the mounting using using (PART)UUID fail because there is no /dev/disk/? ### Question What is necessary to boot into a non-raid non-subvolume single-drive root btrfs partition located on a USB flash drive without udev? --- PS This error might be caused by a RACE condition, UUID/PARTUUID not yet available when initramfs/init executes the mount ... UUID=... command.
Pro Backup (5114 rep)
Mar 19, 2017, 12:16 AM • Last activity: Mar 9, 2021, 09:26 AM
3 votes
1 answers
683 views
A Small GUI Linux System with UEFI completely running on RAMDisk
I am developing a POS System and I am planning to use Linux. My requirements are as follows 1. UEFI Support. (Running on x86 and x86_64) 2. No Storage Drive so completely running on RAM and persistence storage data(Around 1 MB) will be in ESP (EFI System Partition) 3. A GUI Application displaying op...
I am developing a POS System and I am planning to use Linux. My requirements are as follows 1. UEFI Support. (Running on x86 and x86_64) 2. No Storage Drive so completely running on RAM and persistence storage data(Around 1 MB) will be in ESP (EFI System Partition) 3. A GUI Application displaying options for POS. 4. Wireless connectivity (Not immediately but eventually) 5. No installation required. (Just copy kernel and initrd images to ESP along with systemd-boot and good to go.) I have been able to run Minimal Live Linux (https://github.com/ivandavidov/minimal) where kernel and initrd images are stored in EFI System Partition. It could connect to Wired Network and I could login to Bash. Next step is to load GUI (XOrg or Something else) and add my own GUI application. I am stuck at a point where I want to create a initrd image with GUI support. Any pointers on that direction?
HunterGathererCoder (53 rep)
Oct 3, 2020, 03:47 PM • Last activity: Oct 4, 2020, 02:38 PM
0 votes
1 answers
701 views
Add encrypt hook to mkinitcpio to arch linux
i want to enable encrypt hook. Regulary, you go with nano /etc/mkinitcpio.conf and add the encrypt hook as archwiki says. I want to automate that step with bash commands. ```mkinitcpio -A encrypt``` add the hook How can i save it in the default file and with ```mkinitcpio -p linux``` load the encryp...
i want to enable encrypt hook. Regulary, you go with nano /etc/mkinitcpio.conf and add the encrypt hook as archwiki says. I want to automate that step with bash commands.
-A encrypt
add the hook How can i save it in the default file and with
-p linux
load the encrypt hook too?
Ioannis Gavriilidis (1 rep)
Jun 11, 2020, 10:41 AM • Last activity: Jul 17, 2020, 01:24 AM
2 votes
2 answers
17273 views
mkinitcpio : command not found
I am a **beginner** in Linux when i install arch Linux **dual boot** , download **base system** then i go to **chroot** then make a ram using a command: ``` mkinitcpio -p Linux```. when i write it, gives me **command not found.** i install using this *video*: i stop at min: **9.16.**
I am a **beginner** in Linux when i install arch Linux **dual boot**
, download **base system** then i go to **chroot** then make a ram using a command:
mkinitcpio -p Linux
. when i write it, gives me **command not found.**
i install using this *video*: i stop at min: **9.16.**
Ali Mostafa (45 rep)
Oct 19, 2019, 08:29 PM • Last activity: Mar 23, 2020, 01:08 PM
7 votes
3 answers
20622 views
'/lib/modules/4.9.8-1-ARCH' is not a valid kernel module directory
I am attempting to repair and upgrade an Arch Linux system. I boot off of a Live USB which is a newer version than the original install. Then I mount the sda and chroot to its mount point. When I run `mkinitcpio -p linux`, I get the error from the title: '/lib/modules/4.9.8-1-ARCH' is not a valid ke...
I am attempting to repair and upgrade an Arch Linux system. I boot off of a Live USB which is a newer version than the original install. Then I mount the sda and chroot to its mount point. When I run mkinitcpio -p linux, I get the error from the title: '/lib/modules/4.9.8-1-ARCH' is not a valid kernel module directory lib/modules/ has 4.13.3-1-ARCH. How do I tell mkinitcpio to use this directory instead?
Code-Guru (709 rep)
Oct 1, 2017, 01:07 AM • Last activity: Mar 4, 2020, 07:18 PM
7 votes
1 answers
6575 views
LUKS password not being requested by dmcrypt / encrypt hook at boot
At boot I see: :: running hook [encrypt] A password is required to access the volume: Command requires device and mapped name as arguments Command requires device and mapped name as arguments Command requires device and mapped name as arguments The final message repeats every second. There is no opp...
At boot I see: :: running hook [encrypt] A password is required to access the volume: Command requires device and mapped name as arguments Command requires device and mapped name as arguments Command requires device and mapped name as arguments The final message repeats every second. There is no opportunity for me to enter a password. I am running Manjaro, based upon Arch. What am I doing wrong?
Tom Hale (32892 rep)
Feb 2, 2017, 04:01 AM • Last activity: Feb 14, 2020, 08:35 AM
2 votes
1 answers
4441 views
Is the order of NVIDIA kernel modules in mkinitcpio important?
I'm troubleshooting a solution for Nvidia screen tearing cited on the [Archlinux wiki](https://wiki.archlinux.org/index.php/NVIDIA_Optimus#Tearing.2FBroken_VSync) which instructs to enable [DRM kernel mode setting](https://wiki.archlinux.org/index.php/NVIDIA#DRM_kernel_mode_setting): > *nvidia 364.1...
I'm troubleshooting a solution for Nvidia screen tearing cited on the [Archlinux wiki](https://wiki.archlinux.org/index.php/NVIDIA_Optimus#Tearing.2FBroken_VSync) which instructs to enable [DRM kernel mode setting](https://wiki.archlinux.org/index.php/NVIDIA#DRM_kernel_mode_setting) : > *nvidia 364.16 adds support for DRM kernel mode setting. To enable this > feature, add the nvidia-drm.modeset=1 kernel parameter, and add > **nvidia, nvidia_modeset, nvidia_uvm and nvidia_drm** to your initramfs#MODULES.* I entered the MODULES into mkinitcpio.conf [as instructed](https://wiki.archlinux.org/index.php/NVIDIA#DRM_kernel_mode_setting) . Here is the relevant line from my .conf file: MODULES="ext4 dm_mod dm_crypt vfat nvidia nvidia_modeset nvidia_uvm nvidia_drm" Troubleshooting, I discovered evidence the modules are not loaded: $ rmmod nvidia_drm nvidia_modeset nvidia rmmod: ERROR: Module nvidia_drm is not currently loaded rmmod: ERROR: Module nvidia_modeset is not currently loaded I know mkinitcpio HOOKS go in order (ie. LUKS). **Is the order of NVIDIA kernel modules in mkinitcpio important?**
xtian (593 rep)
Nov 21, 2017, 10:07 AM • Last activity: Apr 8, 2019, 10:33 AM
0 votes
1 answers
773 views
Arch Linux stuck at "Loading version 240" after modifying configs
I'm trying to get GPU passthrough to work on a VM. I've been following this video https://www.youtube.com/watch?v=6FI31QDtyy4. The differences between what I did and what he did in the video was modules in mkinitcpio config thingy, I used 'MODULES=(vfio_pci vfio vfio_iommu_type1 vfio_virqfd)' instea...
I'm trying to get GPU passthrough to work on a VM. I've been following this video https://www.youtube.com/watch?v=6FI31QDtyy4 . The differences between what I did and what he did in the video was modules in mkinitcpio config thingy, I used 'MODULES=(vfio_pci vfio vfio_iommu_type1 vfio_virqfd)' instead because the video was a bit outdated. **So what I did was** - Add intel_iommu=on in grub params - Checked that my system supports IOMMU, I ran 'dmesg | grep -e DMAR -e IOMMU' - Adding 'options vfio-pci ids=10de:10f0,10de:1b81' to vfio.conf - Modifying mkinitcpio.conf as described above - Running 'mkinitcpio -p linux' - Modifying qemu.conf (prob not related) - Running 'systemctl enable --now libvirtd' and 'systemctl enable virtlogd.socket' - Reboot and go back to Windows 10 (NOT DUALBOOTED. I'm running arch off a USB STICK (NOT LIVE USB)) (Tried adding a vm but failed because I didn't do the ntfs-3g thingy) - Came back from Windows 10 and added 'UUID=061A04D11A04C023 /media/Data/ ntfs-3g defaults 0 0' in fstab - Changed 'GRUB_CMDLINE_LINUX_DEFAULT="quiet"' to 'GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"' in /etc/default/grub - Rebooted and stuck at "Loading version 240 (when I remove the intel_iommu=on from params, it booted just fine) First boot that iommu worked, I used my GPU as output. I tried iGPU after GPU didn't work on the last boot (No Signal). Also I've checked Arch's official wiki about PCI passthrough and the steps were pretty similiar **/etc/mkinitcpio.conf**:
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=(vfio_pci vfio vfio_iommu_type1 vfio_virqfd)

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=()

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H ' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()
**/etc/modprobe.d/vfio.conf**:
options vfio-pci ids=10de:10f0,10de:1b81
**Kernel version**: 4.20.10-arch1-1-ARCH **Hardware info (lshw)**:
cube-arch                   
    description: Desktop Computer
    product: B360M-HD3 (Default string)
    vendor: Gigabyte Technology Co., Ltd.
    version: Default string
    serial: Default string
    width: 4294967295 bits
    capabilities: smbios-3.1 dmi-3.1 smp vsyscall32
    configuration: boot=normal chassis=desktop family=Default string sku=Default string uuid=E002D503-5E04-7905-ED06-310700080009
  *-core
       description: Motherboard
       product: B360M HD3
       vendor: Gigabyte Technology Co., Ltd.
       physical id: 0
       version: x.x
       serial: Default string
       slot: Default string
     *-firmware
          description: BIOS
          vendor: American Megatrends Inc.
          physical id: 0
          version: F4
          date: 04/19/2018
          size: 64KiB
          capacity: 15MiB
          capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int14serial int17printer acpi usb biosbootspecification uefi
     *-memory
          description: System Memory
          physical id: 3a
          slot: System board or motherboard
          size: 16GiB
        *-bank:0
             description: DIMM DDR4 Synchronous 2133 MHz (0.5 ns)
             product: F4-3000C16-8GISB
             vendor: Fujitsu
             physical id: 0
             serial: 00000000
             slot: ChannelA-DIMM0
             size: 8GiB
             width: 64 bits
             clock: 2133MHz (0.5ns)
        *-bank:1
             description: [empty]
             physical id: 1
             slot: ChannelA-DIMM1
        *-bank:2
             description: DIMM DDR4 Synchronous 2133 MHz (0.5 ns)
             product: F4-3000C16-8GISB
             vendor: Fujitsu
             physical id: 2
             serial: 00000000
             slot: ChannelB-DIMM0
Cubxity (1 rep)
Feb 20, 2019, 07:45 AM • Last activity: Feb 20, 2019, 04:13 PM
Showing page 1 of 20 total questions