Multi-boot GRUB Editing...

K

kenizl86

Guest
Hello,

I'm having an issue with GRUB. I installed crunchbang on my laptop, and selected the option to have crunchbang install GRUB. After that I installed FreeBSD on another partition. After looking around and doing the recommended actions to edit GRUB to boot FreeBSD (like adding the lines: title FreeBSD 9.2, root (hd0,2), kernel /boot/loader to the /boot/grub/grub.cfg file), it still wouldn't boot FreeBSD.

Does anyone have any clue about what to do? Thanks in advance!
 


C

Cyber-Berserker

Guest
A little more information would be helpful. Does Grub show both systems, but will only boot one, or does it only show Crunchbang?

When I dual-boot, the procedure I use is to not install the second system's boot-loader, boot the first system, run
Code:
update grub
then boot the second system.
 
K

kenizl86

Guest
I ran "sudo update-grub", and the attached image file is what was outputted. I've also attached the grub.cfg file.

On the line in the grub.cfg file that says something about /40_custom (close to the end), those three lines of comments are what is read directly from that file it refers to in the header. So, naturally, I tried to add the menu entry in thatfile like you would with grub (title... root... kernel...), but it wouldn't write it to grub.cfg.

Thanks for the reply!
 

Attachments

K

kenizl86

Guest
Okay, so I did some further research. I found out that the commands I was using are out of date. So I used the new GRUB 2 commands, and inserted this into the /etc/grub.d/40_custom file:
Code:
menuentry "FreeBSD 9.2"{
    set root='(hd0,msdos3)'
    linux /boot/loader
}
Then I ran "sudo update-grub" and everything went okay. I then rebooted my comp and the FreeBSD entry came up in the menu, but when I selected it, it gave me this:
Code:
error: invalid magic number.
So.... Not sure at all what I did wrong. Any pointers?


P.S.- I wrote it to the 40_custom file because it (my references and grub.cfg) said to put it in there. Also, I used msdos3 in the root section because in grub.cfg, crunchbang setup 2 sections that referred to the partition crunchbang was located in was (hd0,msdos1).
 
C

Cyber-Berserker

Guest
Beyond me. When I update grub it detects operating systems, not splash screens. But then, I have never edited any boot files.
 
K

kenizl86

Guest
Alright, I got it all settled. I had to replace the line "linux /boot/loader" with "chainloader +1". I guess this is because it's not a linux image, so it's like doing windows in Grub.

It boots just fine now!
 
V

Videodrome

Guest
I'm interested in trying this. I currently have FreeBSD running on my Netbook.

Right now, I put in a Live USB of Crunchbang to run Gparted. Gparted seems to recongize partitions sda1, sda2, and sda3, but the File System shows as unknown. It doesn't seem to show a way to shrink sda2 to make room for Crunchbang.

I'm wondering if I need a live BSD based partitioning tool? Unless I want to follow the OP's example starting over from scratch with Crunchbang
 
V

Videodrome

Guest
Followed this thread and it worked.

I installed Kali Linux. Partioned room with Gparted. Installed FreeBSD.

I checked what kenizi did and it works :cool:
 


Members online


Top