On Sun, Sep 28, 2025 at 12:45:21PM +0200, Christof Meerwald wrote: > On Sun, Sep 28, 2025 at 10:50:08AM +0200, Matthias Petermann wrote: > > Hello Christof, > > > > On Sat Sep 27, 2025 at 9:12 PM CEST, Christof Meerwald wrote: > > > Just thought I'd give LVM a try (on 11.0_BETA). Everything seemed to > > > be fine until I tried to mount a filesystem with the "log" option: > > > > > > mount -o log /dev/mapper/M247--X10E--9N--vg-netbsd--test /mnt/test/ > > > mount_ffs: /dev/mapper/M247--X10E--9N--vg-netbsd--test on /mnt/test: > > > Inappropriate ioctl for device > > > > > > but without the log option it's fine: > > > > > > mount /dev/mapper/M247--X10E--9N--vg-netbsd--test /mnt/test/ > > > > Not sure if this helps, but as I am also interested in exactly > > this setup you are using here let me add some data points: > > > > ``` > > ~ [ sudo lvm lvs ] 10:40 > > vorm. > > LV VG Attr LSize Origin Snap% Move Log Copy% Convert > > data vg0 -wi-a- 200,00g > > home vg0 -wi-a- 200,00g > > ``` > > > > ``` > > ~ [ cat /etc/fstab > > ... ] 10:38 vorm. > > /dev/mapper/vg0-data /u ffs rw,log 0 0 > > /dev/mapper/vg0-home /h ffs rw,log 0 0 > > ``` > > > > ``` > > ~ [ mount ] 10:39 > > vorm. > > ... > > /dev/mapper/vg0-data on /u type ffs (log, local) > > /dev/mapper/vg0-home on /h type ffs (log, local) > > ``` > > > > ``` > > ~ [ uname -a ] 10:40 > > vorm. > > NetBSD x230.lan 10.1 NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024 > > [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC amd64 > > ``` > > > > Summary: in NetBSD 10.1 this works. > > > > How did you create the filesystem in the LV? newfs -O2 > > is required I think to use wapbl. > > Was actually using "newfs -O2ea" (but "newfs -O2" makes no difference). > > I have now been able to test this in a small test VM. > > As you say, with NetBSD 10.1 it works fine, but with a NetBSD > 11.0_BETA kernel (Wed Sep 24 12:39:13 UTC 2025) I get the > "Inappropriate ioctl for device" error when trying to mount with "-o > log" (that's with a newly created filesystem).
Ok, I think have figured it out now. https://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/dm/dm_ioctl.c.diff?r1=1.56;r2=1.57;f=h with this change (the second part of it) it now fails on NetBSD 11.0_BETA, but I think the change is actually good. Where it actually fails is in "getdisksize": this does a DIOCGWEDGEINFO and then a disk_find on dkw.dkw_parent. I think the issue is in the handling of DIOCGWEDGEINFO in dev/dm/device-mapper.c where it sets dkw->dkw_parent to dmv->name. Should that maybe also use device_xname(dmv->devt)? (and what should dkw->device_name be set to there?) Christof -- https://cmeerw.org sip:cmeerw at cmeerw.org mailto:cmeerw at cmeerw.org xmpp:cmeerw at cmeerw.org
