Jump to content











Photo
- - - - -

Helping Linux Kernel to boot from *this* partition


  • Please log in to reply
15 replies to this topic

#1 xpt

xpt

    Frequent Member

  • Advanced user
  • 138 posts
  •  
    Canada

Posted 06 August 2019 - 12:00 AM

I've always been specifying the UUID for the Linux Kernel to boot from the correct partition, like this:

 

title Boot LUbuntu 18.04 Bionic
        find --set-root /disk-LUbuntu-18.04
        kernel /vmlinuz root=UUID=ad26a5d8-a4ee-42d3-96aa-1f6f0eaa3968 ro net.ifnames=0 --
        initrd /initrd.img

However, today, it suddenly occurs to me -- is it possible for Grub4dos to help the Linux Kernel with its `root=` parameter?  Grub4dos has already known where the root is, it is just a matter of passing it to the Linux Kernel. 

 

 

Is it possible? As not using the UUID saves me from having to find & change UUID each time I'm working with a new Linux partition. 

 

Thx!

 

 



#2 Guest_AnonVendetta_*

Guest_AnonVendetta_*
  • Guests

Posted 06 August 2019 - 03:00 AM

I was never able to get G4D to boot any installed Linux, without specifying the root and UUID in menu.lst. Without those, booting Linux via G4D always failed. I got the idea to add them after checking grub.cfg for each of my distros. You can even boot the Linux kernel directly while bypassing GRUB2, but the correct parameters have to be specified to the kernel or it will not find its' root. If other additional need to be specified, like for GPU/LVM/dm-crypt/LUKS/etc, those need to be specified too.

 

I have oftentimes found that Arch Linux is particularly a pain in the ass to boot via G4D, especially after updating my GPU driver or the kernel. I have to manually edit menu.lst again and again. If no updates are installed, it boots fine with the current menu.lst.

 

if you have more than one kernel in /boot (I keep a known good older one alongside a new one as a failsafe), then you will need to specify which kernel in menu.lst.



#3 Guest_AnonVendetta_*

Guest_AnonVendetta_*
  • Guests

Posted 06 August 2019 - 06:06 AM

Instead of booting Linux directly via G4D, maybe you can instead install GRUB2 into core.img (instead of the MBR), then use G4D to chainload that img. This way GRUB2 automatically sends the (hopefully correct) parameters to the kernel as a middleman. Every time GRUB2 updates itself it will only touch core.img. You wont have to fiddle around with editing menu.lst as much. Theoretically it should work but I've never tried it.



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 August 2019 - 08:35 AM

If your distro *needs* UUID to boot, it *needs* it.

 

But you can calculate it on-the-fly.

 

Now, what would the command "uuid" do?

 

try:

 

set mydistro=disk-LUbuntu-18.04

find --set-root /%mydistro%

uuid ()

set myuuid=%?%

echo Here is the uuid of the volume where %mydistro% is : %myuuid%

pause

 

or (one liner)

 

set mydistro=disk-LUbuntu-18.04

find --set-root /%mydistro%

uuid () && call set myuuid=%^?%

echo Here is the uuid of the volume where %mydistro% is : %myuuid%

pause

 

But see also here:

http://reboot.pro/to...ts-in-grub4dos/

 

and here:

http://reboot.pro/to...rom-vhd-how-to/

 

(only seemingly unrelated)

 

:duff:

Wonko



#5 xpt

xpt

    Frequent Member

  • Advanced user
  • 138 posts
  •  
    Canada

Posted 06 August 2019 - 12:41 PM

Thanks Wonko. The first link should work as well. I'll give it a try. 

 

Question: where can I find more on the gr4 batch jobs? thx



#6 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 06 August 2019 - 12:48 PM

There is some info on my rmprepusb.com website.

https://www.rmprepus...orials/grub4dos

https://www.rmprepus...commands-primer

and many other pages!

Maybe http://www.easy2Boot.commay be worth looking at too?



#7 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 August 2019 - 01:33 PM

Question: where can I find more on the gr4 batch jobs? thx

