NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: use NetBSD to use grub to boot Linux on USB disk

On Wed, Sep 01, 2010 at 09:19:42PM -0500, Jeremy C. Reed wrote:
> I have this:
> sd0 at scsibus0 target 0 lun 0: <SanDisk, Cruzer, 8.02> disk removable
> It is format with DOS. I can mount with msdos fine.
> I am trying to get it to be bootable. (I will boot a live image where I 
> extracted files from an Linux ISO image using vnconfig ...)
> I have grub-0.97nb9. I ran:
> $ sudo mount /dev/sd0e /mnt
> $ sudo grub-install --root-directory=/mnt /dev/sd0
> The file /mnt/grub/stage1 not read correctly.
> I do have /mnt/grub/stage1. grub-install copied the files. I think 
> problem is that it is looking for "/mnt" but is rooted to /.
> I also changed the /mnt/grub/ to contain:
> (fd0)   /dev/rsd0d
> (hd0)   /dev/rsd0d
> (hd1)   /dev/rsd0d
> But no change.
> If I don't use --root-directory, it ends up installing my  
> /usr/pkg/lib/grub/i386-/ to my harddisk at /grub. (I do not want to 
> touch my harddisk). And it has the same error "The file 
> /grub/stage1 not read correctly."
> Any ideas?

First and foremost, don't use grub.

But, my notes say this:

fdisk sd0
newfs_ext2fs sd0e
mount /dev/sd0e /mnt
mkdir /mnt/boot
cp -PRp /usr/pkg/lib/grub/i386- /mnt/boot
grub --no-curses
root (hd1,0)
setup --prefix=/boot --stage2=/mnt/boot/stage2 (hd1)

You may not need --no-curses if you built grub with real

And be sure you have the right bootloader on your host system
before rebooting.

Hope that helps.

        Jonathan Kollasch

Home | Main Index | Thread Index | Old Index