1

It doesn't matter what I mount. Even mounting tmpfs (with mount -vt tmpfs none /mnt) doesn't work.

I'm trying to install Gentoo in a VirtualBox VM, but everything stops working after mounting the the root partition (using mount -v /dev/sda2 /mnt). It breaks with btrfs, ext4, vfat and xfs.

mount returns without any errors and prints mount: /dev/sda2 mounted on /mnt..

After mounting, even running ls prints -bash: ls: command not found.

I tried the ISO from 25.07.2021 and 01.08.2021.

I use a GPT partition table and have enabled EFI in the VirtualBox settings. Disabling EFI doesn't help.

# gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.7

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 41943040 sectors, 20.0 GiB
Model: VBOX HARDDISK   
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 7AAC6D43-015D-458A-866E-B6CEEB08FDC9
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 41943006
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1050623   512.0 MiB   EF00  EFI system partition
   2         1050624        41943006   19.5 GiB    8300  Linux filesystem
2
  • The same thing happens with ext4 and vfat Aug 2, 2021 at 14:48
  • So you should edit your question accordingly, this is not btrfs-specific but caused by the specific layout in place. You should also run lsblk before and after formatting and add it in the question if the command is available. As I don't know gentoo much, I can't go further.
    – A.B
    Aug 2, 2021 at 14:51

1 Answer 1

2

The gentoo live cd mounts the cd to /mnt/livecd and symlinks /bin and co in there. Mounting anything on /mnt will make these symlinks invalid and making it impossible to run any programm/command.

# ls -l /
total 0
lrwxrwxrwx   1 root root   15 Aug  2 15:22 bin -> /mnt/livecd/bin
lrwxrwxrwx   1 root root   16 Aug  2 15:22 boot -> /mnt/livecd/boot
drwxr-xr-x  14 root root 3720 Aug  2 15:23 dev
drwxr-xr-x  58 root root 2460 Aug  2 15:23 etc
drwxr-xr-x   2 root root   60 Aug  1 17:11 home
drwxr-xr-x   2 root root   40 Aug  2 15:23 initramfs
lrwxrwxrwx   1 root root   15 Aug  2 15:22 lib -> /mnt/livecd/lib
lrwxrwxrwx   1 root root   17 Aug  2 15:22 lib64 -> /mnt/livecd/lib64
drwxr-xr-x   6 root root  120 Aug  2 15:22 mnt
lrwxrwxrwx   1 root root   15 Aug  2 15:23 opt -> /mnt/livecd/opt
dr-xr-xr-x 165 root root    0 Aug  2 15:22 proc
drwx------   2 root root  100 Aug  1 17:55 root
drwxr-xr-x  14 root root  460 Aug  2 15:23 run
lrwxrwxrwx   1 root root   16 Aug  2 15:22 sbin -> /mnt/livecd/sbin
dr-xr-xr-x  13 root root    0 Aug  2 15:22 sys
drwxrwxrwt   5 root root  100 Aug  2 15:23 tmp
lrwxrwxrwx   1 root root   15 Aug  2 15:22 usr -> /mnt/livecd/usr
drwxr-xr-x   9 root root  220 Aug  1 17:57 var
# mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
none on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=1405030,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on / type tmpfs (rw,relatime)
/dev/sr0 on /mnt/cdrom type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048)
/mnt/cdrom/image.squashfs on /mnt/livecd type squashfs (ro,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
cgroup_root on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
openrc on /sys/fs/cgroup/openrc type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc)
none on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .