Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I haven't worked on my "booting hard drive iso from grub" project in a while.
I still have not accomplished the task. Before I continue I need to get a couple questions answered. I have been using the following web site...
Code:
https://help.ubuntu.com/community/Grub2/ISOBoot
1) Does the iso need to be mounted in order for this to work? The wiki says it needs to. I am storing the iso in /Downloads. If I mount the /Downloads/xxxxx.iso by using right-click mounting tool the iso is mounted to /media/user/Downloads/xxxxx.iso.
2) Do I or do I not need to run $ sudo update-grub? The wiki says I do. The people on the forum say I SHOULD NOT. Since the grub menu takes its orders from /boot/grub/grub.cfg it seems that update-grub would be absolutely nessessary.
I suspect that part of my problem is that I am using a wrong path in linux loop line of script. I will work on that after I get a full unerstanding of the two questions above.
Sorry for turning this thread into a book. I looks like this is very easy for you guys and so I am thinking I am missing something very simple.
Last edited by sofasurfer; 09-26-2022 at 05:20 PM.
Does the iso need to be mounted in order for this to work?
No, the link you posted does not tell you to have the iso mounted. The reason given on the page you linked to is to loop mount the iso so you get the correct path for the kernel and initrd files and the exact correct name for each. Sometimes the kernel will include the version number, sometimes the initrd will have an extension. initrd.gz, initrd.lz. These file names need to be exactly correct as does the path.
Quote:
Do I or do I not need to run $ sudo update-grub?
In your case, since you are putting the menuentry in /etc/grub.d/40_custom you do need to update grub. I generally put the entries in the /boot/grub/grub.cfg file and it will show without running update-grub and will show in the grub menu until update-grub is run. If you had the iso entry in grub.cfg and updated grub, it will no longer show in the grub menu.
In the entry you posted above, remove "/dev/sda5" from the loopback loop line.
On the linux (loop) line change "isofrom=/dev/sda5/by-uuid" to "isofrom=/dev/disk/by-uuid" (without quotes) and the correct UUID.
You also have incorrect vmlinuz and initrd.img file names. Not sure where you got that from? I'll post my menuentry below for the same Debian version which does boot so make sure to make the changes above, get the correct drive/partition (he0,5) and the correct UUID for that partition as well as the vmlinuz and initrd files.
I have learned that the proper grub drive syntax is (hdx,y). Now with this grub menu project I am seeing that the syntax is (hdx,gpty). Why is it different?
I just learned that GPT ab MBR are the partitioning schemes. I have MBR not GPT. As you stated it should work either way (unles you say different). So I will go study now. Be back when I'm done.
Thanks.
SUCCESS! I got it working. I think my problems were...
1) I needed to use (hd0,5) instead of (hd0,gpt5).
2) Wrong path. The script I was using was meant to the iso being stored in root (/) but I was storing in /Downloads.
3) I was using the wrong initrd and vmlinux filenames.
Here is my script...
Code:
#!/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 "Debian 11.5" {
loopback loop (hd0,5)/debian-live-11.5.0-amd64-cinnamon.iso
linux (loop)/live/vmlinuz-5.10.0-18-amd64 isofrom=/dev/disk/by-uuid/eb1498be-3ba8-473a-a597-8f9f34d0ba48/debian-live-11.5.0-amd64-cinnamon.iso boot=live components quiet splash --
initrd (loop)/live/initrd.img-5.10.0-18-amd64
}
Which line do I edit to use my iso in a different directory. I tried editing loopback
linux (loop)/live/vmlinuz-5.10.0-18-amd64 isofrom=/dev/disk/by-uuid/eb1498be-3ba8-473a-a597-8f9f34d0ba48/Downloads/debian-live-11.5.0-amd64-cinnamon.iso
I'm doing fine, now, with booting iso from grub. However, I find that when trying to use the Ubuntu 22.04 iso the vmlinuz and initrd exist ONLY as vmlinuz and initrd. They do not have a version number (ie vmlinuz xx.xx.x). This does not work in the grub loader. How is this problem solved.
I'm doing fine, now, with booting iso from grub. However, I find that when trying to use the Ubuntu 22.04 iso the vmlinuz and initrd exist ONLY as vmlinuz and initrd. They do not have a version number (ie vmlinuz xx.xx.x). This does not work in the grub loader. How is this problem solved.
This does not make sense. "Doing fine now" and "This does not work" are contradictory terms.
The installation ISO has only one kernel version thus only a single vmlinuz and initrd, both of which work perfectly fine for booting that iso. The grub menu entry needs the exact file name in that ISO and thus does not need anything except what you see.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.