Bug 252468 - emulators/qemu-user-static: mount(8) cannot show root filesystem
Summary: emulators/qemu-user-static: mount(8) cannot show root filesystem
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-emulation (Nobody)
Depends on:
Reported: 2021-01-06 12:21 UTC by Martin Birgmeier
Modified: 2021-01-07 15:52 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (emulation)


Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2021-01-06 12:21:10 UTC
- disk903: ZFS volume containing an amd64 FreeBSD head installation
- disk925: ZFS volume containing an armv6 FreeBSD head installation, exported via iSCSI
- bhyve server running FreeBSD 12.2 (releng/12.2)
- bhyve client running from disk903 -> results in running VM "v903"
- in v903, the disk925 armv6 installation is imported using iSCSI and mounted on /d/925s2a
- in v903, qemu-user-static is installed
- in v903, a chroot to /d/925s2a is done using

    chroot /d/925s2a/ zsh -l

- This results in a shell (zsh) running emulated armv6 binaries.
- (This setup is used to update armv6 ports using portmaster.)
- In this chroot, issue "mount -p /" and "df /".


[0]# mount -p /
mount: /: unknown special file or file system
[1]# df /
Filesystem                    1K-blocks    Used    Avail Capacity  Mounted on
/dev/diskid/DISK-HAL_V0925s2a  20289716 3970484 14696056    21%    /d/925s2a

Expected result:

[0]# mount -p /    
/dev/diskid/DISK-HAL_V0925s2a /d/925s2a          ufs     rw    0 0
[0]# df /
Filesystem                    1K-blocks    Used    Avail Capacity  Mounted on
/dev/diskid/DISK-HAL_V0925s2a  20289716 3970484 14696056    21%    /d/925s2a

-- Martin
Comment 1 martin 2021-01-06 20:01:30 UTC
I get this error when the path is not in /etc/fstab, so I don't think this is related to qemu or bhyve as such.  It should show correctly if you just run "mount -p".
Comment 2 Martin Birgmeier 2021-01-06 20:06:03 UTC
This line is in /etc/fstab on v903:

/dev/diskid/DISK-HAL_V0925s2a /d/925s2a ufs     rw,noauto               0 0

-- Martin
Comment 3 martin 2021-01-07 11:39:26 UTC
OK, but that will not help.

Firstly, when you run mount inside the chroot, it will end up looking in /d/925s2a/etc/fstab on v903.  Secondly, the fstab line you gave mounts on /d/925s2a (because it is used on v903), not on /, so it won't match your mount command.
Comment 4 Martin Birgmeier 2021-01-07 13:37:26 UTC
The issue is that "df" is able to deduce the mount point whereas "mount" itself is not. This seems like a deficiency to me.

The discussion about the entry being available or not in /etc/fstab is certainly interesting but seems to be somewhat beside the point.

-- Martin
Comment 5 Martin Birgmeier 2021-01-07 15:52:25 UTC
Thanks to your comments I now understand that mount(8) really needs that entry in /etc/fstab. So this has nothing to do with qemu. I'm closing this PR.

-- Martin