Re: MBR Confusion SOLVED
> > I've attached an external hard drive to my etch AMD64 box, booted my > > AMD64 box into the debian installer, and installed a fresh i386 etch > > onto the external drive. > > > > Now I can't boot my box without the external drive attached, because > > grub complains with "error 21." This is fixed. Thanks to everyone for their help. To fix this I booted a RIPLinuX recovery system with the external drive attached, and got a grub command prompt from there. I did "find /vmlinuz" and deduced that hd2 was my external drive as far as grub was concerned. I then typed: root (hd2,0) setup (hd2) These commands apparently installed the proper MBR on on the external drive. I then put that drive into its target host (Pentium III box), and it booted properly. I had two kernels on that disk, the k7 kernel that the etch installer had put there, and the i686 kernel that I had manually added using 'dselect'. So, I just had to get rid of the k7 kernel, and now I have a happy PIII machine, using a hard drive that was built on an AMD system. This was my goal with all of this nonsense, but I'm thinking there must be a better way. My PIII machine seems to have floppy as the only boot option besides hard drive, and I really wanted to avoid stacks of floppies. To fix my AMD grub to boot without the external drive attached I: root (hd0,0) setup (hd0) and all was well. I'm still a bit sketchy on everything that happened here, but I suppose that what the grub manual is for. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: MBR Confusion?
> > [EMAIL PROTECTED]:~$ sudo chroot /mnt/debinst /bin/bash > > chroot: cannot run command `/bin/bash': Exec format error > > I got into this thread late... but this is the error that you get when > the chrooted disk is not mounted with -o exec That doesn't seem to explain my problem: [EMAIL PROTECTED]:~$ sudo mount -o exec /dev/sdc1 /mnt/debinst [EMAIL PROTECTED]:~$ mount |grep debinst /dev/sdc1 on /mnt/debinst type ext3 (rw) [EMAIL PROTECTED]:~$ sudo chroot /mnt/debinst /bin/bash chroot: cannot run command `/bin/bash': Exec format error -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: MBR Confusion?
Matt Miller wrote: I've attached an external hard drive to my etch AMD64 box, booted my AMD64 box into the debian installer, and installed a fresh i386 etch onto the external drive. Now I can't boot my box without the external drive attached, because grub complains with "error 21." So boot into AMD64 with the drive attached, then grub-install /dev/path-to-internal-drive. This doesn't work: [EMAIL PROTECTED]:~$ sudo grub-install /dev/sdc Searching for GRUB installation directory ... found: /boot/grub /usr/sbin/grub-install: line 484: /usr/sbin/grub: cannot execute binary file /usr/sbin/grub-install: line 484: /usr/sbin/grub: cannot execute binary file /usr/sbin/grub-install: line 484: /usr/sbin/grub: cannot execute binary file /usr/sbin/grub-install: line 484: /usr/sbin/grub: cannot execute binary file /usr/sbin/grub-install: line 484: /usr/sbin/grub: cannot execute binary file The file /boot/grub/stage1 not read correctly. Maybe this is related to my original problem of not being able to chroot into that i386 system: [EMAIL PROTECTED]:~$ sudo chroot /mnt/debinst /bin/bash chroot: cannot run command `/bin/bash': Exec format error I got into this thread late... but this is the error that you get when the chrooted disk is not mounted with -o exec Hugo -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: MBR Confusion?
> > I've attached an external hard drive to my etch AMD64 box, booted my > > AMD64 box into the debian installer, and installed a fresh i386 etch > > onto the external drive. > > > > Now I can't boot my box without the external drive attached > > you're done. > > It looks like the MBR of your Etch installation was rewritten so that > grub now looks for /boot on the external drive. > > The Etch installer disk has a rescue mode which should allow you to > make your normal installation bootable again. I tried this, but no luck. I typed "rescue" at the installer's "boot:" prompt, and the installer started in "Rescue Mode." It eventually came to the point of listing all HD partitions on the system, and told me to select one to perform rescue operations on. However, no matter which partition I select I immediately get a failure message. I go to the console on Alt/F4 to see syslog messages, and all I see is basically a "device busy" error when the installer tries to mount the partition. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: MBR Confusion?
> > I've attached an external hard drive to my etch AMD64 box, booted > > my AMD64 box into the debian installer, and installed a fresh i386 > > etch onto the external drive. > > > > Now I can't boot my box without the external drive attached, > > because grub complains with "error 21." > > So boot into AMD64 with the drive attached, then grub-install > /dev/path-to-internal-drive. This doesn't work: [EMAIL PROTECTED]:~$ sudo grub-install /dev/sdc Searching for GRUB installation directory ... found: /boot/grub /usr/sbin/grub-install: line 484: /usr/sbin/grub: cannot execute binary file /usr/sbin/grub-install: line 484: /usr/sbin/grub: cannot execute binary file /usr/sbin/grub-install: line 484: /usr/sbin/grub: cannot execute binary file /usr/sbin/grub-install: line 484: /usr/sbin/grub: cannot execute binary file /usr/sbin/grub-install: line 484: /usr/sbin/grub: cannot execute binary file The file /boot/grub/stage1 not read correctly. Maybe this is related to my original problem of not being able to chroot into that i386 system: [EMAIL PROTECTED]:~$ sudo chroot /mnt/debinst /bin/bash chroot: cannot run command `/bin/bash': Exec format error -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: MBR Confusion? (was: Building i386 Disk on AMD64 -- chroot Fails: Exec format error)
On Sat, Apr 07, 2007 at 01:30:57 +0200, Matt Miller wrote: > > I've attached an external hard drive to my etch AMD64 box, booted my > > AMD64 box into the debian installer, and installed a fresh i386 etch > > onto the external drive. > > Now I can't boot my box without the external drive attached, because > grub complains with "error 21." I'm thinking that when the debian > installer made the external drive bootable with my new i386 etch some > stuff happened with the master boot record or something. Also, when I > put the external drive into my Pentium III box, nothing happens. > Apparently the right MBR stiff is not on there. > > Anyway, I'm in a bit deep at this point. Hopefully there is some simple > way to prepare the external drive on my AMD64 box to be the internal, > bootable drive of my Pentium III, and to tell grub on my AMD64 box that > it doesn't need the external drive attached in order to boot. > > Go ahead and laugh. Just give me some good advice when you're done. It looks like the MBR of your Etch installation was rewritten so that grub now looks for /boot on the external drive. The Etch installer disk has a rescue mode which should allow you to make your normal installation bootable again. I think you just have to type "rescue" at the boot prompt and off you go. It will try to find your root partition and reconstruct the MBR and grub accordingly. I never had to use this myself therefore I am shaky on the details. Try the F1 - F7 online help of the installation disk. Also, see here: http://www.debian-administration.org/articles/325 (If the other system cannot boot from USB directly then you might have to make a grub boot disk for it.) -- Regards, Florian -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: MBR Confusion?
Florian Kulzer wrote: On Sat, Apr 07, 2007 at 01:30:57 +0200, Matt Miller wrote: I've attached an external hard drive to my etch AMD64 box, booted my AMD64 box into the debian installer, and installed a fresh i386 etch onto the external drive. Now I can't boot my box without the external drive attached, because grub complains with "error 21." So boot into AMD64 with the drive attached, then grub-install /dev/path-to-internal-drive. You may need to update the menu.lst on the AMD64 partition to include the i386 partition on the external drive if you still want to boot it. HTH Wackojacko -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: MBR Confusion
On Sat, Apr 07, 2007 at 01:30:57AM +0200, Matt Miller wrote: > > I've attached an external hard drive to my etch AMD64 box, booted my > > AMD64 box into the debian installer, and installed a fresh i386 etch > > onto the external drive. > > Now I can't boot my box without the external drive attached, because > grub complains with "error 21." I'm thinking that when the debian > installer made the external drive bootable with my new i386 etch some > stuff happened with the master boot record or something. Also, when I > put the external drive into my Pentium III box, nothing happens. > Apparently the right MBR stiff is not on there. > > Anyway, I'm in a bit deep at this point. Hopefully there is some simple > way to prepare the external drive on my AMD64 box to be the internal, > bootable drive of my Pentium III, and to tell grub on my AMD64 box that > it doesn't need the external drive attached in order to boot. > > Go ahead and laugh. Just give me some good advice when you're done. I'll only laugh 'cause you told me to. Lets clarify: AMD64 box has an internal hard drive with Etch installed on it. Should have grub in the mbr, with menu.lst on the internal hard drive. AMD64 box also has external drive with Etch installed on it. Should have grub in its mbr, with menu.lst on the external hard drive. With external box attached, can get grub on the external drive and it boots to the external drive OK. Without external box attached, grub complains Error 21. pinfo grub says error 21 means: Selected disk does not exist. This error is returned if the device part of a device- or full file name refers to a disk or BIOS device that is not present or not recognized by the BIOS system. So the bios has changed how it accesses drives since you installed on the external drive. What does your bios show? Can you boot from within the grub command line (read the grub manual)? Can you boot the install CD is rescue mode and reinstall grub? All with the external drive uninstalled. Then put that external drive into the target box and do similar incantations to get grub to work there too. Its _probably_ safe to assume that all your stuff is still on the drives, its just a booting/grub problem. Print out your /boot/grub/menu.lst file so you know what grub is supposed to be trying to do (and so you have all the kernel params you need), then try entering it manually. When I use grub interactivly, I don't bother with grub's root( command, I just preface each with the full path including device. With grub's tab-completion this is pretty simple. Good luck. Doug. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: MBR Confusion? (was: Building i386 Disk on AMD64 -- chroot Fails: Exec format error)
> I've attached an external hard drive to my etch AMD64 box, booted my > AMD64 box into the debian installer, and installed a fresh i386 etch > onto the external drive. Now I can't boot my box without the external drive attached, because grub complains with "error 21." I'm thinking that when the debian installer made the external drive bootable with my new i386 etch some stuff happened with the master boot record or something. Also, when I put the external drive into my Pentium III box, nothing happens. Apparently the right MBR stiff is not on there. Anyway, I'm in a bit deep at this point. Hopefully there is some simple way to prepare the external drive on my AMD64 box to be the internal, bootable drive of my Pentium III, and to tell grub on my AMD64 box that it doesn't need the external drive attached in order to boot. Go ahead and laugh. Just give me some good advice when you're done. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]