ventoy to disk revisited (https://github.com/ventoy/Ventoy)
manual installation of Ventoy in BIOS mode. This mode remains perfectly functional on a UEFI machine, which is not necessarily the case with UEFI mode on a BIOS machine.
boot.img
(Ventoy)core.img.xz
(Ventoy)VTOYEFI.part.img.xz
bash
with root accessdd
exfat-utils
(Debian)fdisk
grep
(installation script)umount
util-linux
(Debian)xz-utils
(Debian)
the image of the partition
VTOYEFI.part.img.xz
is derived from that ofventoy.disk.img.xz
.
TARGET=/dev/todo
umount $TARGET*
BLOCKS=$( blockdev --getsz $TARGET )
fdisk $TARGET <<~~~~~
o
n
p
1
2048
$(( BLOCKS - 65537 ))
t
7
n
p
2
$(( BLOCKS - 65536 ))
$(( BLOCKS - 1 ))
t
2
ef
a
1
w
~~~~~
dd if=boot.img of=$TARGET bs=1 count=446
xzcat core.img.xz | dd of=$TARGET count=2047 seek=1
xzcat VTOYEFI.part.img.xz | dd of=$TARGET count=65536 seek=$(( BLOCKS - 65536 ))
this step is optional.
dd if=/dev/urandom of=$TARGET seek=384 bs=1 count=16
dd if=/dev/urandom of=$TARGET seek=440 bs=1 count=4
depending on the device, the first partition may not named
p1
but simply1
(for example/dev/sde1
with/dev/sde
).
lsblk $TARGET
# adapt the next command with the results of the previous command (see note above)
mkfs.exfat -n Ventoy ${TARGET}p1