LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 09-26-2022, 04:35 PM   #16
sofasurfer
Member
 
Registered: Oct 2003
Posts: 252

Original Poster
Rep: Reputation: 20

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.
 
Old 09-27-2022, 06:02 AM   #17
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,551

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Quote:
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.


Quote:
menuentry "Debian 11.4" {
loopback loop (hd0,gpt3)/debian-live-11.4.0-amd64-cinnamon.iso
linux (loop)/live/vmlinuz-5.10.0-16-amd64 isofrom=/dev/disk/by-uuid/45f8d0f7-05c4-4012-89c1-e088f0852071/debian-live-11.4.0-amd64-cinnamon.iso boot=live components quiet splash --
initrd (loop)/live/initrd.img-5.10.0-16-amd64
}
 
Old 09-27-2022, 07:01 PM   #18
sofasurfer
Member
 
Registered: Oct 2003
Posts: 252

Original Poster
Rep: Reputation: 20
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?
 
Old 09-27-2022, 07:58 PM   #19
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,372

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
It will work either way the majority of the time. https://www.gnu.org/software/grub/ma...ce-syntax.html
 
Old 09-27-2022, 08:09 PM   #20
sofasurfer
Member
 
Registered: Oct 2003
Posts: 252

Original Poster
Rep: Reputation: 20
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.
 
Old 09-27-2022, 09:15 PM   #21
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,372

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
Quote:
I have MBR not GPT.
(hd0,5) will work on both gpt and msdos drives,(hd0,msdos5) will work on a mbr disk not gpt, (hd0,gpt5) will work on gpt disk, not msdos type disk.

Last edited by colorpurple21859; 09-27-2022 at 09:18 PM.
 
Old 09-29-2022, 11:39 PM   #22
sofasurfer
Member
 
Registered: Oct 2003
Posts: 252

Original Poster
Rep: Reputation: 20
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
Code:
loopback loop (hd0,5)/Downloads/debian-live-11.5.0-amd64-cinnamon.iso
and linux(loop)
Code:
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
and each way I got "no such file" error.
 
Old 09-30-2022, 12:47 PM   #23
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,372

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
If the iso is in your download folder and you don't have a separate home partition it will be similar to this:
Code:
loopback loop (hd0,5)/home/<user name>/Downloads/debian-live-11.5.0-amd64-cinnamon.iso
if it is a separate parition remove the /home
 
Old 10-03-2022, 11:16 PM   #24
sofasurfer
Member
 
Registered: Oct 2003
Posts: 252

Original Poster
Rep: Reputation: 20
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.
 
Old 10-04-2022, 12:10 PM   #25
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by sofasurfer View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
Extract ISO to HD, create ISO from Extractions, Boot ISO LemensTS Linux - Software 1 12-28-2010 01:10 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
Does anyone Know how to open either .iso.rz or these .iso.xdelta,.iso.bz2,.iso.lzma?? maximalred Debian 5 06-09-2004 06:15 AM
GRUB GRUB GRUB GRUB "Whats Going on?" Gaweph Linux - Newbie 6 03-26-2004 10:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration