Ventoy Forums
Migration from MBR to GPT fails - 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: Migration from MBR to GPT fails (/showthread.php?tid=2438)



Migration from MBR to GPT fails - ralf - 04-12-2023

Hi,



on old hardware I made a Ventoy USB stick using MBR. This Vento USB stick worked.
The first partition was an ext4 partition holding

xubuntu-20.04.1-desktop-amd64.iso
xubuntu-20.04.1-desktop-pers1.dat
ventoy/ventoy.json

the content of ventoy/ventoy.json was


Code:
{
    "persistence": [
        {
            "image": "/xubuntu-20.04.1-desktop-amd64.iso",
            "backend": "/xubuntu-20.04.1-desktop-pers1.dat"
        }
    ]
}
There was a third partition formatted as fat32, holding data to share.

Now I try to make a Ventoy USB stick using GPT on new hardware. Actually it's the same USB stick.

I tried in 1001 way, never touched the second partition, but whatever I tried so far doesn't work. The closest to something working was done this way:
I used gparted to create the GPT and to create an 16380 MiB sized ext4 partition. Behind the ext4 partition were 13619 MiB left unallocated.
Then I run


Code:
ventoy -i -r 13554 -g -n /dev/sdf
Now I have got a first 16 GiB sized ext4 partition and a second 32 MiB fat16 partition and left are unallocated 13.27 GiB.
I copied


xubuntu-20.04.1-desktop-amd64.iso
xubuntu-20.04.1-desktop-pers1.dat
ventoy/ventoy.json


to the ext4 partition, the files that were used by the MBR USB stick. I have done nothing to the second partition. When I boot I get the Ventoy menu with the Ventoy wallpaper claiming that no ISOs are available.
Other attempts without the "-n" option were even more worse. I got a black screen, the output was something similar to "invalid Ventoy".


Code:
# pacman -Q ventoy-bin 
ventoy-bin 1.0.91-1
# ventoy -l /dev/sdf 

**********************************************
      Ventoy: 1.0.91  x86_64
      longpanda admin@ventoy.net
      https://www.ventoy.net
**********************************************

Ventoy Version in Disk: 1.0.91
Disk Partition Style  : GPT
Secure Boot Support   : YES
Regards,
Ralf


RE: Migration from MBR to GPT fails - longpanda - 04-13-2023

1. Try download the Ventoy package from official website or github (don't use the pacman version, it's not maintained by official).
2. run bash Ventoy2Disk.sh -i -r 13554 -g /dev/sdf
Then the 1st partition will be formated in exfat filesystem, now you copy your files to the partition and retry.
After that, manually reformat the exfat to ext4, re-copy your files and retry.


RE: Migration from MBR to GPT fails - ralf - 04-14-2023

Hi,

so here we go...


#### #### #### ####
$ wget -q https://github.com/ventoy/Ventoy/releases/download/v1.0.91/{ventoy-1.0.91-linux.tar.gz,sha256.txt}
$ grep linux sha256.txt
f6fb0574ec6c5b50acd3a8153ef42eb23bb6fb0a783e90706c7654ba0c1bddca  ventoy-1.0.91-linux.tar.gz
$ sha256sum ventoy-1.0.91-linux.tar.gz
f6fb0574ec6c5b50acd3a8153ef42eb23bb6fb0a783e90706c7654ba0c1bddca  ventoy-1.0.91-linux.tar.gz
$ tar xf ventoy-1.0.91-linux.tar.gz
$ cd ventoy-1.0.91/
$ su
Password:
# bash Ventoy2Disk.sh -i -r 13554 -g /dev/sdf

**********************************************
Ventoy: 1.0.91 x86_64
longpanda admin@ventoy.net
https://www.ventoy.net
**********************************************

grep: warning: stray \ before -
Disk : /dev/sdf
Model: Intenso Ultra Line (scsi)
Size : 29 GB
Style: GPT

You will reserve 13554 MB disk space

Attention:
You will install Ventoy to /dev/sdf.
All the data on the disk /dev/sdf will be lost!!!

Continue? (y/n) y

All the data on the disk /dev/sdf will be lost!!!
Double-check. Continue? (y/n) y

Create partitions on /dev/sdf by parted in GPT style ...
Done
Wait for partitions ...
partition exist OK
create efi fat fs /dev/sdf2 ...
mkfs.fat 4.2 (2021-01-31)
success
Wait for partitions ...
/dev/sdf1 exist OK
/dev/sdf2 exist OK
partition exist OK
Format partition 1 /dev/sdf1 ...
mkexfatfs 1.3.0
Creating... done.
Flushing... done.
File system created successfully.
mkexfatfs success
writing data to disk ...
sync data ...
esp partition processing ...

Install Ventoy to /dev/sdf successfully finished.

# lmount -w winos10; lmount -w Ventoy # lmount is a script to mount by label
# cp -Tai /mnt/winos10/share/ventoy_1.0.91-1_intenso_ultra_bak_2023-04-12-1-pre_migration_s3.archlinux_to_m1.archlinux/v1.ventoy/ /mnt/Ventoy/; echo $?
0
# /bin/ls -hAl /mnt/Ventoy/ # the path before ls to bypass an alias
total 9.9G
drwxr-xr-x 2 root root  32K Jan  6  2021 ventoy
-rwxr-xr-x 1 root root 1.6G Jul 31  2020 xubuntu-20.04.1-desktop-amd64.iso
-rwxr-xr-x 1 root root 8.3G Mar 14 11:19 xubuntu-20.04.1-desktop-pers1.dat
# cat /mnt/Ventoy/ventoy/ventoy.json
{
    "persistence": [
        {
            "image": "/xubuntu-20.04.1-desktop-amd64.iso",
            "backend": "/xubuntu-20.04.1-desktop-pers1.dat"
        }
    ]
}
#### #### #### ####


I restarted the Computer. Ventoy does the job. Next...


#### #### #### ####


$ sudo gparted

1. Format to ext4
2. Label File System "v1.ventoy"

$ su
Password:
# lmount -w winos10; lmount -w v1.ventoy # lmount is a script to mount by label
# cp -Tai /mnt/winos10/share/ventoy_1.0.91-1_intenso_ultra_bak_2023-04-12-1-pre_migration_s3.archlinux_to_m1.archlinux/v1.ventoy/ /mnt/Ventoy/; echo $?
0
# /bin/ls -hAl /mnt/Ventoy/ # the path before ls to bypass an alias
total 9.9G
drwxr-xr-x 2 root root 4.0K Jan  6  2021 ventoy
-rw-r--r-- 1 root root 1.6G Jul 31  2020 xubuntu-20.04.1-desktop-amd64.iso
-rw-r--r-- 1 root root 8.3G Mar 14 11:19 xubuntu-20.04.1-desktop-pers1.dat
# cat /mnt/Ventoy/ventoy/ventoy.json
{
    "persistence": [
        {
            "image": "/xubuntu-20.04.1-desktop-amd64.iso",
            "backend": "/xubuntu-20.04.1-desktop-pers1.dat"
        }
    ]
}
#### #### #### ####


Now it doesn't work anymore.

Before I tried to use GPT the same Ventoy USB stick used MBR with an ext4 partition and it worked on the same computer.

After migrating to GPT it works when formatted with exfat, but Ventoy returns "No ISO or supported IMG files found (Press enter to reboot ...)" when it's an ext4 partition.

It probably doesn't matter, if I use MBR instead of GPT or exfat instead of ext4. Ventoy does work, as long as I don't chose GPT and ext4 at the same time.

Regards,
Ralf


RE: Migration from MBR to GPT fails - longpanda - 04-14-2023

What about xfs ?


RE: Migration from MBR to GPT fails - ralf - 04-14-2023

Hi,

what's going on? I posted a long reply explaining that I made a mistake, but after correcting my mistake there still was an issue with Ventoy.
OTOH I explained also that I suspect issues with the new hardware. I suspect that Ventoy isn't the culprit. Apart from this xfs or even reformatting with exfat failed, too.
I don't want to explain everything again, however I made another test that shows something strange.

After the copy claimed to be finished I waited a long time, before I unmounted, this time without an issue, I experience issues with unmounting when doing the tests for the post that is missing now.


#### #### #### ####
[root@archlinux rocketmouse]# date; cp -Tai /mnt/winos10/share/ventoy_1.0.91-1_intenso_ultra_bak_2023-04-12-1-pre_migration_s3.archlinux_to_m1.archlinux/v1.ventoy/ /mnt/v1.ventoy/; echo $?; date
Fri 14 Apr 20:32:33 CEST 2023
0
Fri 14 Apr 20:38:28 CEST 2023
[root@archlinux rocketmouse]# date; umount /dev/sdf1; date
Fri 14 Apr 21:02:11 CEST 2023
Fri 14 Apr 21:02:12 CEST 2023
[root@archlinux rocketmouse]# mount /dev/sdf1 /mnt/v1.ventoy/
#### #### #### ####


A first diff needed around a minute, the second diff:


#### #### #### ####
[root@archlinux rocketmouse]# date; diff -r /mnt/winos10/share/ventoy_1.0.91-1_intenso_ultra_bak_2023-04-12-1-pre_migration_s3.archlinux_to_m1.archlinux/v1.ventoy/ /mnt/v1.ventoy/; echo $?; date
Fri 14 Apr 21:09:42 CEST 2023
0
Fri 14 Apr 21:09:45 CEST 2023
#### #### #### ####


3 Seconds to diff 10 GiB on an USB 2 stick connected to an USB 3 port. This looks like it does compare checksums stored in a cache and nothing else.

I rebooted, Ventoy didn't work, it again claimed missing or wrong files, back to Arch Linux the files are all there:


#### #### #### ####
[root@archlinux rocketmouse]# mkdir /usb_stick && mount --verbose /dev/sdf1 /usb_stick
mount: /dev/sdf1 mounted on /usb_stick.
[root@archlinux rocketmouse]# date; diff -r /mnt/winos10/share/ventoy_1.0.91-1_intenso_ultra_bak_2023-04-12-1-pre_migration_s3.archlinux_to_m1.archlinux/v1.ventoy/ /usb_stick/; echo $?; date
Fri 14 Apr 21:23:15 CEST 2023
0
Fri 14 Apr 21:24:26 CEST 2023
#### #### #### ####


To my taste around a minute is still a little bit too fast for a diff with an USB 2 stick involved. This was the first diff done after a reboot.
I will do tests using another computer as soon as possible.


#### #### #### ####
[root@archlinux rocketmouse]# /bin/ls -hAl /mnt/winos10/share/ventoy_1.0.91-1_intenso_ultra_bak_2023-04-12-1-pre_migration_s3.archlinux_to_m1.archlinux/v1.ventoy/ /usb_stick/
/mnt/winos10/share/ventoy_1.0.91-1_intenso_ultra_bak_2023-04-12-1-pre_migration_s3.archlinux_to_m1.archlinux/v1.ventoy/:
total 9.9G
drwxr-xr-x 2 root root 4.0K Jan  6  2021 ventoy
-rw-r--r-- 1 root root 1.6G Jul 31  2020 xubuntu-20.04.1-desktop-amd64.iso
-rw-r--r-- 1 root root 8.3G Mar 14 11:19 xubuntu-20.04.1-desktop-pers1.dat

/usb_stick/:
total 9.9G
drwxr-xr-x 2 root root 4.0K Jan  6  2021 ventoy
-rw-r--r-- 1 root root 1.6G Jul 31  2020 xubuntu-20.04.1-desktop-amd64.iso
-rw-r--r-- 1 root root 8.3G Mar 14 11:19 xubuntu-20.04.1-desktop-pers1.dat
[root@archlinux rocketmouse]# fdisk -l /dev/sdf
Disk /dev/sdf: 29.3 GiB, 31457280000 bytes, 61440000 sectors
Disk model: Ultra Line     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: AFCB198E-B8F8-4389-961E-2FC8DB31FF46

Device        Start      End  Sectors Size Type
/dev/sdf1      2048 33615831 33613784  16G Linux filesystem
/dev/sdf2  33615832 33681367    65536  32M Microsoft basic data
[root@archlinux rocketmouse]# parted -l | grep Intenso -A8
Model: Intenso Ultra Line (scsi)
Disk /dev/sdf: 31.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start  End    Size    File system  Name    Flags
1      1049kB  17.2GB  17.2GB  ext4        Ventoy
2      17.2GB  17.2GB  33.6MB  fat16        VTOYEFI  hidden, msftdata
#### #### #### ####


Regards,
Ralf


RE: Migration from MBR to GPT fails - longpanda - 04-15-2023

When you boot into Ventoy menu, press c to enter grub shell and run the following commds and take a photo about the result.
Code:
ls
ls -l
ls -l $(vtoy_dev,1)/