Generally speaking, the grub4dos batch language is exactly (exception made when it isn't ;)) identical to Windows NT batch.

Most of what you would normally do in batch is the same, with a few exceptions (like the output of a command being directly pipable to a variable), the difficult part is to learn about the "special" grub4dos internal functions and variables, for which pretty much the only source (in the west) are the Steve6375*s pages on RMPREPUSB.COM Steve referenced above.

But they won' t help you much for learning the base batch syntax, for that you need to be already familiar (or learn) the "normal" .cmd syntax, and then read/analyze existing grub4dos batch examples.

Besides the ones "here and there", you'd better head (via google translate) to chenall's blog:
http://chenall.net/tags/batch/

if you go to
http://chenall.net/
and search in it for "batch" or for a common command like "echo" you should find more results.


:duff:
Wonko

#8 xpt

xpt

    Frequent Member

  • Advanced user
  • 138 posts
  •  
    Canada

Posted 09 August 2019 - 04:03 PM

Thank you all for the links/info

 

Maybe http://www.easy2Boot.com may be worth looking at too?

 

@Steve, is it you who creates the easy2Boot? Is it possible to create a .iso release instead, so that it works for both Windows & Linux? Else, can we have an .iso for the Linux release alone please? That manual preparation steps for Linux really deterred me from even trying. Furthermore, my current situation is that I installed a Linux to my new VM but it is not booting, and was hoping that easy2Boot might be able to help me boot it. I.e., I don't have a Linux system to boot into (at my office), to prepare easy2Boot to boot Linux. 

 

Thanks



#9 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 09 August 2019 - 05:35 PM

Easy2boot is only for usb drives.
I was suggesting that you looked at the batch files to get an idea of the batch language.

#10 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 09 August 2019 - 07:55 PM

@xpt

I am not sure to understand the problem you are having, which actually appears as a "moving target". :unsure:

 

I particularly don't understand the reference to needing a Linux machine to create an USB stick with Easy2boot, last time I tried it  it worked on Windows just fine.

 

Your original problem was calculating a UUID as opposed to manually change it (which assumes that with the manually changed one you can already boot).

 

About the Easy2boot problem:

 

1) prepare a USB Easy2boot stick

2) boot the VM from the USB stick (if the VM allows that)

 

Or is the problem that you installed (how exactly) Linux (which distro exactly) to your new VM (which VM exactly) and it doesn't boot?

 

If you post some meaningful details it is likely that we can help you with this latter problem but right now you are in the "I'm ill, doctor, Help!" stage :w00t::

https://jdebp.eu/FGA...ard-litany.html

 

:duff:

Wonko



#11 xpt

xpt

    Frequent Member

  • Advanced user
  • 138 posts
  •  
    Canada

Posted 10 August 2019 - 12:48 PM

 

If you post some meaningful details it is likely that we can help you with this latter problem but right now you are in the "I'm ill, doctor, Help!" stage :w00t::

https://jdebp.eu/FGA...ard-litany.html

 

:duff:

Wonko

 

All I'm asking is if Easy2boot can have a ISO release. For the rest, I'll take care of them myself. 

 

Sorry to have reuse an old thread asking a new question. I don't know how to split it, and if it is possible, please split this question from the old thread. thx.



#12 xpt

xpt

    Frequent Member

  • Advanced user
  • 138 posts
  •  
    Canada

Posted 10 August 2019 - 12:55 PM

More on to how I installed my Linux though. I used the grml ISO, so that the brand new VM can boot off from it, with nothing on its own disks. and grml has install to disk (grml-bootstrap) functionality. 

 

The reason I explain this is that, although grml distributes its releases in ISO, it is very easy to put it on USB -- just copy the ISO content to USB, and it'll boot fine. This is the very reason I'm asking for an ISO release of Easy2boot. grml has the functionality that the same code can boot off from either ISO or USB without modification. 



#13 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 10 August 2019 - 01:18 PM

E2B is designed to be run from  a rd\wr USB drive with 512-bytes per sector and uses a standard BIOS and grub4dos.

