Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Add Parted Magic to grub2 menu

  1. #1
    Join Date
    Nov 2012
    Beans
    29

    Add Parted Magic to grub2 menu

    Hi, I have an iso of parted magic called (pmagic_2013_02_28.iso). All I would like to do is add this iso to the boot menu in grub2 and be able to boot to it so I dont have to boot from the usb drive because for some reason my bios takes ages to boot from usb.



    I have added this to my 40_custom file as per https://help.ubuntu.com/community/Grub2/ISOBoot

    menuentry "Parted Magic ISO" {

    set isofile="/home/ade/pmagic_2013_02_28.iso"

    loopback loop (hd0,1)$isofile

    linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject

    initrd (loop)/casper/initrd.lz

    }

    When i come to update grub I get this error

    /etc/grub.d/40_custom: 1: /etc/grub.d/40_custom: menuentry: not found
    /etc/grub.d/40_custom: 5: /etc/grub.d/40_custom: Syntax error: "(" unexpected

    The iso is stored in my home folder on sda1

    Could anyone help please?
    Last edited by Bladeforce; April 19th, 2013 at 11:52 PM.

  2. #2
    Join Date
    May 2010
    Location
    uk
    Beans
    9,249
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Add Parted Magic to grub2 menu

    Hi

    I just downloaded partedmagic and added my own custom entry to 40_custom and ran update-grub.

    It added the custom menu items with no problems.
    Code:
    menuentry "Parted Magic ISO" {
    
    set isofile="/home/matthew/pmagic_2013_02_28.iso"
    
    loopback loop (hd0,1)$isofile
    
    linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject
    
    initrd (loop)/casper/initrd.lz
    
    }
    I have not rebooted to test as i am currently building a kernel.

    You are 100% Parted magic is in your home directory, of the correct size and is not corrupt ?

    If you remove the entry from 40_custom and run update grub again, does it update successfully. That will eliminate something else.

    Kind regards
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  3. #3
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Add Parted Magic to grub2 menu

    Parted Magic is not in the same file locations as Ubuntu installs and at least with the version I boot, I have different parameters.

    Code:
    menuentry "Parted Magic (Boot ISO Image via Grub2) " {
        insmod part_gpt
        set isofile="/iso/pmagic_2012_05_30.iso"
        loopback loop (hd2,4)$isofile
        linux (loop)/pmagic/bzImage iso_filename=$isofile edd=off load_ramdisk=1 prompt_ramdisk=0 rw vga=normal loglevel=9 max_loop=256 vmalloc=256MiB
        initrd (loop)/pmagic/initrd.img
    }
    My iso folder is on another drive in the 4th partition (hd2,4) and drive is gpt partitioned so I have to have that insmod.

    I also now create a text file for all my ISO grub boot entries like above and just have one small entry in grub2's 40_custom that never changes. Then I can edit text file (livecdimage.cfg) and not rerun the update-grub. I like this because just about every time I would edit file and forget to update.

    # livecdimage.cfg
    # Add this to 40_custom to load this file:
    # menuentry 'Live ISOs' {
    # configfile (hd2,4)/iso/livecdimage.cfg
    #}
    Last edited by oldfred; April 19th, 2013 at 04:07 PM.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  4. #4
    Join Date
    May 2010
    Location
    uk
    Beans
    9,249
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Add Parted Magic to grub2 menu

    Hi

    That's good to know about the file structure of partedmagic, oldfred.

    I would normally mount it and take a look myself if it does not work after a reboot.

    You saved me some time.

    Kind regards
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  5. #5
    Join Date
    Nov 2012
    Beans
    29

    Re: Add Parted Magic to grub2 menu

    Thanks for the help Yes when I have no entry in my 40_custom the update-grub runs fine

    I added matt_symes grub to my 40_custom and this is what happens when grub updates. My iso is fine and the md5 checks out with the md5 on the partedmagic page in my home directory

    menuentry "Parted Magic ISO" {
    set isofile="/home/ade/pmagic_2013_02_28.iso"
    loopback loop (hd0,1)$isofile
    linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject
    initrd (loop)/casper/initrd.lz
    }

    Generating grub.cfg ...
    using custom appearance settings
    Found background image: /home/ade/Pictures/Slick-Ubuntu.png
    Found linux image: /boot/vmlinuz-3.2.0-40-generic
    Found initrd image: /boot/initrd.img-3.2.0-40-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows 7 (loader) on /dev/sdb1
    Found Mac OS X on /dev/sdb2
    /etc/grub.d/40_custom: 1: /etc/grub.d/40_custom: menuentry: not found
    /etc/grub.d/40_custom: 3: /etc/grub.d/40_custom: Syntax error: "(" unexpected


    I also have tried oldfreds attempt deleting the insmod line as it's not on a gpt drive and substituted to hd0,1 and created a folder called "iso" and put the image into that folder

    menuentry "Parted Magic (Boot ISO Image via Grub2) " {
    set isofile="/iso/pmagic_2012_02_28.iso"
    loopback loop (hd0,1)$isofile
    linux (loop)/pmagic/bzImage iso_filename=$isofile edd=off load_ramdisk=1 prompt_ramdisk=0 rw vga=normal loglevel=9 max_loop=256 vmalloc=256MiB
    initrd (loop)/pmagic/initrd.img
    }

    I get the same error unfortunately

    Generating grub.cfg ...
    using custom appearance settings
    Found background image: /home/ade/Pictures/Slick-Ubuntu.png
    Found linux image: /boot/vmlinuz-3.2.0-40-generic
    Found initrd image: /boot/initrd.img-3.2.0-40-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows 7 (loader) on /dev/sdb1
    Found Mac OS X on /dev/sdb2
    /etc/grub.d/40_custom: 1: /etc/grub.d/40_custom: menuentry: not found
    /etc/grub.d/40_custom: 3: /etc/grub.d/40_custom: Syntax error: "(" unexpected

    May I ask is it possible that my bios has my drives in a different order to how ubuntu sees them after booting? Scratching my hair out here
    Last edited by Bladeforce; April 19th, 2013 at 09:02 PM.

  6. #6
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Add Parted Magic to grub2 menu

    The first is giving an error about a missing (.
    Post your entire 40_custom.
    I had a typo my my 40_custom for years (since almost the start of grub2). And with 12.04, it then gave an error. I was missing a boot stanza before but it was for a very old install I did not notice was missing. So now os_prober is more particular about formatting.

    cat /etc/grub.d/40_custom
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  7. #7
    Join Date
    Nov 2012
    Beans
    29

    Re: Add Parted Magic to grub2 menu

    Thanks this is the contents of my 40_custom

    menuentry "Parted Magic ISO" {
    set isofile="/home/ade/pmagic_2013_02_28.iso"
    loopback loop (hd0,1)$isofile
    linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject
    initrd (loop)/casper/initrd.lz
    }

  8. #8
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Add Parted Magic to grub2 menu

    This is part of mine. Did you delete the lines it says not to delete?

    Code:
    fred@fred-Precise:~$ cat /etc/grub.d/40_custom 
    #!/bin/sh
    exec tail -n +3 $0
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    
    menuentry " " {
    set root= 
    }
    
    menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
        insmod ntfs
        insmod part_msdos
        set root=(hd0,1)
        search --no-floppy --fs-uuid --set 04b05b70b05b6768
        drivemap -s (hd0) ${root}
        chainloader +1
    }
    
    menuentry " " {
    set root= 
    }
    
    menuentry 'Live ISOs' {
    configfile (hd2,4)/iso/livecdimage.cfg
    } 
    
    menuentry " " {
    set root= 
    }
    
    menuentry 'Ubuntu 12.10, (on /dev/sdd4 from hd0' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        set gfxpayload=$linux_gfx_mode
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root=(hd0,gpt4)
        linux /vmlinuz root=/dev/sdd4 ro quiet splash vt.handoff=7
        initrd /initrd
    }
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  9. #9
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Add Parted Magic to grub2 menu

    I am posting from Parted Magic 2013 version.

    I had to add nomodeset like I do with Ubuntu as it turned monitor off.
    And it did have a minor setting change. The syslinux had 384 for vmalloc.
    LiveCD also has efi and grub to boot efi.

    menuentry "Parted Magic 2013 (Boot ISO Image via Grub2) " {
    insmod part_gpt
    set isofile="/iso/pmagic_2013_02_28.iso"
    loopback loop (hd2,4)$isofile
    linux (loop)/pmagic/bzImage iso_filename=$isofile edd=off load_ramdisk=1 prompt_ramdisk=0 rw vga=normal loglevel=9 max_loop=256 vmalloc=384MiB nomodeset
    initrd (loop)/pmagic/initrd.img
    }
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  10. #10
    Join Date
    Nov 2012
    Beans
    29

    Re: Add Parted Magic to grub2 menu

    OldFred, you sir are a bloody genius. Somewhere in the past I must have got hasty and deleted this line from the top

    #!/bin/sh
    exec tail -n +3 $0
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.


    I have added this line so it now looks like :-

    #!/bin/sh
    exec tail -n +3 $0
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.

    menuentry "Parted Magic ISO" {
    set isofile="/home/ade/pmagic_2013_02_28.iso"
    loopback loop (hd0,1)$isofile
    linux (loop)/pmagic/bzImage iso_filename=$isofile edd=off load_ramdisk=1 prompt_ramdisk=0 rw vga=normal loglevel=9 max_loop=256 vmalloc=384MiB
    initrd (loop)/pmagic/initrd.img
    }


    Works great now!! I didnt need the nomodeset as it runs fine without it

    MANY, MANY thanks!!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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