19 C
Jaipur
Wednesday, October 28, 2020

Create A Bootable USB Drive By Simply Copying The ISO To The USB With Ventoy (Linux And Windows)

Must read

Samsung Galaxy S21 May Ditch Bundled Earphones And Charger Like Apple

A few weeks ago, Apple made headlines after announcing that the iPhone 12 won’t ship with a charger or a pair of earphones. And now it...

China launches crackdown on mobile web browsers, decries ‘chaos’ of information – Latest News

China's top cyber authority said it would carry out a "rectification" of Chinese mobile internet browsers to address what it called social concerns over...

cellphone: Japan unveils plan to prod carriers to cut cellphone charges – Latest News

Japan on Tuesday laid out a plan for reducing consumers' cellphone charges, as the government stepped up its bid to promote competition in the...

Uniqlo: Japanese apparel retailer Uniqlo forays into Indian online market – Latest News

Japanese global apparel retailer UNIQLO on Tuesday said it has forayed into the Indian online market. The company has introduced 'Shop From Home' service...

Ventoy is a fairly new open source tool to create bootable USB drives using Linux or Microsoft Windows ISO files. You install this tool to a USB drive, then simply copy some ISO files to the USB drive and you can boot from it with no other changes (so without having to reformat the USB drive every time you want to create a bootable USB drive, and without having to extract the ISO file contents).

The application is available for Microsoft Windows and Linux. It has a graphical user interface on Windows only; on Linux you’ll need to use it from the command line.

When copying multiple ISO files to the USB drive, Ventoy provides a menu on boot from where you can choose which ISO to boot. You can even create a multiboot USB drive by adding ISO files for some Linux distributions and Windows ISO files on the same USB, as seen in the screenshot at the top of this page.

It’s worth noting that you can continue to use the USB stick for other purposes. Once Ventoy is installed on an USB drive, that USB drive can be used to boot ISO files that you copy to it, but you can also copy other files to it, and that won’t affect the operation of Ventoy.

To take advantage of the whole USB drive for other purposes, you don’t have to format it. Delete all ISO files from it and use it as a regular USB drive (Ventoy only takes a few MB of space and is not visible when mounting the USB drive). When you want to use this same USB drive to boot an ISO, all you have to do is copy the ISO file (or multiple ISOs) to the USB and boot from it.

Ventoy comes with both legacy and UEFI Secure Boot support, and it has been tested with more than 260 ISO files, including Debian, Ubuntu (and its flavors), CentOS, RHEL, Deepin, Fedora, SLES, openSUSE, MX Linux, Manjaro, Linux Mint, Elementary OS, Pop!_OS, Solus OS, Zorin OS, Arch Linux, Puppy Linux, Tails, Slax, Kali Linux, Mageia, Slackware, Gentoo, NixOS, ALT Linux, KDE Neon, and many other Linux distributions, as well as Windows 7, Windows 8 / 8.1, Windows 10, and Windows Server 2012 / 2012 RS, 2016 and 2019.

Other Ventoy features:

  • Persistence support for Ubuntu, MX Linux, Linux Mint, Elementary OS and Zorin OS
  • Auto installation – this should work with Windows and any Linux distribution that support automatic installation, but it has only been tested with RHEL7/CentOS7/Fedora, Debian/Ubuntu Server and SUSE
  • WIM files boot supported (Legacy + UEFI)
  • Supports ISO files larger than 4 GB
  • Upgrade the Ventoy installation on the USB drive without formatting the USB


Read on to see how to install Ventoy on an USB drive (from Microsoft Windows or Linux) and how to create a bootable USB drive with persistence using Ventoy.

Bootable USB drive-related:

Download and install Ventoy on an USB drive

The download button above links to Ventoy binaries for Microsoft Windows and Linux. If you wish to build it from source instead, see this page.

On Windows, Ventoy comes with a graphical user interface so using it is pretty straight-forward. To use it, extract the downloaded Ventoy .zip file, then launch the Ventoy2Disk executable.

Ventoy Windows GUI

Choose the USB drive from the Device list, optionally enable Secure Boot support (from the Option menu), then click the Install button to install Ventoy to the USB stick. Now that Ventoy is installed on your USB drive, you can create a bootable USB drive by simply copying some ISO files onto the USB, no matter if they are Linux distribution ISOs or Windows 10 / 8 / 7 ISO files.

On Linux, extract the Ventoy .tar.gz file and you’ll find 3 folders as well as 2 scripts, Ventoy2Disk.sh for installing Ventoy on an USB drive, and CreatePersistentImg.sh for creating a persistent image to use with Ventoy.

But before installing Ventoy on an USB drive and creating a bootable USB drive, you need to find out the device name of this USB drive, and unmount it if it’s mounted. Follow the steps below to do this, and then install Ventoy on an USB drive on Linux.

1. Find out the USB drive device name and available partitions

Plug-in the USB into your computer, then run the following command (you can also use lsblk or sudo fdisk -l instead; or use Gparted if you prefer a GUI) in a terminal:

sudo parted -l

This should output the disks and partitions attached to your computer, including the USB drive. You’ll need to figure out which one of the devices listed is your USB drive, based on the model name, disk size, etc.

Example with the parted -l command showing an USB drive attached to my computer:

sudo parted -l
..........................
Model:  USB DISK 3.0 Pro (scsi)
Disk /dev/sdd: 31.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  31.0GB  30.9GB  primary               boot
 2      31.0GB  31.0GB  33.6MB  primary  fat16        esp

In this example output you can find the USB device name by looking under Disk, so in my case, it’s /dev/sdd.

The partitions are listed below the Disk Flags, so in this example there are 2 partitions: 1 and 2 (since the device name is /dev/sdd, the partitions are /dev/sdd1 and /dev/sdd2).

2. Unmount any mounted USB drive partitions

In case the USB drive has mounted partitions, unmount them before proceeding (or else you won’t be able to install Ventoy on the USB, and this is required for creating a bootable USB drive) by opening a terminal and using this command:

sudo umount /dev/sdXN


Replace /dev/sdXN with the USB device partitions. Make sure to unmount all mounted disk partitions.

In my example, the USB drive device name is /dev/sdd, and its partitions are /dev/sdd1 and /dev/sdd2, so in that case the commands to unmount them would be:

sudo umount /dev/sdd1
sudo umount /dev/sdd2

3. Install Ventoy on the USB disk

It’s important to note that all the data on the disk where you install Ventoy will be lost! Make sure the USB device name is correct so you don’t accidentally lose the data from a hard drive.

To be able to create bootable USB drives by simply copying the ISO files onto the USB, you’ll need to install Ventoy on the USB drive. Open a terminal and navigate to the folder where you’ve extracted Ventoy (the folder which contains the Ventoy2Disk.sh script).

Then to install Ventoy on the USB disk without Secure Boot support, use:

sudo ./Ventoy2Disk.sh -i /dev/sdX

Or, to install Ventoy on the USB disk with Secure Boot support, use:

sudo ./Ventoy2Disk.sh -i -s /dev/sdX

In both of these commands you need to replace /dev/sdX with the USB device name that you found out in step 1.

You will be asked to confirm if USB device name is correct twice – type y and press the Enter key to continue.

Example:

sudo ./Ventoy2Disk.sh -i -s /dev/sdd

***********************************************************
*                Ventoy2Disk Script                       *
*             longpanda  [email protected]                 *
***********************************************************

Disk : /dev/sdd
Model: USB3.0 DISK (scsi)
Size : 31 GB

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

Continue? (y/n)y

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

Create partitions on /dev/sdd by parted ...
Done
mkfs on disk partitions ...
create efi fat fs /dev/sdd2 ...
mkfs.fat 4.1 (2017-01-24)
success
mkexfatfs 1.3.0
Creating... done.
Flushing... done.
File system created successfully.
writing data to disk ...
sync data ...
esp partition processing ...

Install Ventoy to /dev/sdd successfully finished.

Now that Ventoy is installed on your USB drive, you can create a bootable USB drive by simply copying some ISO files onto the USB, no matter if they are Linux distribution ISOs or Windows 10 / 8 / 7 ISO files. 

Boot from this USB drive and you’ll see a list of ISO files that are available on it – click any of them and you’ll boot the selected ISO file with the possibility of installing the Linux distribution or Windows version you’ve copied to the USB drive.

How to create a bootable USB drive with persistence using Ventoy

When you create a regular Linux live USB, you can install software, download files, make changes to the system, and so on, but all of these changes are lost after a reboot. A persistent live USB allows saving any changes you make to the live system, so they are still present the next time you boot to it.

