Find the answer to your Linux question:
Results 1 to 9 of 9
Hello, This is my first post and I am not sure if thats the right forum to ask this question. I am trying to set up grub2 on a separate ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2011
    Posts
    5

    Question Grub2 help


    Hello,
    This is my first post and I am not sure if thats the right forum to ask this question.

    I am trying to set up grub2 on a separate partition in an external hard drive. I have installed grub 1.99 in the mbr and made "grub.cfg". The menu works. It shows all the items, timeout etc. However, i cannot set up the menu item. I am trying to put gparted live cd in it (from gparted page (GParted Live on Hard Disk) - cannot post urls ). However, I can't get it to work.


    Here is what i did:
    1. I made a fat32 partition (200MB) and stored the gparted files in it.
    2. i changed the directory live to live-hd (i don't know why honestly, i just did whats written in gparted).
    3. I found out that the partition is sdb6 (using fdisk)
    4. grub.cfg menuentry:
    Code:
    menuentry "Gparted Live" {
            set root=(hd0, msdos6)
            linux /live-hd/vmlinuz boot=live config union=aufs noswap noprompt vga=788 ip=frommedia live-media-path=/live-hd bootfrom=/dev/hda6 toram=filesystem.
    squashfs
            initrd /live-hd/initrd.img
    
    }
    NOTE. the image names are vmlinuz and initrd (no "1" in the end although shown in the gparted help page)

    When i click on "Gparted Live". It keeps giving me error
    "Disk not found"
    "Kernel must be loaded before booting"

    What am i doing wrong? is there a module i have to initialize with insmod inside the menuentry?

    I hope i provided you with enough information. Thanks in advance.

    Gasim

    P.S i made memtest working with the same grub.cfg but the image for it was inside the boot partition (hd0, msdos5). So, im definitely sure that there is no grubenv settings or anything missing there.

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    Is your intention just to be able to boot a live GParted from your hard drive? If so, it might be easier to just put the iso file of GParted in the / system and use the loopback method from Grub2. I've done that with Parted Magic and it should be fairly easy to do with GParted, don't know for sure as I haven't tried.

    Do you have a directory named live-hd with the kernel in it on the partition (sda6). I'm not really sure what your intentions are.

  3. #3
    Just Joined!
    Join Date
    Jun 2011
    Posts
    5
    Quote Originally Posted by yancek View Post
    Is your intention just to be able to boot a live GParted from your hard drive? If so, it might be easier to just put the iso file of GParted in the / system and use the loopback method from Grub2. I've done that with Parted Magic and it should be fairly easy to do with GParted, don't know for sure as I haven't tried.

    Do you have a directory named live-hd with the kernel in it on the partition (sda6). I'm not really sure what your intentions are.
    I want to learn how to do it so I can put other bootable distros like debian, memtest, rescue etc. Yes I have the directory live-hd in sda6 but it keeps telling me that it doesn't exist :/

    where do i have to store the images for gparted. Does it have to be in the same partition as grub??

  4. #4
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    How are you trying to boot GParted?
    Do you set your external drive to first boot priority in the BIOS to boot Grub2?

    1. I made a fat32 partition (200MB) and stored the gparted files in it.
    If you want Debian and other systems on it your are obviously going to have to make the partition larger or create other partitions.

    3. I found out that the partition is sdb6 (using fdisk)
    Your menuentry for GParted in grub.cfg shows set root=(hd0, msdos6) and your kernel line shows bootfrom=/dev/hda6 so you could try chaning that to (hd1, msdos6) and /dev/hdb6.

    where do i have to store the images for gparted. Does it have to be in the same partition as grub??
    No, but your grub.cfg entry has to be pointed to where it is. Try the above change to see if it works. If not, post back.

  5. #5
    Just Joined!
    Join Date
    Jun 2011
    Posts
    5
    It boots into grub2 menu with the menu items (they just don't work right now).

    1. I know that but i have 30gb reserved in extended drive for other stuff

    2. I tried that but no luck. If my grub2 is in the external hdd isn't the external hdd disk "hd0". Here is some more info:

    Grub2 command line: ls
    (hd0, msdos5) (hd0, msdos6) (hd0, msdos2)

    fdisk -l (sorry for bad formatting. it trims the spaces for some reason :/)
    Device Boot Start End Blocks Id System
    /dev/sdb1 1 6528 52428800 5 Extended
    /dev/sdb2 6528 60802 435956736 7 HPFS/NTFS
    /dev/sdb5 * 1 26 204800 83 Linux
    /dev/sdb6 26 52 204800 b W95 FAT32

    I removed bootfrom parameter totally to see if that actually finds the drive. It keeps saying: Disk not found. Now i know for sure that its a grub2 error not gparted...

    Do you guys have any other suggestions that i can try? I am going to use boot_info_script for the first time and post the result. Maybe that will help.

    Thanks,
    Gasim

  6. #6
    Just Joined!
    Join Date
    Jun 2011
    Posts
    5
    Here is the boot_info_script results.
    Attached Files Attached Files

  7. #7
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    The bootinfo script output shows you have Ubuntu and Grub2 installed on your 160GB drive and also Grub2 installed on the 500GB drive. So you are having these problems when you set the 500GB drive to first boot priority and try to boot??

    2. I tried that but no luck. If my grub2 is in the external hdd isn't the external hdd disk "hd0". Here is some more info:
    I'm not sure what your tried? (hd1,6)?? No the external disk would not necessarily be hd0, in fact it usually is not.
    Looks like you copied the grub.cfg file from sda1??
    I would suggest you change the linux line in your grub.cfg file, the bootfrom=/dev/hda6 to /dev/sdb6 and if that doesn't work /dev/sda6.
    I've not tried this with GParted but that's the only thing I see right off.

  8. #8
    Just Joined!
    Join Date
    Jun 2011
    Posts
    5
    The bootinfo script output shows you have Ubuntu and Grub2 installed on your 160GB drive and also Grub2 installed on the 500GB drive. So you are having these problems when you set the 500GB drive to first boot priority and try to boot??
    Yes. 500GB is my external hdd where my second grub is.

    I'm not sure what your tried? (hd1,6)?? No the external disk would not necessarily be hd0, in fact it usually is not.
    Yes i tried with (hd1, 6). The thing is, as i typed above the "ls" command from grub2 command line shows the partitions as (hd0, msdosX).

    Looks like you copied the grub.cfg file from sda1??
    Basically yes. I used (i am using grub 1.99)
    Code:
    grub-install --boot-directory=/media/boot/ --no-floppy /dev/sdb
    I would suggest you change the linux line in your grub.cfg file, the bootfrom=/dev/hda6 to /dev/sdb6 and if that doesn't work /dev/sda6.
    but that thing is not the error. Error is even if I remove bootfrom parameter it doesn't show because it keeps saying "disk not found"... Is there any other small live cds that i can try to check if I can set up grub??

  9. #9
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    The bootfrom line is pointing to a specific partition on a specific drive. Your Ubuntu doesn't use hdb it uses sdb and if it doesn't find it, it would give the error you mention.

    I downloaded GParted yesterday, copied the iso file to the root of the Ubuntu partition, put an entry for GParted in the grub.cfg file and it booted. Might be easier to do that.

    I was looking over your bootinfo script and noticed that your linux line entry in grub.cfg is different from the entry in the GParted syslinux.cfg file. Where did you get this entry:

    linux /live-hd/vmlinuz boot=live config union=aufs noswap noprompt vga=788 ip=frommedia live-media-path=/live-hd bootfrom=/dev/hdb6 toram=filesystem.squashfs
    Did you copy that from the web site you were using? You would be better off copying the entry from GParted syslinux.cfg file for your specific version, the one you have downloaded. These entries change regularly.
    Last edited by yancek; 06-25-2011 at 11:14 PM. Reason: Add info

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •