You are not logged in.

#1 2022-12-09 05:38:02

Registered: 2022-04-05
Posts: 15

I managed to boot my arch linux system with chroot in initramfs

I managed to boot my arch linux system's initramfs with chroot rather that switch_root. systemd-udevd loads up fine and I managed to login to my desktop environent. To accomplish that I ran

 [rootfs]# exec chroot /new_root /usr/lib/systemd/systemd 

in the mkinitcpio initramfs emergency shell.

and it was successful. Are there any drawbacks switching the root like that over:

 [rootfs]# exec switch_root /new_root /usr/lib/systemd/systemd 

Last edited by diyfan (2022-12-09 05:39:29)


#2 2022-12-09 11:00:55

Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,162

Re: I managed to boot my arch linux system with chroot in initramfs

Looking at the man pages of both commands switch_root starts systemd as init  , while chroot executes it as a command .

combining that with indicates switch_root executes at final stage of early userspace .
chroot appears to be executed after the boot process has finished .

To me this suggests switch_root and chroot are so different they also have very different usecases .

What is your usecase ?

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)


Board footer

Powered by FluxBB