Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 728816

Summary: Mounting newly created root filesystem from a live environment breaks all commands.
Product: Gentoo Release Media Reporter: William Culhane <sxroka>
Component: InstallCDAssignee: Gentoo Release Team <releng>
Status: RESOLVED INVALID    
Severity: normal CC: grknight
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description William Culhane 2020-06-19 19:03:30 UTC
I am trying to install Gentoo from a live environment using the latest minimal 32-bit installation image on an HP Mini 110. I created a 100M boot partition as /dev/sda1, a 2G swap partition as /dev/sda2, and a 147G root partition formatted as ext4 on /dev/sda3. Mounting the root partition proceeds without error, but subsequently every single command except bash builtins are broken. Attempting to reboot with C-Alt-Del fails due to being unable to execute /sbin/shutdown.

Reproducible: Always

Steps to Reproduce:
1. Burn the minimal install image for x86 to a USB flash drive
2. Boot from it
3. Create a partition scheme as described above
4. Optionally activate swap
5. `mount /dev/sda3 /mnt`
6. Type any non-builtin command (e.g. umount, dmesg, or ls).
Actual Results:  
Bash will print a `command not found` message. It is impossible to reboot or perform any task from the environment until the machine is forcibly rebooted. Switching ttys, recreating the live usb, or using a swap partition has no effect. Mounting with `-o ro` has no effect.

Expected Results:  
Either some sort of error message should appear or my commands should still be available. They shouldn't just silently disappear.

I tried putting root on an LVM partition, but it had no effect. Installing alpine linux using the automatic installer suceeded without complaint. Passing absolute paths to where things should be similarly has no effect. Oddly, the error messages do give paths to where the executables should be. Rebooting, and doing nothing except mounting the root partition causes the issue as well. I encountered this issue a few months ago as well (possibly with the same computer).

```
# emerge --info
-bash: emerge: command not found
```
Comment 1 Brian Evans (RETIRED) gentoo-dev 2020-06-19 19:08:03 UTC
(In reply to William Culhane from comment #0)
> I am trying to install Gentoo from a live environment using the latest
> minimal 32-bit installation image on an HP Mini 110. I created a 100M boot
> partition as /dev/sda1, a 2G swap partition as /dev/sda2, and a 147G root
> partition formatted as ext4 on /dev/sda3. Mounting the root partition
> proceeds without error, but subsequently every single command except bash
> builtins are broken. Attempting to reboot with C-Alt-Del fails due to being
> unable to execute /sbin/shutdown.
> 
> Reproducible: Always


> 5. `mount /dev/sda3 /mnt`

This is your problem.  The minimal mounts to /mnt/cdrom or something similar and by you doing 'mount <source> /mnt' you destroy the environment.

The Handbook clearly states that you should do to /mnt/gentoo or really anywhere else new you define under /mnt/ would do.