# Mount the root filesystem. 1 .mount -o ro /dev/sda1 /mnt/root # Boot the real thing. 2 .exec switch_root /mnt/root /sbin/init
This is a piece of code from /init file of initramfs as mentioned in gentoo. here the rootfs mounted to /mnt/root and later switch_root is performed with /mnt/root as newroot and /sbin/init as destination.
After line 1 is executed the contents of /dev/sda1 is mounted at /mnt/root. i tried,
sudo mount -o ro /dev/sda1 /mnt/temp and got this message,
mount: /mnt/temp: /dev/sda1 already mounted on /boot/efi.
so I tried,
cd /boot/efi and it stated
cd: command not found
so I tried
./efi in the /boot dir but now i got this msg,
bash: ./efi: Is a directory
then i tried to view the contents of /sbin/init as:
cd /sbin/init but now it says,
bash: cd: /sbin/init: Not a directory.
i am confused .how come /dev/sda1 and /mnt/root are directories but all of a sudden /sbin/init is an executable ? shouldn't that be a directory as well ?