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 local drive. The 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? Sure, you can just download and write the ISO to USB drive. There are many applications, such as dd command, Etcher, bootiso, available to easily create bootable USB drives in minutes. However, this is not the scope of this guide. 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. We already have covered what is BTFS in the previous tutorial. Do check it to learn how it works.
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.
- 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 that we can create bootable USB drives directly from the Internet without having an ISO image in our local system. 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
Install BTFS as described in the previous tutorial (the link is given in the first paragraph of this guide).
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.
Right click on the ISO file. From the right-context menu, Choose Open with -> Disk Image Writer.
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
$ sudo dnf install gnome-disk-utility
$ 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.
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.
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.
- How To Create An ISO From A Bootable USB Drive In Linux
- MultiCD – Create Multiboot CD, DVD, and USB Images