Ventoy news


  • 2024/01/24 --- 1.0.97 release
  1. Add support for FreeBSD 14.0. (#2636)
  2. Fix Proxmox 8.1 boot issue. (#2657)
  3. Fix VTOY_LINUX_REMOUNT option does not work with latest linux kernel version. (#2661 #2674)
  4. Fix the VentoyPlugson issue that default_file value is wrong for more than 10 theme files. (#2608)
  5. vtoyboot-1.0.31 release. Notes
  6. Wana boot and install OS through network (PXE)? Welcome to my new project, iVentoy https://www.iventoy.com
 
It's good to know that so many people are aware of Ventoy, so maybe someone will be able to help me create a Ventoy installation which can be run from FreeBSD... I've managed to get quite close but can't figure how to create the 1MB section at the start of the device, the green bit in this diagram:-

1706255650903.png
 
Some time ago I started this Thread 90697 about porting Ventoy to FreeBSD, or rather creating a script to build a Ventoy installation.

I'd be interested in getting some guidance in installing the bootloader...
 
A problem I have with creating the first partition using gpart add is what values to use for -b (start) and/or -a (alignment).

How to calculate them?
 
I'm not sure you actually have to "create" that first 1MB partition. Read what it contains:
Protect MBR, GPT table plus a gap

That is pretty much the standard when you use FreeBSD installer and partition a device with "protective MBR"

So I think you simply do the following using da0 for example:
# clear any existing partitioning
gpart destroy -F da0
# create a GPT scheme
gpart create -s GPT da0
#add 32GB partition, aligned to 1M which adjusts start and end to 1M boundaries
gpart add -i 1 -t <whatever type you need> -a 1M -s 32G -l <my label if needed> da0
# add 32MB efi partition aligned to 1M
gpart add -i 2 -t efi -a 1M -s 32M -l <labelifneeded> da0
 
Don't think you need to "align" that partition, just make sure it starts at block 2048 (-b 2048). That will start the partition on the 1MB mark.
 
I'm almost there but can't get one line of code to work, AFAICT.... (famous last words ;) )

Here's what I've come up with:-

Code:
echo 'hello'
DISK=da0
SRC=https://github.com/ventoy/Ventoy/releases/download/v1.0.97/
#SRC=file:////net/repo/software/iso/
WRKDIR=/var/tmp/VT-wrk
mkdir -p $WRKDIR
cd $WRKDIR
#fetch -o - ${SRC}ventoy-1.0.97-linux.tar.gz | tar zxf - -C $WRKDIR
cd $WRKDIR/ventoy-1.0.97
#ls -al
MBR=boot/boot.img
BOOTLDR=boot/core.img.xz
VTPART=ventoy/ventoy.disk.img.xz
ISO=/net/repo/software/iso/mfsbsd-mini-11.2-RELEASE-amd64.iso
gpart destroy -F $DISK
gpart create -s GPT $DISK
DISK=/dev/$DISK
gpart bootcode -b $MBR $DISK
# dd        status=progress if=$MBR of=$DISK bs=1 count=446
#dd status=progress conv=fsync if=$MBR of=$DISK bs=1b count=446

#******************************************************************************
xzcat $BOOTLDR | dd status=progress conv=fsync of=$DISK bs=512 count=2047 seek=1
#******************************************************************************

set -- $(gpart add -t linux-data -s 15G -b 1M -l Ventoy $DISK)
PART=$1
gpart show $DISK
echo $PART
mkfs.ext4 /dev/$PART
#mount -t ext2fs /dev/$PART /media
#cp $ISO /media
#umount /media/
set -- $(gpart add -t ms-basic-data -s 32M -l VTOYEFI $DISK)
PART=$1
newfs_msdos /dev/$PART
xzcat $VTPART | dd status=none of=/dev/$PART bs=512
gpart show $DISK

The marked line is what I believe should fill the start of the disk between the MBR and the start of the first partiton.

This is the output when running the script above:-

Code:
hello
da0 destroyed
da0 created
bootcode written to da0
  672768 bytes (673 kB, 657 KiB) transferred 1.002s, 672 kB/s^M
2047+0 records in
2047+0 records out
1048064 bytes transferred in 1.611572 secs (650337 bytes/sec)
gpart: table 'da0' is corrupt: Operation not permitted
=>       40  249644896  da0  GPT  (119G) [CORRUPT]
         40  249644896       - free -  (119G)


mke2fs 1.47.0 (5-Feb-2023)
mkfs.ext4: Device size reported to be zero.  Invalid partition specified, or
        partition table wasn't reread after running fdisk, due to
        a modified partition being busy and in use.  You may need to reboot
        to re-read your partition table.

gpart: table 'da0' is corrupt: Operation not permitted
newfs_msdos: /dev/: Is a directory
dd: /dev/: Is a directory
=>       40  249644896  da0  GPT  (119G) [CORRUPT]
         40  249644896       - free -  (119G)

Without that line the partitions get created properly.
 
Back
Top