Arrigo Marchiori
2021-Feb-26 16:02 UTC
Trying do mount a slice containing a mounted partition makes the filesystem unreadable
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 permittedand 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