install-grub-partition-no-cd
First I used GParted and made an 8 megabyte ext3 partition (moved the winxp partition over) ... I prefer systemrescuecd for this...
then I used mkfs -t ext3 /dev/sda1
fdisk -l
Count out the exact names/locations:
/dev/sda1 = grub partition /dev/sda2 = windows /dev/sda3 = linux /dev/sda4 = swap
Entering the 'grub' command all by itself starts the GRUB environment
grub> setup (hd0) //installs GRUB on the MBR of the first drive grub> setup (hd0,0) //installs GRUB in the boot sector of a specific partition
Now the funny part is I didn't really give GRUB any menu.lst or actual stuff to work with... so the tiny binary installed in the MBR is just the GRUB shell...
NOW FOR THE INSCRUTABLE PART... how to boot windows manually from Grub command line...
grub //enter the grub interactice command prompt //set GRUB's root device to the OS "image" area rootnoverify (hd0,0) //noverify tells GRUB not to worry about file structure makeactive //Set the active partition on the root disk to GRUB's root device chainloader +1 //--force, grab the first sector and pass booting control boot //
I suppose I should figure out how to make the MBR grub like the hd0,0 grub...
If you copy menu.lst, stage1, and stage2 from a working grub installation into a new ext2 or ext3 partition then when you've installed GRUB to the MBR hopefully it will use the menu from there... ?
/boot/grub/menu.lst /boot/grub/stage1 /boot/grub/stage2
IF you choose to eschew the menu you have created (or it didn't load properly) the grub command line has a way of finding possible grub bootable partitions
find /boot/grub/stage1
root (hd0,2) cat (hd0,1)/hints.txt
kernel /boot/vmlinuz26 initrd /boot/archiso_ide.img
Some other interesting command line options:
grub> find /boot/grub/stage1 configfile filename //load file as a configuration file
cat /etc/fstab //that is if you have /etc/fstab available somewhere...
ifconfig [--server=server] [--gateway=gateway] [--mask=mask] [--address=address]
grub> setkey capslock control //change the keyboard map one key at a time grub> setkey control capslock
title Arch Linux 2009.08 //unnecessary?
This will find and set the ISO as root the mapping will make the iso a fake hard drive (number 33?) then I don't know what hook does root makes the iso the root chainloader passes control onto root boot starts the system
find --set-root /archlinux-2009.08-core-i686.iso map /archlinux-2009.08-core-i686.iso (hd32) map --hook root (hd32) chainloader (hd32) boot
-create a mountpoint to mount the ISO with loopback: mkdir /mnt/livecd
-mount the image: mount -t iso9660 -o loop,ro /hda3/filename.iso /mnt/livecd
-create a directory on the device where you are going to boot from: mkdir /mnt/hda3/sysrcd
-copy the contents of the mounted image to that directory: cp -a /mnt/livecd/* /mnt/hda3/sysrcd
-copy kernel and initrd files to yor boot device:
Move sysrcd.dat, sysrcd.md5, initram.igz, rescuecd, rescue64, altker32, altker64 from /mnt/hda3/sysrcd/isolinux to /mnt/hda3/sysrcd
Update your /mnt/hda2/boot/grub/menu.lst
title SystemRescueCd from hard disk root (hd0,2) kernel /sysrcd/rescuecd subdir=sysrcd setkmap=us initrd /sysrcd/initram.igz boot
debian boot parameters
debconf: priority=low DEBIAN_FRONTEND=text INSTALL_MEDIA_DEV=/dev/hda3/debianxfce netcfg/disable_dhcp=true cdrom-detect/eject=false recommends=false
title debian-installer root (hd0,2) kernel /debian-install/install.386/vmlinuz priority=medium DEBIAN_FRONTEND=text INSTALL_MEDIA_DEV=/dev/hda3/debianxfce netcfg/disable_dhcp=true cdrom-detect/eject=false recommends=false initrd /debian-install/install.386/initrd.gz boot
cp --preserve -R /{bin,dev,home,pentest,root,usr,boot,etc,lib,opt,sbin,var} /mnt/bt/