Fw: Re: Disk partitions cannot be found/mounted after swappi

Duncan Barclay dmlb at dmlb.org
Tue Oct 15 21:37:44 BST 2002

On 15-Oct-2002 David Marsh wrote:
> On Tue, 15 Oct 2002 20:18:36 +0100 (BST)
> Duncan Barclay <dmlb at dmlb.org> wrote:
>> I've hit this problem and cheated in the past by pulling the drive out
>> and onto another machine where I can mount / rw, and then makedev it.
> Neato idea. 
> My other box is penguin-flavoured, however, so I guess it would be
> harder/impossible to get that to work..?
>> The elgant solution that I thought of is to somehow make a RAM disk
>> with mount_mfs and mknod the required device entry in the mfs. Mount /
>> on that r/w, and then create the real entry in /dev.
> Sorry, I'm afraid this is a little over my head.
> Are you suggesting this as a solution for booting from a different disk,
> and then running the following from that environment?

Nope, just boot into single user mode on the machine with the problems.
When you see the "booting /kernel in 10seconds", press the space bar,
and type boot -s.

>> This is from the top of my head. If someone can try it out and make it
>> a script maybe we can put it in /sbin. Call it paddle or canoe or even
>> wetsuit(up s**t creek etc.)
>>         boot -s
comment: boot single user from the boot loader.

>>         ....
>>         mount_mfs -T minimum -s 131072 /dev/null /tmp
comment: create a memory based, read/writable file system and mount it
on /tmp.

>>         cd /tmp
>>         cp /dev/MAKEDEV .
comment: copy /dev/MAKEDEV into /tmp

> Where's the source MAKEDEV coming from? From the disk that was used to
> boot?

>From /dev, MAKEDEV is always kept in /dev. In single user mode you
can see / as read only.

>>         ./MAKEDEV ad1s2a
comment: create a device node in /tmp for your / partition

>>         mount /tmp/ad1s2a /mnt
comment: mount your root partition on /mnt using the device node
we just created in /tmp

>>         cd /mnt/dev
>>         ./MAKEDEV ad1s2a
comment: now cd to where your root partition is mounted read-write,
and make the missing devices nodes on it

now reboot.

There is nothing "special" about /dev to store device nodes. The nodes
are handles to objects that the kernel can know about. the filename
is unimportant. For example you could call ad1s2a something like
/sbin/rootPartition, the kernel wont mind - fdisk, disklabel, dump
etc probably will think you are mad though!

>> Untested apart from the mount_mfs line (/dev/null is not used as the
>> special device, the -T minimum supplies parameters for newfs).
> Thanks for the suggestion, though.
> However, unless anybody can see the reason why the boot sequence can't
> see ad0s2a (when the disks are configured that way, as they are right
> now) even though I seem to have successfully made the device nodes (and
> even though it manages to load the kernel from it), I think I may just
> decide to cut my losses, lose considerable geek points and just go for
> wipe and reinstall.. (I think I've reached the point where I just can't
> be bothered with the hassle now)

what does
        ls -l /dev/ad0*
> There /must/ be something really 'obvious' that is causing this, though!
> David.
> -- 
> David Marsh,  Glasgow, Scotland. --+-+                                 |
>  |-> email,dm at viewport.co.uk       | +-> <http://www.viewport.co.uk/>  |
>  +-> tel: +44 77-121-848-90        |                                   |
>>Trim quotes b4 replying; Quote 1st, reply 2nd;  Ask b4 attaching files<
>> I send documents as RTF for accessibility & virus-safety   ..do you? <
> ------ FreeBSD UK Users' Group  -  Mailing List ------
> http://listserver.uk.freebsd.org/mailman/listinfo/freebsd-users

Duncan Barclay  | God smiles upon the little children,
dmlb at dmlb.org   | the alcoholics, and the permanently stoned.
dmlb at freebsd.org| Steven King

More information about the Ukfreebsd mailing list