Trying do mount a slice containing a mounted partition makes the filesystem unreadable

Arrigo Marchiori ardovm at yahoo.it
Fri Feb 26 16:02:46 UTC 2021


Dear All,

I think I found a bug that is similar to an already reported one, but
I am not sure.

Description: when a BSD partition is mounted to / (suppose
/dev/da0s2a), if I try to mount its containing slice (/dev/da0s2) I
receive a ``strange'' error message, and from that moment the mounted
filesystem becomes unreadable.

This problem appears:
 - on a memstick built from 11.4-STABLE r369279,
 - on the ``official'' 12.2-RELEASE memstick,
both tested on amd64.

Fun fact: the problem does _not_ appear if the already-mounted
filesystem is mounted from /dev/ufs/label instead of /dev/da0s2a.

Steps to reproduce on 12.2-RELEASE
==================================

 1- download the official memstick image for 12.2-RELEASE-amd64 and
 flash it into a USB pen drive

 2- edit /boot/loader.conf on the memstick adding the following lines
 (needed to boot successfully on my test system):
    kern.vty=sc
    kern.cam.boot_delay=10000
    kern.cam.scsi_delay=10000

 3- edit /etc/fstab on the memstick and change the root device from
 /dev/ufs/FreeBSD_Install to /dev/da0s2a

 4- boot the memstick and open a shell

 5- # mount /dev/da0s2 /mnt
    mount: /dev/da0s2: No such file or directory <--- strange message!

 6- the filesystem is now unreadable! For example, trying to run some
    binaries not yet in the cache:
    # man
    /usr/bin/man: Device not configured

If I try to reboot, the console is flooded by:

> vm_fault: pager read error, pid 1 (init)

This problem also appears on a memstick built from 11.4-STABLE
r369279. The error messages are different, but the outcome is the
same.

Expected behavior
=================

If the root partition is mounted from /dev/ufs/label (i.e. you skip
step 3 above) the culprit mount command (step 5 above) gives the
following error message:

> mount: /dev/da0s2: Operation not permitted

and the system remains healty and stable.

Am I seeing PR 222948:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222948 or is it
something else?

Thank you in advance and best regards,
-- 
Arrigo

http://rigo.altervista.org


More information about the freebsd-stable mailing list