I don't quite understand what you want to do with E2B?  It is a USB multiboot solution, it boots to a grub4dos menu system and requires rd\wr access to the USB drive. You can boot ISOs, VHDs, WIM files, .ima files etc. just by copying the files onto the USB drive.



#14 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 10 August 2019 - 02:32 PM

The reason I explain this is that, although grml distributes its releases in ISO, it is very easy to put it on USB -- just copy the ISO content to USB, and it'll boot fine. This is the very reason I'm asking for an ISO release of Easy2boot. grml has the functionality that the same code can boot off from either ISO or USB without modification. 

Well, that is a hybrid iso, nothing particularly "new".

 

You can make a syslinux based hybrid .iso *anytime*:

https://wiki.syslinu...title=Isohybrid

 

But also grub4dos based iso-hybrid are possible, though I don't think anyone detailed the process, particularly with newish releases/tools.

 

We do have some "variations" on the theme, *like*:

http://reboot.pro/to...-under-windows/

http://reboot.pro/to...os-isohybrided/

http://reboot.pro/to...-to-g4d-images/

 

 

Easy2boot is a nice "helper" to grub4dos functionalities, the base idea is to have a "basic" Easy2boot stick and being able to easily ADD *any* OS, distro or whatever crosses your mind in an "easy" way and it actually makes sense ONLY if you have a complex list of many OSes/distros in multiboot.

 

For simpler multi-boot (let's say three to eight "items") or for single boot, directly using grub4dos is fast and easy as well. 

 

Since you cannot ADD anything to a .iso (please don't cite existing .iso editors that in most cases are not actually "proper" editors) it makes little sense to have the  (unfortunately complex due to the "extended features" it has) Easy2Boot "overhead".

 

Your grml .iso is not a good example, because it ONLY boots grml and when deployed to a USB stick it continues to ONLY boot grml (and moreover overwrites *whatever* was on the stick before).

 

If you prefer, a hybrid  .iso is only useful if you don't have a CD/DVD available BUT you have a new (in the sense of empty) USB.

 

Easy2boot approach is useful if you don't have a CD/DVD available BUT you have some space on an Easy2boot stick, ADDING your new .iso  to it WHILE KEEPING all the other OS's you already have on the stick (and also keeping your visually appealing menu/splash/whatever other bells and whistles you decided to use in Easy2boot)

 

:duff:

Wonko



#15 xpt

xpt

    Frequent Member

  • Advanced user
  • 138 posts
  •  
    Canada

Posted 10 August 2019 - 03:17 PM

 

Since you cannot ADD anything to a .iso (please don't cite existing .iso editors that in most cases are not actually "proper" editors) it makes little sense to have the  (unfortunately complex due to the "extended features" it has) Easy2Boot "overhead".

 

Your grml .iso is not a good example, because it ONLY boots grml and when deployed to a USB stick it continues to ONLY boot grml (and moreover overwrites *whatever* was on the stick before).

 

 

Ah, now I understand what our differences were. Thanks.

 

BTW, my company blocks USB stick access to our machines so I can't use it. 



#16 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 10 August 2019 - 05:22 PM

BTW, my company blocks USB stick access to our machines so I can't use it. 

Yep, that is common enough provision but to be picky (as I am BTW) there can be TWO very different reasons ending up as "USB stick access blocked":

1) the company (meaning actually the company) has some (legitimate) worries about security and considers a USB stick to be a possible vector of infection (inbound) or a possible vector of data leaks (outbound)

2) the (lazy[1]) IT guy/gal in your company has been fed up with all the times he/she had to intervene to fix an infection/unbootable system/whatever other issue caused by the connection of "personal" USB sticks (or other devices) and has thus implemented the block (but has left access to CD/DVD and possibly even RW besides RO access :whistling:)

 

If it is case #2, besides extending my personal sympathy to you :), if I can do anything to help you harass him/her/them  by mis-using some .iso features, grub4dos and what not, just say so.  ;)

 

:duff:

Wonko

 

 

[1] by definition, see:

http://reboot.pro/to...nereg/?p=210147






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users