From owner-freebsd-questions@FreeBSD.ORG Thu Mar 10 20:02:46 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B57C616A4CE for ; Thu, 10 Mar 2005 20:02:46 +0000 (GMT) Received: from web52608.mail.yahoo.com (web52608.mail.yahoo.com [206.190.39.146]) by mx1.FreeBSD.org (Postfix) with SMTP id 2B79C43D31 for ; Thu, 10 Mar 2005 20:02:46 +0000 (GMT) (envelope-from davidclear@yahoo.com) Received: (qmail 78141 invoked by uid 60001); 10 Mar 2005 20:02:45 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=Um8LHaUlznParbDiNOh/w8yuF9F5p+jr3Pa8B5CX9unKiSk+jgKtSXPWUKWdifZdZmHEg5S9bLdyQLZY+dOhrSlYAb25tDVTWpLNnAmTIwJSJnqcVrcYEHfRgNPyhAZ265gOZz7y7VtEM46QNx4/AS12J7EuNRb26huNAG21Cjk= ; Message-ID: <20050310200245.78139.qmail@web52608.mail.yahoo.com> Received: from [69.237.122.17] by web52608.mail.yahoo.com via HTTP; Thu, 10 Mar 2005 12:02:45 PST Date: Thu, 10 Mar 2005 12:02:45 -0800 (PST) From: David Clear To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: FreeBSD-4.11 - Need help with booting with an MD_ROOT X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2005 20:02:47 -0000 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.