Re: Bootloader/Replace GRUB

2013-05-13 Thread Ralf Mardorf
This one is tricky, but it does work.
I've got two SATA HDDs, Linux names are sda and sdb.
/dev/sda1 is ufs including my FreeBSD and /dev/sdb1 is ntfs including
the Windows XP install, there are many other installs, all of them are
Linux distros.
To install XP on /dev/sdb1 I had to disconnect /dev/sda1.

"With Windows

This assumes that your Windows partition is sda3. Remember you need to
point set root and chainloader to the system reserve partition that
windows made when it installed, not the actual partition windows is on.
This example works if your system reserve partition is sda3.

# (2) Windows XP
menuentry "Windows XP" {
set root=(hd0,3)
chainloader (hd0,3)+1
}

If the Windows bootloader is on an entirely different hard drive than
GRUB, it may be necessary to trick Windows into believing that it is the
first hard drive. This was possible with drivemap. Assuming GRUB is on
hd0 and Windows is on hd2, you need to add the following after set root:

drivemap -s hd0 hd2" - https://wiki.archlinux.org/index.php/Grub#Dual-booting

So for my grub.cfg on a Linux on /dev/sdb9, resp. inside the MBR of sda,
I need to add a chainloader.

[rocketmouse@archlinux ~]$ cat /mnt/q/boot/grub/grub.cfg
set timeout=8
set default='0'; if [ x"$default" = xsaved ]; then load_env; set 
default="$saved_entry"; fi
set color_normal='light-blue/black'; set color_highlight='light-cyan/blue'

menuentry "FreeBSD"{
set root=(hd0,msdos1)
chainloader +1
}

menuentry "XP"{
set root=(hd1,1)
drivemap -s hd0 hd1
chainloader +1
}

menuentry 'Ubuntu Quantal,kernel 3.6.5-rt14' {
  set root='(hd1,9)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-3.6.5-rt14' '/boot/vmlinuz-3.6.5-rt14' 
'root=/dev/sdb9' 'ro' 'quiet' ''
  legacy_initrd '/boot/initrd.img-3.6.5-rt14' '/boot/initrd.img-3.6.5-rt14'
  
}

[snip]

___
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"


Re: Bootloader/Replace GRUB

2013-05-13 Thread Ralf Mardorf
On Mon, 2013-05-13 at 12:41 -0400, Louis Ciotti wrote:
> Hello,
> 
> I replaced a Linux partition on my laptop with FreeBSD.  Now it will not
> but giving me an GRUB error.  I assume I have to remove/replace GRUB, as I
> will want to dual boot this with a windows partition.
> 
> So being the FreeBSD newbie that I am I am stumped on what to do to correct
> this.

Unfortunately I need to install Windows to test hardware that is less
good supported by Linux and FreeBSD, I guess it should be able to boot
Windows by a chainloader. I'm using GRUB2 from Linux to boot between
FreeBSD and Linux installs.

I converted a GRUB legacy menu.lst to a GRUB 2 grub.cfg using an
application doing the work for me, that's why there are strange commands
in my grub.cfg [1].

I planned to install Windows first and after that to edit the grub.cfg,
but because you need help, I'll google now to help myself too ;).

I found this:

menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod fat
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 2629-16f0
drivemap -s (hd0) ${root}
chainloader +1
}

But I guess, it can be written as it's done for my FreeBSD [1], the
above entry perhaps is done by this GRUB-auto-thingy, something I don't
use.

Backup your MBRs (or what ever you're using ;), before you continue ;)!

[1]
set timeout=8
set default='0'; if [ x"$default" = xsaved ]; then load_env; set
default="$saved_entry"; fi
set color_normal='light-blue/black'; set
color_highlight='light-cyan/blue'

menuentry "FreeBSD"{
set root=(hd0,msdos1)
chainloader +1
}

menuentry 'Ubuntu Quantal,kernel 3.6.5-rt14' {
  set root='(hd1,9)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-3.6.5-rt14' '/boot/vmlinuz-3.6.5-rt14'
'root=/dev/sdb9' 'ro' 'quiet' ''
  legacy_initrd '/boot/initrd.img-3.6.5-rt14'
'/boot/initrd.img-3.6.5-rt14'
  
}

menuentry 'Ubuntu Quantal,kernel 3.5.0-18-lowlatency
threadirqs' {
  set root='(hd1,9)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-3.5.0-18-lowlatency'
'/boot/vmlinuz-3.5.0-18-lowlatency' 'root=/dev/sdb9' 'ro' 'quiet'
'threadirqs'
  legacy_initrd '/boot/initrd.img-3.5.0-18-lowlatency'
'/boot/initrd.img-3.5.0-18-lowlatency'
  
}

menuentry 'Ubuntu Quantal,kernel 3.5.0-18-lowlatency (recovery
mode)' {
  set root='(hd1,9)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-3.5.0-18-lowlatency'
'/boot/vmlinuz-3.5.0-18-lowlatency' 'root=/dev/sdb9' 'ro' 'single'
  legacy_initrd '/boot/initrd.img-3.5.0-18-lowlatency'
