Hi,

I installed Gentoo Linux, build the kernel with "genkernel", and copy the image file into the /boot folder, also I installed grub. It all works fine. What confusing me is that now I cannot find the kernel and grub under the /boot folder, the folder is empty. I did some "emerge" jobs after installation, I don't know why those files disappear. Why my linux can still start up without those kernel and grub files?

ps: gentoo as a vmware guest, /boot is a seperate partition with ext2

Thanks to all.

Dani AI

Generated

Short version: nothing mystical — the bootloader reads the disk, not the running root tree, so a kernel that boots the VM can live on the boot partition even while the live system’s /boot directory looks empty. As hinted, the difference between "what GRUB sees on the raw partition" and "what the running Linux process tree shows at /boot" is the usual culprit. ’s note about Gentoo setups not always mounting a separate /boot at runtime is also relevant.

Common causes and what to check

  • A kernel copied while the separate /boot partition was not mounted ends up under the root filesystem’s /boot directory; later mounting the real boot partition hides those files.
  • The boot partition may simply not be auto-mounted by the running system, so /boot appears empty while the disk image that GRUB used is fine.
  • Package operations can install or move kernel images (or regenerate initramfs), so paths referenced by GRUB can differ from the current /boot tree.

Quick, practical checks (replace device names appropriately)

lsblk -f
cat /etc/fstab
mount | grep ' /boot '
mkdir -p /mnt/boot
mount /dev/sdXN /mnt/boot
ls -la /mnt/boot
ls -la /boot

If the kernel and initramfs are visible on the mounted partition, move or copy them into place and regenerate the GRUB config if required. If the files only appear when the partition is unmounted (i.e., they live on the underlying rootfs), move them onto the actual boot partition so the bootloader and the running system agree.

Notes and cautions

  • When changing /etc/fstab or moving kernel/initramfs files, keep a recovery plan (live CD/Rescue) in case GRUB no longer finds the boot files.
  • For genkernel: ensure /boot is correctly mounted before running it so outputs land on the expected partition. Collecting the mount table, fstab and block-device layout makes diagnosing the situation straightforward.

Recommended Answers

All 2 Replies

When you boot, what does the mount command (no arguments) show? Does the boot partition show up? If not, then the boot loader was able to find it and boot, but the OS didn't mount it in the /boot mount point. Show us the contencts of your system file /etc/fstab please.

As rubberman indicated, the default Gentoo operation is to NOT mount the /boot partition (if it is a separate partition). You can choose to change this in /etc/fstab, or you can mount it manually when you need to.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.