Re: chroot problem with grub
On Thu, 2006-04-13 at 12:13 -0600, Justin Guerin wrote: Hi, I've had to move my install to a new physical disk. I made an image of my two partitions (/boot and /), and they restored properly. Now, I only need to run grub-install to install the boot loader. When I boot from Knoppix, I can mount the / to /mnt/target, then mount /boot to /mnt/target/boot, and /proc to /mnt/target/proc, but I can't get grub-install to work properly. When I chroot /mnt/target, and run grub, grub can't see the drives (error 21). However, when I back out of the chroot, grub sees the drives just fine. Can anyone tell me how grub accesses the bios to find out information about drives? I'm not passing something through the chroot, but I have no idea what. The device nodes are available in the chroot, and so is proc. I'm running as root, and I know I have access to the device nodes. Any help is appreciated. Justin Justin, I don't think it is necessary to chroot at all. The knoppix disk has grub on board, so you can use that command. The command also has a command line switch to specify a device (/dev/hda for instance) and you can also specify a root-dir. If you specify as root-dir the mount point of your system (/mnt/target) grub will take the config file from /mnt/target/boot/...) and everything should work just fine. If you search the internet (or the manual perhaps) for this specific info you'll find a lot more. Good luck Philippe De Ryck -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: chroot problem with grub
On Thu, 13 Apr 2006 21:21:44 +0200 Philippe De Ryck [EMAIL PROTECTED] wrote: On Thu, 2006-04-13 at 12:13 -0600, Justin Guerin wrote: Hi, I've had to move my install to a new physical disk. I made an image of my two partitions (/boot and /), and they restored properly. Now, I only need to run grub-install to install the boot loader. When I boot from Knoppix, I can mount the / to /mnt/target, then mount /boot to /mnt/target/boot, and /proc to /mnt/target/proc, but I can't get grub-install to work properly. When I chroot /mnt/target, and run grub, grub can't see the drives (error 21). However, when I back out of the chroot, grub sees the drives just fine. Can anyone tell me how grub accesses the bios to find out information about drives? I'm not passing something through the chroot, but I have no idea what. The device nodes are available in the chroot, and so is proc. I'm running as root, and I know I have access to the device nodes. Any help is appreciated. Justin Justin, I don't think it is necessary to chroot at all. The knoppix disk has grub on board, so you can use that command. The command also has a command line switch to specify a device (/dev/hda for instance) and you can also specify a root-dir. If you specify as root-dir the mount point of your system (/mnt/target) grub will take the config file from /mnt/target/boot/...) and everything should work just fine. If you search the internet (or the manual perhaps) for this specific info you'll find a lot more. Good luck Philippe De Ryck This will work, but will install the grub version from Knoppix. If you still want to do via chroot here's the recipe. Commands indented for visibility (# means the root prompt, you can use sudo instead) and assuming hda2 is your '/' and hda1 is your '/boot': 1. mount your / /boot AND /dev: #mount /dev/hda2 /mnt/target #mount /dev/hda1 /mnt/target/boot #mount -o remount /dev /mnt/target/dev 2. chroot: #chroot /mnt/target 3. mount /proc: #mount /proc 4. install grub: #grub-install /dev/hda This should do it. The first part is the one that can create problems. If you mount / via Knoppix's fstab then you won't be able to mount /dev due to the nodev option ;) (This is documented on Knoppix's site) HTH Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
chroot problem with grub
Hi, I've had to move my install to a new physical disk. I made an image of my two partitions (/boot and /), and they restored properly. Now, I only need to run grub-install to install the boot loader. When I boot from Knoppix, I can mount the / to /mnt/target, then mount /boot to /mnt/target/boot, and /proc to /mnt/target/proc, but I can't get grub-install to work properly. When I chroot /mnt/target, and run grub, grub can't see the drives (error 21). However, when I back out of the chroot, grub sees the drives just fine. Can anyone tell me how grub accesses the bios to find out information about drives? I'm not passing something through the chroot, but I have no idea what. The device nodes are available in the chroot, and so is proc. I'm running as root, and I know I have access to the device nodes. Any help is appreciated. Justin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: chroot problem with grub
On Thursday 13 April 2006 13:21, Philippe De Ryck wrote: On Thu, 2006-04-13 at 12:13 -0600, Justin Guerin wrote: Hi, [snip problem] Justin, I don't think it is necessary to chroot at all. The knoppix disk has grub on board, so you can use that command. The command also has a command line switch to specify a device (/dev/hda for instance) and you can also specify a root-dir. If you specify as root-dir the mount point of your system (/mnt/target) grub will take the config file from /mnt/target/boot/...) and everything should work just fine. If you search the internet (or the manual perhaps) for this specific info you'll find a lot more. Good luck Philippe De Ryck You're right, it wasn't necessary to chroot. I simply mounted the drives and issued the command grub-install --root-directory=/mnt/target /dev/hda and it worked. For good measure, before I rebooted, I chrooted and ran update-grub, but I'm not certain that was necessary. Now, all my kernels are back and working. Thanks Philippe! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]