'/boot/initrd.img-3.5.0-18-lowlatency'
  
}

menuentry 'Ubuntu Studio Quantal, Kernel 3.6.5-rt14' {
  set root='(hd1,13)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-3.6.5-rt14' '/boot/vmlinuz-3.6.5-rt14'
'root=/dev/sdb13' 'ro' 'quiet'
  legacy_initrd '/boot/initrd.img-3.6.5-rt14'
'/boot/initrd.img-3.6.5-rt14'
  
}

menuentry 'Ubuntu Studio Quantal, Kernel 3.5.0-18-lowlatency
threadirqs' {
  set root='(hd1,13)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-3.5.0-18-lowlatency'
'/boot/vmlinuz-3.5.0-18-lowlatency' 'root=/dev/sdb13' 'ro' 'quiet'
'threadirqs'
  legacy_initrd '/boot/initrd.img-3.5.0-18-lowlatency'
'/boot/initrd.img-3.5.0-18-lowlatency'
  
}

menuentry 'Ubuntu Studio Precise, Kernel 3.0.30 threadirqs' {
  #set root='(hd1,1)'; set legacy_hdbias='0'
  #legacy_kernel   '/boot/vmlinuz-3.0.30' '/boot/vmlinuz-3.0.30'
'root=UUID=338316fb-364e-4a43-8deb-738127f878ce' 'ro' 'quiet'
'threadirqs'
  set root='(hd2,1)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-3.0.30' '/boot/vmlinuz-3.0.30'
'root=UUID=948e9fa0-1bb5-4fd4-847c-a7cfbc816a40' 'ro' 'quiet'
'threadirqs'
  legacy_initrd '/boot/initrd.img-3.0.30' '/boot/initrd.img-3.0.30'
  
}

menuentry 'Ubuntu Studio Precise, Kernel 3.2.0-23-lowlatency
threadirqs' {
  #set root='(hd1,1)'; set legacy_hdbias='0'
  #legacy_kernel   '/boot/vmlinuz-3.2.0-23-lowlatency'
'/boot/vmlinuz-3.2.0-23-lowlatency'
'root=UUID=338316fb-364e-4a43-8deb-738127f878ce' 'ro' 'quiet'
'threadirqs'
  set root='(hd2,1)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-3.2.0-23-lowlatency'
'/boot/vmlinuz-3.2.0-23-lowlatency'
'root=UUID=948e9fa0-1bb5-4fd4-847c-a7cfbc816a40' 'ro' 'quiet'
'threadirqs'
  legacy_initrd '/boot/initrd.img-3.2.0-23-lowlatency'
'/boot/initrd.img-3.2.0-23-lowlatency'
  
}

menuentry 'AVlinux 5.0.3, Kernel 3.0.23-rt40' {
  set root='(hd1,11)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-3.0.23-rt40'
'/boot/vmlinuz-3.0.23-rt40' 'root=/dev/sdb11' 'ro' 'quiet'
  legacy_initrd '/boot/initrd.img-3.0.23-rt40'
'/boot/initrd.img-3.0.23-rt40'
  
}

menuentry 'AVlinux 5.0.3, Kernel 3.0.23-avl-7-pae threadirqs' {
  set root='(hd1,11)'; set legacy_hdbias='0'
  legacy_kernel   '/boot/vmlinuz-3.0.23-avl-7-pae'
'/boot/vmlinuz-3.0.23-avl-7-pae' 'root=/dev/sdb11' 'ro' 'threadirqs'
'quiet'
  legacy_initrd '/boot/initrd.img-3.0.23-avl-7-pae'
'/boot/initrd.img-3.0.23-avl-7-pae'
  
}

menuentry 'Edubuntu 10.10,Kernel 2.6.33.9-rt31' 

Re: Bootloader/Replace GRUB

2013-05-13 Thread Jeff Tipton

On 05/13/2013 19:41, Louis Ciotti wrote:

Hello,

I replaced a Linux partition on my laptop with FreeBSD.  Now it will not
but giving me an GRUB error.  I assume I have to remove/replace GRUB, as I
will want to dual boot this with a windows partition.

So being the FreeBSD newbie that I am I am stumped on what to do to correct
this.

Thanks,

Lou
___
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"

Hi,

If it's an MBR partition, you can boot from a live CD (or installation 
CD and choose "Live CD"), log in as root and:


/sbin/gpart bootcode -b /boot/boot0 ada0

where ada0 is the HDD device. (Check gpart man page for more examples 
and parameters)


This will create a simple boot selector where you can choose between 
Windows/FreeBSD. There's also grub and grub2 in the ports but I've not 
tried.


-Jeff
___
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"


Bootloader/Replace GRUB

2013-05-13 Thread Louis Ciotti
Hello,

I replaced a Linux partition on my laptop with FreeBSD.  Now it will not
but giving me an GRUB error.  I assume I have to remove/replace GRUB, as I
will want to dual boot this with a windows partition.

So being the FreeBSD newbie that I am I am stumped on what to do to correct
this.

Thanks,

Lou
___
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"