Ventoy supports creating bootable USB drive with persistence support. Among the Linux distributions for which Ventoy supports persistence are Ubuntu, MX Linux, Linux Mint, Elementary OS and Zorin OS, although more probably work, but haven’t been tested. Generally, any Linux distribution based on Ubuntu should work.

The following instructions assume you’ve already downloaded, extracted and installed Ventoy on an USB device (see the instructions above). It’s worth noting that this requires the CreatePersistentImg.sh script, only available with the Ventoy Linux download (there’s no similar solution available with Ventoy for Windows).

1. Create a persistent image file

To create a persistent bootable USB drive, the first step is to create the backend image file. This is a simple disk image with a label. You can use the CreatePersistentImg.sh script, available in the folder where you’ve extracted Ventoy for Linux, to create this image file.

Open a terminal, navigate to the folder where you’ve extracted Ventoy (which should contain the CreatePersistentImg.sh script), and run this command to create an image file with the size of 4 GB:

sudo ./CreatePersistentImg.sh -s 4096

This creates a 4 GB EXT4 image file with a default label of casper-rw. 4096 represents the size of the image file in MB, if you want to increase or descrease the size, change this number.

You can see all the available options by running:

./CreatePersistentImg.sh --help

2. Copy the persistent image file to the USB drive

The created image file is called persistence.img, and it should be available in the Ventoy folder (next to the CreatePersistentImg.sh script). Plug-in the USB stick on which you’ve installed Ventoy, and copy this persistence.img file to the USB drive.

3. Create a Ventoy json configuration file containing the paths to the ISO and persistence files

On the USB drive on which you’ve installed Ventoy, create a folder called ventoy. Inside this folder create a file called ventoy.json, and open this file with a text editor.

Inside the file, paste this:

{
    "persistence" : [
        {
            "image": "/ISO-file-name.iso",
            "backend": "/persistence.img"
        }
    ]
}

Replace ISO-file-name.iso with the ISO filename (and path if it’s not in the root of the USB), and persistence.img with the persistence image filename and path (in case you’ve changed the name and didn’t place it in the root of the USB).

For example, if you have an ISO called ubuntu-20.04-desktop-amd64.iso and a persistence image file called persistence.img, both placed in the root of the USB drive (in the lowest-level directory, the one that opens when you click on the USB drive icon), the ventoy.json file would look like this:

{
    "persistence" : [
        {
            "image": "/ISO-file-name.iso",
            "backend": "/persistence.img"
        }
    ]
}

You can add multiple ISO files with persistence if you wish, for example:

{
    "persistence" : [
        {
            "image": "/ISO-file-name.iso",
            "backend": "/persistence-ubuntu-20.04.img"
        },    
        {
            "image": "/linuxmint-19.3-xfce-64bit.iso",
            "backend": "/persistence-linux-mint-19.3.img"
        }
    ]
}

Make sure the paths and syntax are 100% correct. If you miss (or have an extra) comma for example, or if the paths are not correct, the persistence won’t work.

For more on this, see the Ventoy persistence documentation.

Ventoy bootable usb drive persistence

When you’re done, save the file and boot from this USB drive. After clicking on the ISO for which you’ve added persistence, you’ll see a menu that lets you boot with or without persistence, like shown in the screenshot above.

h/t: conductor on HN

Source link

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Samsung Galaxy S21 May Ditch Bundled Earphones And Charger Like Apple

A few weeks ago, Apple made headlines after announcing that the iPhone 12 won’t ship with a charger or a pair of earphones. And now it...

China launches crackdown on mobile web browsers, decries ‘chaos’ of information – Latest News

China's top cyber authority said it would carry out a "rectification" of Chinese mobile internet browsers to address what it called social concerns over...

cellphone: Japan unveils plan to prod carriers to cut cellphone charges – Latest News

Japan on Tuesday laid out a plan for reducing consumers' cellphone charges, as the government stepped up its bid to promote competition in the...

Uniqlo: Japanese apparel retailer Uniqlo forays into Indian online market – Latest News

Japanese global apparel retailer UNIQLO on Tuesday said it has forayed into the Indian online market. The company has introduced 'Shop From Home' service...

waymo: Waymo, Daimler partner to make self-driving trucks – Latest News

Alphabet Inc's autonomous driving technology development unit, Waymo, and a division of Germany's luxury carmaker Daimler AG have teamed up to make heavy-duty, self-driving...