Home Bittorrent Write An ISO To The USB Drive Directly From The Internet With BTFS

Write An ISO To The USB Drive Directly From The Internet With BTFS

By sk
Published: Last Updated on 7.3K views

This tutorial explains how to write an ISO to the USB drive directly from the Internet using BTFS, without having an actual ISO image in our local system.

The title might be bit confusing. Let me clarify it. I want to create a bootable Ubuntu drive, but I don't have the ISO image in my hard drive.

In fact, the ISO image is not even in any systems in my local area network. All I have is an USB drive and an Internet-connected Linux desktop. How can I create a bootable Ubuntu usb drive?

Yes, you can just download and write the ISO to USB drive. There are many applications, such as Ventoy, dd command, Etcher, bootiso, available to easily create bootable USB drives in minutes.

But we are not going to download the ISO and then write it to the USB drive using any bootable creation applications.

Instead, we are going to directly write the ISO to the USB thumb drive from Internet using BTFS. Sounds interesting, right?

Pros of this method

  • You don't have to download the ISO image. The contents of ISO file will be directly downloaded from the Internet on demand and written into the USB drive while we creating the bootable drive.

Cons

  • The process of writing an ISO to a thumb drive is terribly slow. I created Ubuntu 18.04 server bootable usb disk. It took nearly an hour. I knew It's because of the content of the ISO is being downloaded from the Internet on demand. But one hour is way too much.
  • This method worked only with Disk Image Creator gui application. The other bootable creation software gave file permission error even though I gave full permission to the directory where I kept the contents of ISO.

Like I already said, the objective of this guide is to show you how to create bootable USB drives directly from the Internet without having an actual ISO image in our local system.

However, I wouldn't recommend this method for creating bootable ISO images. It is quite time consuming process. This guide is purely for educational purpose only!

Write an ISO to the USB drive directly from the Internet using BTFS BitTorrent filesystem

If you haven't installed BTSFS yet, refer this link.

Once BTFS installed, create a directory to mount the content of the ISO file. Let us call it mnt.

$ mkdir mnt

Now, download your torrent. For the purpose of this guide, I will be using Ubuntu 18.04 server edition torrent.

Mount the torrent file (I assume you have kept the torrent file in Downloads directory) using BTFS as shown below:

$ btfs Downloads/ubuntu-18.04-live-server-amd64.iso.torrent mnt/

The above command will mount the Ubuntu 18.04 LTS torrent file in mnt directory. Give BTFS a few moments to find and get the website trackers. Once the real data is loaded, BTFS won’t require the tracker any more.

Now, plug in your USB drive, open the file manager and go to the mount directory i.e mnt in our case. There you will see the ISO image.

Mount Ubuntu ISO torrent using BTFS
Mount Ubuntu ISO torrent using BTFS

Right click on the ISO file. From the right-context menu, Choose Open with -> Disk Image Writer.

Write ISO image to USB drive
Write ISO image to USB drive

Note:

If the Disk Image Creator option is not available, please install GNOME Disks. It is a graphical utility to manage disk drives and media.

On Arch Linux and its derivatives:

$ sudo pacman -S gnome-disk-utility

On RHEL, CentOS, Fedora:

$ sudo yum install gnome-disk-utility

Or,

$ sudo dnf install gnome-disk-utility

On SUSE/openSUSE:

$ sudo zypper in gnome-disk-utility

In the next screen, choose the destination drive i.e your USB drive. Double check if you have chosen the correct drive. Finally, click Start Restoring button.

Choose USB drive to write ISO image
Choose USB drive to write ISO image

The BTFS will download the contents of the torrent file directly from the Internet and the Disk Image Creator application will write the ISO into your USB drive.

Write an ISO to the USB drive directly from the Internet using BTFS
Write an ISO to the USB drive directly from the Internet using BTFS

Now grab a cup of coffee. Like I already said, it may take a long time to complete depending upon your Internet speed.

I have tested Ubuntu 18.04 server ISO (size 800+ MB) and it took roughly one hour to complete. Once the USB bootable drive is created, unmount, plug-in again and check if you can be able to boot from that drive.

Finally, don't forget to unmount the BTFS file system using command:

$ fusermount -u mnt

Now, the contents in the mounted directory will be gone. To access the contents of the torrent file again, you need to mount the torrent as described above.

You May Also Like

1 comment

Arun Khan June 24, 2018 - 1:19 am

Even though torrent does provide file integrity. It is a good practice to check file origin with published signatures.

Assuming one *trusts* the downloaded ISO file, a one step CLI achieves the same objective.

sudo dd if= of=/dev/

–or–

sudo ddrescue < /dev/

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More