Ventoy as universal bootloader for KL

Moderator: Forum moderators

Post Reply
User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Ventoy as universal bootloader for KL

Post by wiak »

How to prepare a more useful Ventoy usb stick for use with most KL distros
(an arrangement which may also prove useful for other forum distros)

(ADDED NOTE: you can also use Ventoy installed to hard disk as the main computer system bootloader per this related post: viewtopic.php?p=109858#p109858 )

  1. Download the latest ventoy-XXX-linux.tar.gz from https://www.ventoy.net/en/download.html
    and extract it.

  2. From terminal opened as root user at extracted ventoy do the following:

Make Ventoy disk with 4096MB space (or whatever you want) preserved at the bottom of the disk for session saving space (persistence), that we will Linux format in a moment.

CAUTION!!! This command will delete all data on the selected drive in the process of writing Ventoy to it!!!
USE AT YOUR OWN RISK

Code: Select all

./Ventoy2Disk.sh -I -r 4096 /dev/sdX  # where X is usb stick drive letter
  1. Use gparted to make the unallocated preserved space a new Linux formatted ext4 partition with LABEL "Persistence"
    (I tried using parted commandline to do this, but couldn't find a way to refer to that unallocated space; if anyone knows how, please post to this thread).

  2. Finally, from terminal commandline turn off ext4 journal to lengthen life of usb stick:

Code: Select all

tune2fs -O ^has_journal /dev/sdX3  # where X is usb stick drive letter and 3 is the newly made (by gparted step above) third partition
  1. In the default exFAT Ventory first partition you should create a folder named BOOTISOS and store your KL distro isos there prior to booting via this Ventoy usb stick.

The advantages of this arrangement are:

a. Since the first partition of the usb stick is exFAT formatted it can also be read and written to by MS windows operating system.
b. KL distros generally provide a Ventoy grub menu that allows saving to a "Sessions" folder if any partition labelled "Persistence" that is Linux formatted (such as in the above arrangement) is found. The "Sessions" folder gets auto-created when needed.
c. It may be that other forum distros can arrange to have persistence working in same "Persistence" area.

The disadvantages are:

i. Only one partition should be given LABEL "Persistence" since needs to be unique.
ii. usb sticks may not be the best place to store session saves since may be slow and they are also not designed for heavy write operations.
An often better alternative to labelling that third partition above as "Persistence" would instead be to create a similarly made Linux formatted partition labelled "Persistence" on some other system drive, such as internal hard-drive/SSD for speed.

iii. Only KL distros that include exfat Linux kernel driver support will boot, and at this time only a few do (though more will likely follow).

If you don't require MS windows to be able to access sdX1 partition,
you can instead of the above simply reformat that first "Ventoy" partition as Linux formatted.

For example:

Code: Select all

mkfs.ext4 -O ^has_journal -L Ventoy /dev/sdX1

or use gparted GUI per earlier, and again create a folder /BOOTISOS there for you isos.

NOTES: Above methods work well to boot the at least the following KL distros including persistence support into Linux formatted partition having unique LABEL "Persistence" anywhere on system (e.g. 3rd partition of Ventoy stick described above):

KLV-Swayland iso from: viewtopic.php?p=101796#p101796
KLA-XFCEpodman iso from: viewtopic.php?p=86462#p86462
The smaller KLA-XFCEbase might too (EDIT: tested now, yes, works fine): viewtopic.php?p=81126#p81126
and KLU-jamXFCEbase (EDIT: tested now, yes, works fine): viewtopic.php?p=79399#p79399

I'll write an associate howto soon to show how to alternatively install this as a normal frugal installation on that same Ventoy stick, but for now, somewhat unsummarised details for doing that can be found here: viewtopic.php?p=100455#p100455

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

Clarity
Posts: 3829
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1628 times
Been thanked: 522 times

Re: Make Ventoy stick for KL

Post by Clarity »

wiak wrote: Mon Oct 23, 2023 8:24 am

.... I'll write an associate howto soon to show how to alternatively install this as a normal frugal installation on that same Ventoy stick ...

I was thinking to open a request in the programming area for help in building a utility that would do what this statement suggests. This forum has 4 excellent members on this forum who have the qualities to create the simple idea I have, into a "simple screen" for user use with clear understanding.

I have a BARD generated sample to start but I feel any of the 4 members on the forum who could make a simple "windowed/screened" version of this idea where the user would merely check the boxes for fashioning the setup of Partition #1 to match the way things are done here, across the forum, for ISO file management consistent with all forum distros boot needs.

From my current tests finding and use over the past 4 years of use of the 3 primary ISO file boot launchers, used in this forum, I think a simple flash screen added to the end of the Ventoy setup script would be helpful for all types of forum users; namely old, new, linux experienced, windows experienced, unix experienced and/or MAC experienced.

The 3 desires the script/json additions would provide is filesystem desire beyond default, creation of BOOTISOS folder, and addition of SG2D (15MB) file as a default fallback. ISObooter utilities could be added if desired as well as a default fallback for booting any enclosed ISO file. Lastly, an checkbox option could be to add a Ventoy folder containing this Ventoy script should if ever be needed by any boot ISOs that are used; as the script could be accessed from the running distro. I have been doing similarly, manually, for past years.

Finally, I have a method perfected few years back where my Ventoy folder, used to launch Ventoy, can be used/run from all known OSes as the one folder has the combined Ventoy utilities in one place for all OSes. I am willing to share how I combined the Ventoy stuff together to allow the folder to be used no matter what OS is run. Rather simple as my folder can be used to build/update a Ventoy USB no matter which OS is used by the user.

None of what is done is being done to change traditional methods. Everything I, personally, have been involved is how to use methods to make it simple for boot AND operations of a distro that reduces repeated effort and eliminates repeated errors seen made over the past years. Thus the ISO file launchers certainly have proven the ability to do just that. Everyone, thusly, benefits; namely developers, supporters, testers, and users when these issues are reduce to zero(0). Productivity across the board.

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: Make Ventoy stick for KL

Post by wiak »

Ventoy as a hard disk boot loader...

A lot of people on this forum seem to use the likes of FrugalPup or grub2conf and so on to set up their empty hard drive to allow their computer system to boot. Not a lot of people probably realise you can actually install Ventoy to the empty hard drive instead, which has the advantage you can boot from isos without any effort usually. But Ventoy also provides a simple plugin facility that allows booting from normal frugal installs (in own sub-directories) too, just like we are all used to (I briefly explain here: viewtopic.php?p=110016#p110016). So this quick post documents how I used Ventoy as my hard disk boot loader (Ventoy using grub2 as part of its operation):

In another KL thread I recently posted how I had just resurrected two old emachine netbooks and booted one of them via a Ventoy usb stick to KLU-jamXFCEbase: viewtopic.php?p=109841#p109841

I also put an old 750GB SATA hard drive in that netbook, but not formatted or any boot files on it. So I thought to myself, what will I use as a boot loader rather than the usb Ventoy stick. Well... I thought... why not simply make the internal hard drive a Ventoy boot device and especially since Ventoy allows for a simple 'plugin' that makes normal frugal installed distros easy to boot (not just isos or images). So simply using the steps I documented in first post of this thread, I downloaded the ventoy tar.gz, extracted it into a folder, and ran its command:

Code: Select all

sudo ./Ventoy2Disk.sh -I -r 524288 /dev/sda  # where sda is my 750GB SATA internal hard drive in the netbook

that -r 524288 creates a 512MiB partition at sda3 that I thereafter used gparted to format as Linux ext4, which I gave label "Persistence" (for use with Ventoy isos for saving Sessions) and also for any normal frugal installs I want to boot. Being on the hard disk that save folder reading/writing is of course fast and much faster than it would be if sessions being saved to a usb stick, and SATA hard disk is fine with ext4 journaling left on.

The remainder of the 750GB hard drive has sda1 as a 186GiB exfat partition, auto-labelled as "Ventoy" (auto-made by that ventoy installation) and a sda2 32MiB partition labelled VTOYEFI (will boot on old MBR bios machines or EFI machines). So just like you'd expect for similar ventoy installed to a usb stick instead.

Then in that Ventoy partition I made a folder called "BOOTISOS" and copied my KLU-jamXFCEbase iso into there.

So, no usb stick required now... soon as I boot the machine, Ventoy menu comes up and for now just booting the included KLU-jamXFCEbase iso (via Ventoy grub2 boot method) and I'm using RAM2 mode to Persistence partition (the Sessions folder and so on, including upper_changes save folder gets created automatically when I then use KLU-jamXFCEbase). And of course I can quickly just download isos into sda1 BOOTISOS folder and test boot whatever I feel like thereafter (assuming the distro works via Ventoy, which my KL distros all do and including with save persistence modes).

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: Ventoy as universal bootloader for KL

Post by wiak »

We normally use Ventoy simply for booting isos that we often (though optional) store on Ventoy data partition inside a directory named /BOOTISOS.
However, there is a mechanism provided by Ventoy to boot normal distro installs, be that full installed or frugal installed distros. That is done via a simple text file 'plugin' stored and used as follows:

  1. In the Ventoy data partition create an empty folder exactly called /ventoy and in there create a single text file called ventoy_grub.cfg. That is the plugin Ventoy makes provision for this exact ability to boot any install be those frugal, full, isos that otherwise don't boot, or whatever.

  2. In that ventoy_grub.cfg text file simple put all the grub2 menu stanzas you want to include; one after the other.

  3. Reboot into Ventoy. When normal Ventoy menu appears... press key F6 and the normal Ventoy menu will immediately be replaced by the menu provided in your ventoy_grub.cfg plug file.

FOR EXAMPLE:

If I have a frugal install of KLV_sway_pipewire stored at directory /KLV_sway_pipewire on a partition that has UUID 7d34b88e-bc8e-4bb6-86cf-d619c3b545a9, the following menu stanza included in ventory_grub.cfg will allow it to be booted:

Code: Select all

menuentry "KLV_sway_pipewire" {
  insmod ext2
  search --no-floppy --fs-uuid --set 7d34b88e-bc8e-4bb6-86cf-d619c3b545a9
  linux /KLV_sway_pipewire/vmlinuz w_bootfrom=UUID=7d34b88e-bc8e-4bb6-86cf-d619c3b545a9=/KLV_sway_pipewire w_changes=RAM2
  initrd /KLV_sway_pipewire/initrd.gz
}

Suitable menu stanzas could also be included for booting the likes of Puppy Linux or a full installation of, say, Linux Mint. Instead of using UUID method, partition LABEL menu stanzas could of course be used. Regarding Puppy, for example, something like:

Code: Select all

menuentry "Puppy " {
    search --no-floppy --file --set /puppy/vmlinuz
    linux /puppy/vmlinuz psubdir=/puppy pfix=fsck,fsckp
    initrd /puppy/initrd.gz
}

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

Clarity
Posts: 3829
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1628 times
Been thanked: 522 times

Re: Ventoy as universal bootloader for KL

Post by Clarity »

wiak wrote: Wed Jan 24, 2024 10:53 pm

... there is a mechanism provided by Ventoy to boot normal distro installs, be that full installed or frugal installed distros. ...

Wow!

I had been guiding students and others to use SG2D for booting already installed distros/OSes. But this is a better way as it uses GRUB2 to make plain the locations of those distros with their launch points versus the cryptic listings in SG2D's discoveries. SG2D does a GREAT job but its is not as familiar to users with its manner of listing run-able installed OSes present on the PC.

LOVE this finding, you share.

Thanks @wiak. I will test and provide feedback.

Additional Notes to users

  1. This additional info is something everyone should know: SG2D has a "Key" advantage that Ventoy does not have. That advantage is that SG2D will search 'every' partition looking for a "BOOTISOS" folder and will list ALL ISOs on every partition SG2D find them in those folder(s). And, in terms of launching ISO files, it works as well without issues for all forum distro ISO files.

  2. This additional info is something everyone should know: Ventoy has a "Key" advantage that SG2D does not have. That advantage is that Ventoy:

    • Is faster listing of ISO files to screen for user review and launch

    • Supports distro image files (IMG) as well as bootable ISO files. This is important to @BarryK's distros as they have been tested and perfoms admirably.

Last edited by Clarity on Tue Jan 30, 2024 7:53 am, edited 2 times in total.
Clarity
Posts: 3829
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1628 times
Been thanked: 522 times

Re: Ventoy as universal bootloader for KL

Post by Clarity »

WARNING

Prerequisites

  • You use a Ventoy/SG2D/combined boot system disk/USB combined

  • The Ventoy unit ALSO has save-sessions on same disk/USB

  • The location where ISO files are on the Ventoy/SG2D disk/USB ALSO contains a SAVESPEC file

  • A VM server is installed in your running distro and used by you
    In the VM you boot the Ventoy/SG2D disk/USB to launch ISO files

YOU are in danger of a potential for data destruction, at worst; session save failure attempts, at best; when booting distros in the VM.

Scenario
You are running a distro and you open a VM server; say QEMU. You direct QEMU to boot the device listed above and you launch one of the ISOs the above unit list. It will boot fine and you distro will operate file. But, when an attempt is made to shut your running distro down where you expect to save your session-work, this will fail and all of your session work will be lost.

Reason
The booted Ventoy/SG2D unit is NOT a VM formatted or managed unit. Even though it is referenced and some things can be done, this remains that the VM is NOT using a VM device; rather he is using an emulation that is crippled. Thus a sessions partition that was NOT created by the VM will not be used fully as the VM will limit some efforts of accessing a unit it did not create.

When in a VM, your sessions MUST be saved to a VM created unit. A VM will NOT write your distro's session to a non-VM device.

How would you KNOW if your session in on a non-VM understood device?
QEMU will tell you if you are using a non-VM device. The following message when the VM is started tell you so.

Code: Select all

# qemu-system-x86_64 -name "WoofCEs v240125 64bit by Peebee via SG2D USB in QEMU" -enable-kvm -m 2G -smp 2 -device AC97 -net nic -net user -rtc base=localtime  /dev/sdb
WARNING: Image format was not specified for '/dev/sdb' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

The /dev/sdb unit contains ISO files as well as the location to save sessions.

AT this moment in time when operating a VM, you will need to keep your Sessions on a non-raw VM unit.

I am researching for some way to be able to define the Ventoy/SG2D Sessions partition location that is used run the non-VM system(s) to be able to define a unit that can be used both natively on its system and also specified properly for the VM to also use that session partition.

Only VM users
This WARNING ONLY APPLIES to people who try to use their Ventoy/SG2D unit, combined, with sessions on it, both natively as well as using the unit as a boot device in a VM. If you are NOT using your non-VM sessions unit in a VM, this warning does not apply to you.

REPEATING: This only applies to VM users who intend to save sessions on a non-VM device. If you are a native user, this does NOT apply to you.

Post Reply

Return to “How-To”