Multi-boot GRUB Editing...

Discussion in 'General Linux' started by kenizl86, Nov 23, 2013.

  1. kenizl86

    kenizl86 New Member

    Messages:
    9
    Likes Received:
    2
    Trophy Points:
    3
    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!

  2. Cyber-Berserker

    Cyber-Berserker Active Member

    Messages:
    232
    Likes Received:
    139
    Trophy Points:
    43
    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.
  3. kenizl86

    kenizl86 New Member

    Messages:
    9
    Likes Received:
    2
    Trophy Points:
    3
    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!

    Attached Files:

  4. kenizl86

    kenizl86 New Member

    Messages:
    9
    Likes Received:
    2
    Trophy Points:
    3
    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).
  5. Cyber-Berserker

    Cyber-Berserker Active Member

    Messages:
    232
    Likes Received:
    139
    Trophy Points:
    43
    Beyond me. When I update grub it detects operating systems, not splash screens. But then, I have never edited any boot files.
  6. kenizl86

    kenizl86 New Member

    Messages:
    9
    Likes Received:
    2
    Trophy Points:
    3
    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!
  7. Videodrome

    Videodrome Active Member

    Messages:
    207
    Likes Received:
    79
    Trophy Points:
    28
    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
  8. Videodrome

    Videodrome Active Member

    Messages:
    207
    Likes Received:
    79
    Trophy Points:
    28
    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:

Share This Page