FreeBSD-4.11 - Need help with booting with an MD_ROOT
David Clear
davidclear at yahoo.com
Thu Mar 10 12:02:47 PST 2005
I have been trying, unsuccessfully, to boot a
kernel with an embedded root filesystem. I've
searched the mailing lists and the web without finding
an answer. I hope someone here can help.
Here's the procedure I have used:
1. My kernel is built with options: MFS, MD_ROOT and
MD_ROOT_SIZE=32768.
2. A disk image is produced using:
cd /
dd if=/dev/zero bs=1024 count=32768 of=mdimg
vnconfig -s labels -c vn0 mdimg
disklabel -rw vn0 auto
disklabel -e vn0
copy the c: to a: and change the FS type to 4.2BSD
newfs -b 8192 -f 1024 -U /dev/vn0a
mount /dev/vn0a /mnt
tar cf - bin etc sbin | ( cd /mnt && tar xpf - )
umount /mnt
vnconfig -u vn0
The filesystem contents aren't supposed to be useful
at this point - I just want to get it to mount
3. I install the filesystem image into the kernel
using:
/usr/src/release/write_mfs_in_kernel kernel mdimg
4. In /boot/loader.conf I add:
vfs.root.mountfrom="ufs:/dev/md0a"
Now I reboot with the kernel, and I get:
Mounting root from ufs:/dev/md0a
Root mount failed: 22
Mounting root from ufs:/dev/md0c
Root mount failed: 22
... and then it prompts for a root filesystem.
The EINVAL (error 22) is coming from
kern/subr_diskslice.c:806:
if (part != RAW_PART
&& (sp->ds_label == NULL || part >= sp->ds_label))
return (EINVAL); /* XXX needs translation */
Specifically, part = 0 (!= RAW_PART) and sp->ds_label
= NULL.
I hope it's a trivial step I am missing, but right now
I am stuck.
Sage advice is appreciated.
Regards,
David.
More information about the freebsd-questions
mailing list