Ventoy Forums
How to find the flash drive in GRUB for a cat command? - Printable Version

+- Ventoy Forums (https://forums.ventoy.net)
+-- Forum: Ventoy General Use —— Ventoy 使用交流 (https://forums.ventoy.net/forumdisplay.php?fid=1)
+--- Forum: Ventoy Discussion Forum (https://forums.ventoy.net/forumdisplay.php?fid=2)
+--- Thread: How to find the flash drive in GRUB for a cat command? (/showthread.php?tid=2054)



How to find the flash drive in GRUB for a cat command? - grizzogor - 04-29-2022

Hi, I'm using Ventoy for a new recovery disk at my workplace's IT department.
On the extra GRUB menu (/ventoy/ventoy_grub.cfg), I have a menu item that runs a cat command to display what software versions are used on the disk. Currently the menu item entry is programmed like this: (some parts I've pulled from Ventoy's other partition under Linux, like vtInputKey)
Code:
menuentry 'Read VERSIONS.txt' --class=F5tool {
    cat (hd0,gpt1)/VERSIONS.txt
        echo -e "\nPress ENTER to exit..."
        read vtInputKey
}
This works on a majority of machines I've tested, a Microsoft Surface Pro 6, a VMware VM, and an HP envy laptop of unknown model. But on some machines, GRUB can't find the file listed. I theorize that the exFAT partition is mounted at a different path depending on the computer's configuration. 

Is there a way to figure out where the exFAT partition is mounted, so that the cat command would work every time?
Thanks.


RE: How to find the flash drive in GRUB for a cat command? - longpanda - 04-30-2022

It has been noted in the document: https://www.ventoy.net/en/plugin_grubmenu.html  (Special Build-in Variable)
You can just use vtoy_iso_part variable as follows:

Code:
menuentry 'Read VERSIONS.txt' --class=F5tool {
    cat $vtoy_iso_part/VERSIONS.txt
        echo -e "\nPress ENTER to exit..."
        read vtInputKey
}



RE: How to find the flash drive in GRUB for a cat command? - grizzogor - 06-21-2022

(04-30-2022, 12:18 AM)longpanda Wrote: It has been noted in the document: https://www.ventoy.net/en/plugin_grubmenu.html  (Special Build-in Variable)
You can just use vtoy_iso_part variable as follows:

Code:
menuentry 'Read VERSIONS.txt' --class=F5tool {
    cat $vtoy_iso_part/VERSIONS.txt
        echo -e "\nPress ENTER to exit..."
        read vtInputKey
}

Sorry for the late reply, I had forgotten about this. Thanks, this solution works perfectly Big Grin .