Pham Ngoc-Dung <ifa26...@outlook.com.vn> writes: > Hi. On my hard drive (wd0, MBR), I have 3 partitions originally for Linux, > including a boot partition (ext2 formatted), and another partition with > NetBSD installed. > For a reason I wanted to mount the Linux boot partition, which should have > been easy since ext2 is supported by NBSD. But except fdisk where it showed > up, I couldn't find it anywhere, nor a way to mount it. > A little bit more of research, then I found out about dk(4). I tried to > rebuild the kernel with DKWEDGE_METHOD_MBR uncommented. It did boot from that > kernel, but it couldn't mount my root device, However the 3 Linux partitions > were now detected: > > [4.8364408] wd0 at atabus0 drive 0 > [4.8364408] wd0: <ST500LT012-9WS142> > [4.9467467] dk0 at wd0: "wd0e" > [4.9467467] dk1 at wd0: "wd0f" > [4.9467467] dk2 at wd0: "wd0h" > [5.0676107] boot device: wd0 > [5.0676107] root on wd0a dumps on wd0b > [5.0676107] vfs_mountroot: can't open root device > [5.0676107] cannot mount root, error = 16 > [5.0676107] root device (default wd0a): > > Is there a workaround or a fix to this behavior?
You also want this -> DKWEDGE_METHOD_BSDLABEL as well as (or even instead of) DKWEDGE_METHOD_MBR. That cause a wedge to be added for each disklabel entry which should the system to find your root filesystem. It appears that with just DKWEDGE_METHOD_MBR the system didn't notice where its root fs was at. In fact, you may need to leave out DKWEDGE_METHOD_MBR and just use DKWEDGE_METHOD_BSDLABEL if your disklabel contains information about all of the native NetBSD filesystems and the linux ones. You will have to change everything in your /etc/fstab to use /dev/dkN notation rather than /dev/wd0M notation, but that isn't too hard to do. -- Brad Spencer - b...@anduin.eldar.org - KC8VKS - http://anduin.eldar.org