Announcement

Collapse
No announcement yet.

Boot ISO from harddisk

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Boot ISO from harddisk

    Hi!

    I got bored today and went looking. Found this:

    https://www.howtogeek.com/196933/how...ur-hard-drive/

    I downloaded 19.04 daily to here:
    /Data/Downloads/Linux/
    resp.
    /dev/sda3/Downloads/Linux

    This should have the grub notation: (hd0,3) (It has been a while).

    Now the above site tells me to edit grub.d/40_custom (mine is actually...40_custom_proxy) so:
    menuentry “Ubuntu 14.04 ISO” {
    set isofile=”/home/name/Downloads/ubuntu-14.04.1-desktop-amd64.iso
    loopback loop (hd0,1)$isofile
    linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile} quiet splash
    initrd (loop)/casper/initrd.lz
    }
    I tried accomodating my situation:
    menuentry “Kubuntu 19.04_ISO” {
    set isofile=”/Data/Downloads/Linux/disco-desktop-amd64.iso"
    loopback loop (hd0,1)$isofile (What goes here)
    linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile} quiet splash
    initrd (loop)/casper/initrd.lz
    }

    Can anyone help out with his?

    Cheers
    F
    HP Pavilion dv6 core i7 (Main)
    4 GB Ram
    Kubuntu 18.10

    #2
    Yep, I can. Been doing this for a while. Here's a stanza from mine:

    Code:
    [FONT=monospace][COLOR=#000000]menuentry 'Kbuntu 18.04 ISO' --class iso {[/COLOR]
        set isofile="/@grub/kubuntu-18.04-desktop-amd64.iso"
        loopback loop (hd0,3)$isofile
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
        initrd (loop)/casper/initrd.lz
    }[/FONT]
    I basically download the newest ISO, rename it to "kubuntu-18.04-desktop-amd64.iso" and save it to my grub folder. This works well with any *buntu ISO I've tried.

    Note i'm not using EFI so that's one difference.
    Last edited by oshunluvr; Feb 17, 2019, 08:10 AM.

    Please Read Me

    Comment


      #3
      Thanks for the reply. Which "grub" folder are you talking about here? I have one here: /boot/grub? What is that in Grub speak?

      I am not aware that I had installed using EFI. Where do you see that? I have a generic Kubuntu 18.10 install.

      So, I could use:

      menuentry 'Kbuntu 19.04 ISO' --class iso {
      set isofile="/@grub/kubuntu-19.04-desktop-amd64.iso"
      loopback loop (hd0,?)$isofile
      linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
      initrd (loop)/casper/initrd.lz
      }


      Thank you for any further feedback.
      Last edited by Snowhog; Feb 17, 2019, 10:55 AM.
      HP Pavilion dv6 core i7 (Main)
      4 GB Ram
      Kubuntu 18.10

      Comment


        #4
        No no no, sorry. The "@grub" part is my grub folder. You need to use whatever folder your grub is in or where ever you have your ISO stored. I have a dedicated GRUB install on a BTRFS file system so MY grub is in a subvolume named "@grub".

        I don't think it matters where the ISO is as long as it's accessible by grub.

        Please Read Me

        Comment


          #5
          Right. So, I am back to this:

          I tried accomodating my situation:
          menuentry “Kubuntu 19.04_ISO” {
          set isofile=”/Data/Downloads/Linux/disco-desktop-amd64.iso"
          loopback loop (hd0,1)$isofile (What goes here)
          linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile} quiet splash
          initrd (loop)/casper/initrd.lz
          }

          And what goes here
          loopback loop (hd0,1)$isofile
          considering where my ISO file is:
          /Data/Downloads/Linux/
          resp.
          /dev/sda3/Downloads/Linux
          HP Pavilion dv6 core i7 (Main)
          4 GB Ram
          Kubuntu 18.10

          Comment


            #6
            Not sure why you think something needs to go there?

            "$isofile" is a variable filed in by "set isofile=..."

            Please Read Me

            Comment


              #7
              Originally posted by Fintan View Post
              /dev/sda3/Downloads/Linux

              This should have the grub notation: (hd0,3) (It has been a while).
              Such a translation is dubious. How grub and linux enumerate drives can vary, and vary from boot to boot too.

              The first thing I would do is press c while on the grub menu, to get a grub prompt. Then type "ls" to see what devices grub sees. Say it sees hd0,1
              Then type
              ls (hd0,1)
              to see what really is there. You can try the various commands out, and maybe find what's going wrong.

              Now, when I boot a cosmic iso, the initrd command reads

              initrd (loop)/casper/initrd

              yours has a ".lz" on the end. I have a vague memory that that changed in Ubuntu isos since 14.04. You can open the iso in Kubuntu with ark, and look in the casper folder; my cosmic iso has a plain "initrd".

              I use a grub loop that looks for .iso files in my downloads directory and generates menuentries for whatever is there. Using a bootable USB stick, preferably a fast one, with such a generated menu is the way to go in future I think; there's a few projects that do that, I must check one out some time.
              Regards, John Little

              Comment


                #8
                Hmmm...

                Here is my boot screen-> c -> ls =
                (hd0) (hd0,msdos8) (hd0,msdos7) (hd0,msdos6) (hd0,msdos5) (hd0,msdos4) (hd0,msdos3), etc...

                Not sure I like this msdps stuff, but hey...

                Anyway ls (hd0,msdos3) gives my Data partition, which is where my download folder is.

                Now I did this to my 40_custom_proxy:

                #!/bin/sh
                #THIS IS A GRUB PROXY SCRIPT
                '/etc/grub.d/proxifiedScripts/custom' | /etc/grub.d/bin/grubcfg_proxy "-*
                -#text
                +'Kubuntu'~515db425b7561c0741785584d223c275~
                "

                menuentry “Kubuntu 19.04_ISO” {
                set isofile=”/Data/Downloads/Linux/disco-desktop-amd64.iso"
                loopback loop (hd0,msdos3)$isofile
                linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${isofile} quiet splash
                initrd (loop)/casper/initrd
                }

                grub-update gives:

                fintan@fintan-HP-Pavilion-dv6-Notebook-PC:~$ sudo update-grub
                [sudo] password for fintan:
                Generating grub configuration file ...
                Found linux image: /boot/vmlinuz-4.18.0-13-generic
                Found initrd image: /boot/initrd.img-4.18.0-13-generic
                Found linux image: /boot/vmlinuz-4.18.0-12-generic
                Found initrd image: /boot/initrd.img-4.18.0-12-generic
                /etc/grub.d/40_custom_proxy: 8: /etc/grub.d/40_custom_proxy: menuentry: not found
                /etc/grub.d/40_custom_proxy: 14: /etc/grub.d/40_custom_proxy: Syntax error: Unterminated quoted string

                Something is obviously wrong here with the syntax.

                Any ideas?
                HP Pavilion dv6 core i7 (Main)
                4 GB Ram
                Kubuntu 18.10

                Comment


                  #9
                  Originally posted by Fintan View Post
                  #THIS IS A GRUB PROXY SCRIPT
                  I've never used "grub customizer", and it's gobbledygook to me at this stage. Something is going wrong with it. I suggest not using it for now. A way to achieve this would be delete everything before the "menuentry" line, and replace it with
                  Code:
                  #!/bin/sh
                  exec tail -n +3 $0
                  That's the way the non grub-customizer, default debian 40_custom file works. It just causes the following text to be copied into grub.cfg. Any script that outputs the codes you want would do.

                  (IMO it's much simpler to use a manually maintained grub.cfg. It need only be 20 lines or so, rather than the default convoluted scripts that call other scripts that generate scripts that call other scripts, which break screwing up booting.)
                  Regards, John Little

                  Comment


                    #10
                    Ok. Thanks for the grub customizer heads up.

                    Got rid of that, did an upgrade now I have this in 40-custom, with my changes:

                    #!/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 "Kubuntu" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-3710e270-6ac8-4d24-b042-9aae3f37ab82' {
                    recordfail
                    load_video
                    gfxmode $linux_gfx_mode
                    insmod gzio
                    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                    insmod part_msdos
                    insmod ext2
                    set root='hd0,msdos1'
                    if [ x$feature_platform_search_hint = xy ]; then
                    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3710e270-6ac8-4d24-b042-9aae3f37ab82
                    else
                    search --no-floppy --fs-uuid --set=root 3710e270-6ac8-4d24-b042-9aae3f37ab82
                    fi
                    linux /boot/vmlinuz-4.18.0-13-generic root=UUID=3710e270-6ac8-4d24-b042-9aae3f37ab82 ro quiet splash $vt_handoff
                    initrd /boot/initrd.img-4.18.0-13-generic
                    }

                    menuentry “Kubuntu 19.04_ISO” {
                    set isofile=”/Data/Downloads/Linux/disco-desktop-amd64.iso"
                    loopback loop (hd0,msdos3)$isofile
                    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${isofile} quiet splash
                    initrd (loop)/casper/initrd
                    }

                    grub-update:
                    fintan@fintan-HP-Pavilion-dv6-Notebook-PC:~$ sudo update-grub
                    [sudo] password for fintan:
                    Sourcing file `/etc/default/grub'
                    Generating grub configuration file ...
                    Found linux image: /boot/vmlinuz-4.18.0-15-generic
                    Found initrd image: /boot/initrd.img-4.18.0-15-generic
                    Found linux image: /boot/vmlinuz-4.18.0-13-generic
                    Found initrd image: /boot/initrd.img-4.18.0-13-generic
                    Found linux image: /boot/vmlinuz-4.18.0-12-generic
                    Found initrd image: /boot/initrd.img-4.18.0-12-generic
                    Found memtest86+ image: /boot/memtest86+.elf
                    Found memtest86+ image: /boot/memtest86+.bin
                    Found Ubuntu 18.04.1 LTS (18.04) on /dev/sda7
                    error: out of memory.
                    error: syntax error.
                    error: Incorrect command.
                    error: syntax error.
                    Syntax error at line 443
                    Syntax errors are detected in generated GRUB config file.
                    Ensure that there are no errors in /etc/default/grub
                    and /etc/grub.d/* files or please file a bug report with
                    /boot/grub/grub.cfg.new file attached.
                    fintan@fintan-HP-Pavilion-dv6-Notebook-PC:~$
                    HP Pavilion dv6 core i7 (Main)
                    4 GB Ram
                    Kubuntu 18.10

                    Comment


                      #11
                      Ok, looks like I am getting closer.

                      Edited 40_custom with this:
                      menuentry 'Disco' {
                      set isofile= '/Data/Downloads/Linux/disco-desktop-amd64.iso'
                      loopback loop (hd0,msdos3)$isofile
                      linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${isofile} quiet splash
                      initrd (loop)/casper/initrd
                      }

                      grup-update comes back without errors.

                      Grub boor "sees" Disco.

                      But when I click on Disco I get:
                      Error: invalid file name ` '
                      Error: disk 'loop' not found
                      Error: you need to boot kernel first

                      Not sure what all that means...
                      HP Pavilion dv6 core i7 (Main)
                      4 GB Ram
                      Kubuntu 18.10

                      Comment


                        #12
                        It means it's not finding the ISO. Either the drive reference in the loopback comment is wrong or the path/filename to the iso is wrong.

                        The first obvious thing I see is you used single quotes around the filename where I (and the grub documentation) uses double quotes.

                        I've never had to use the "msdos" part to specify my partition, but I'm using GPT tables so that makes sense.

                        Please Read Me

                        Comment


                          #13
                          BTW, where is this "Data" directory. It's not a mount is it?

                          Please Read Me

                          Comment


                            #14
                            Hmmm...went back to grub boot-> c -> ls-> ls(hd0,msdos3) and that shows: Partition (hd0,msdos3)_ file system type ext* - label `Data' - last modified...

                            now, /Data/Downloads/Linux/disco-desktop-amd64.iso is the path to my .iso.

                            When I type that path into a terminal I get
                            permission denied
                            Permissions on the ISO show me. What now? Do I make it executable?
                            HP Pavilion dv6 core i7 (Main)
                            4 GB Ram
                            Kubuntu 18.10

                            Comment


                              #15
                              /Data is a partition. Mounted

                              sda 931.5G
                              ├─sda1 / 24.2G 3710e270-6ac8-4d24-b042-9aae3f37ab82
                              ├─sda2 /home 27.2G 171802f7-58ce-42ae-a46b-f2838af70a77
                              ├─sda3 /Data Data 380.2G 870450d7-d898-441c-9f0f-2084807b6fd2
                              ├─sda4 1K
                              ├─sda5 /Media Media 246G cc363feb-3783-4195-8d90-faee31f64e98
                              ├─sda6 [SWAP] 4.6G 5626e36a-e819-46ea-839f-7e8043f66954
                              ├─sda7 24.4G fca79d3d-bcc6-4a13-8677-09ee0ac39b6f
                              └─sda8 /Media2 Media2 225G 405c7e1d-95e7-4745-98f7-49b46339456d
                              sr0 1024M
                              fintan@fintan-HP-Pavilion-dv6-Notebook-PC:~$
                              Last edited by Fintan; Feb 18, 2019, 07:13 AM. Reason: ammendment
                              HP Pavilion dv6 core i7 (Main)
                              4 GB Ram
                              Kubuntu 18.10

                              Comment

                              Working...
                              X