Re: About my problem

From: Eduardo Viruena Silva (mrspock_at_esfm.ipn.mx)
Date: 05/14/03

  • Next message: Matthew Seaman: "Re: Php apachec problem"
    Date: Wed, 14 May 2003 13:16:10 -0500 (CDT)
    To: Teilhard Knight <teilhk@Phreaker.net>
    
    

    On Wed, 14 May 2003, Teilhard Knight wrote:

    > On Wed, 2003-05-14 at 04:38, Matthew Seaman wrote:
    > > On Wed, May 14, 2003 at 02:18:22AM -0500, Teilhard Knight wrote:
    > > > For those who do not know what I am talking about, this is what is
    > > > happening to me:
    > > >
    > > >
    > > > I have compiled my kernel. Everything seems to be all right,
    > > > except that on boot it cannot mount root.
    > > >
    > > > It displays: "mounting root from ufs:ad2s2a", and a failure message.
    > > >
    > > > Now, I am left at boot with an inquire for a manual root filesystem
    > > > specification., like this:
    > > >
    > > > <fstype><device> mount <device> using filesystem <fstype>
    > > >
    > > > eg. ufs:/dev/da0s1a
    > > >
    > > > ? List valid disk boot devices
    > > >
    > > > <empty line> abort manual imput
    > > >
    > > > mountroot>
    > > >
    > > >
    > > > The HD where FreeBSD is installed is ad2 in my previous kernel and in
    > > > this new one it is ad1. I have now found out that this is the source of
    > > > the problem. I checked the partition table, and the slices are called
    > > > ad2s2a --> ad2s2g. If this is the case, no way I can mount root on a
    > > > disk called ad1 with those slices.
    > > >
    > > > So, I'll pose a different question. Do you know of a possible way I can
    > > > make my new kernel to spot my HD as ad2? To me this is the only solution
    > > > possible.
    > >
    > > Hmmm... It's not impossible to recover from the situation you're in
    > > without having to do anything unaesthetic, like re-installing. It is,
    > > however, fairly tricky and requires use of some quite unfriendly
    > > commands.
    > >
    > > Your aim is simply to edit /etc/fstab and change all references to ad2
    > > over to ad1. Since the fstab is not correct for your current machine,
    > > you can't boot to multiuser mode. You can, however, boot to single
    > > user mode with the root partition you tell the kernel as above. After
    > > power-on, interrupt the 10 second count down, and at the boot loader
    > > prompt type:
    > >
    > > set root_disk_unit=1
    > > boot /kernel -s

    your system seems to ve 4.x.
    your kernel is, somehow, badly created.

    why don't you try the generic kernel that [I hope] must be there

            boot /kernel.GENERIC -s
    or
            boot /kernel.old -s

    and follow the instruction given by Mattew.

    > >
    > > This should get you to the single user prompt, but with the root
    > > partition mounted read-only. In order to remount the root partition
    > > read-write, you need to do two things. First, run fsck(8) to clean up
    > > the file system and then run mount(8). Catch22 is that both of those
    > > commands will use /etc/fstab as a database of filesystems to work on,
    > > unless you take care to avoid that. Assuming that your root partition
    > > is on /dev/ad1s1a, run:
    > >
    > > # fsck /dev/ad1s1a
    > > # mount -u -o rw -t ufs /dev/ad1s1a /
    > >
    > > (Basically, you need to supply all required arguments to mount(8), to
    > > stop it going to /etc/fstab to try and look them up.)
    > >
    > > Now you've got the root partition mounted read-write, you can edit the
    > > /etc/fstab file. The tricky bit is that you only have the commands in
    > > /bin available to do the editing with (assuming that you've used the
    > > usual /, /usr partition layout). That means that you now have to get
    > > down and dirty with ed(1) -- the Unix editor of last resort. This
    > > command was originally designed for use on a teletype printer, so it
    > > doesn't show you a listing of the whole file and let you navigate
    > > around it in a natural way. The command syntax is a bit intimidating
    > > to the uninitiated too. You can see the ed(1) man page at
    > >
    > > http://www.freebsd.org/cgi/man.cgi?query=ed&apropos=0&sektion=0&manpath=FreeBSD+4.7-stable&format=html
    > >
    > > Try this:
    > >
    > > Nb. You type the lines marked '<--' in the ed session.
    > >
    > > # cd /etc
    > > # cp fstab fstab.bak
    > > # ed fstab
    > > 448 (--> ed outputs the size of the file here)
    > > (<-- hit return, to get the ? prompt)
    > > ? (--> ed output)
    > > ,s/ad2/ad1/g (<-- substitute 'ad1' for 'ad2' everywhere)
    > > ,w (<-- write out the changed file)
    > > 448 (--> ed tells you the modified file size)
    > > q (<-- quit ed)
    > > # cat fstab
    > >
    > > Check the new contents of the fstab file for sanity. If you're happy,
    > > then try and fsck and mount all your filesystems:
    > >
    > > # fsck -p
    > > # mount -a
    > >
    > > If that works satisfactorily, you're done, and you can just type
    > >
    > > # reboot
    > >
    > > and the system *should* come up smoothly.
    >
    >
    >
    >
    > Thank you, Matthew. I tried as you said, but I couldn't pass the first
    > step. I got the message: "cannot boot /kernel, kernel module already
    > loaded" Of course I tried "kernel" and other variants. If I typed
    > "unload" and then what you said, I ended up with the prompt for the
    > manual file system feed. But I could boot with a kernel back up I had
    > and I made the modifications to the fstab file with a regular editor. My
    > doubt was that the slices still were called ads2s2a, etc., but I
    > supposed that that could change with the changes in the fstab file. I
    > knew that if something went wrong, I could not boot anymore from my back
    > up kernel, but I would get to the same request for a hand-input
    > filesystem and I would only had to specify ad2s2a. Well, nothing worked.
    > I cannot boot now. It seems to me that the utility to specify by hand
    > the filesystem either doesn't work or that I have a deeper problem here.
    > I am now tempted to get done with 4.8 and try 5.0. What do you think?
    >
    >
    > By the way, I tried the repair console, and just the first feel of it
    > made me step back.
    >
    >
    > Teilhard Knight
    > The Extraterrestrial
    >
    > Who ate my sandwich?
    >
    >
    > _______________________________________________
    > freebsd-questions@freebsd.org mailing list
    > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
    >

    - ______ _
                * / /###\ / \ __
     /\ /\ * / ./#### \ * \__|_/ | |
    / \/ \ | b#####| * _ | __ | | __
    = .. \____ \ \_\#####/ / \| / \ | | /\_\/
    = \_| * \___\###/ * \_/\_/\__/\__\/_/\__/
     = \______/ _
      | |
    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"


  • Next message: Matthew Seaman: "Re: Php apachec problem"

    Relevant Pages

    • Proposed update of the i386 boot document
      ... THE LINUX/I386 BOOT PROTOCOL ... the Linux kernel uses a rather complicated boot ... may not even support a command line. ... low memory touched by the boot loader -- as low as possible, ...
      (Linux-Kernel)
    • Re: GRUB module query
      ... directly compiled into the kernel since it needs it to boot:) ... Is there a way to load the kernel with modules right from boot? ... Set GRUB's root device to the drive where the OS images are ... stored by the command @command. ...
      (Ubuntu)
    • Re: SuSE8.2 root RAID1 reiserfs, always resyncing after boot
      ... The mkraid command has repaired the faulty configuration in the ... The use of kernel 2.6.4 stopped the repetitive re-syncing after boot. ... Make absolutely sure the command completes without error, ...
      (comp.os.linux.setup)
    • Re: GRUB module query
      ... to be directly compiled into the kernel since it needs it to boot:) ... Is there a way to load the kernel with modules right from boot? ... Set GRUB's root device to the drive where the OS images are ... stored by the command @command. ...
      (Ubuntu)
    • 2.6.28-rc2: REGRESSION in early boot
      ... I've opened a Kernel Bug to track this regression: ... Essentially, the system panics in early boot, resulting in multiple ... commit d6c88a507ef0b6afdb013cba4e7804ba7324d99a ... # Device Drivers ...
      (Linux-Kernel)