If you want to reinstall a new OS, change it, test a version a version with a live-CD,… you need a bootable device. Also, here are several easy ways to create a Bootable USB drive in Ubuntu from an ISO image file. In addition, in principle, no need to install additional packages (except perhaps on variants), the distribution already includes everything you need ...
Introduction
Most operating systems provide ISO image files for their installation that can be downloaded from their websites.
On the other hand, if you simply copy the files contained in the ISO image to the USB drive, you will not be able to boot from it. For this, it is necessary to copy the ISO image in a special way to the USB stick. Ubuntu offers several basic utilities for this.
However, the solutions presented below will make your USB drive unusable as a traditional storage device. Also to recover this functioning, it will be necessary to format it completely and recreate a standard partition structure.
Also, the contents of the USB key will be erased during the operation. So save your content before starting and be careful to choose the right USB device ...
Solution 1: Use Usb-creator to Create Bootable USB Drive in Ubuntu
Usb-creator or Bootable Disk Creator is a utility offered as a base on Ubuntu and most of its variants.
Install Usb-creator on Ubuntu and variants
If it is not present, do in command line:
For Ubuntu, Xubuntu, Ubuntu MATE, and Lubuntu 18.04:
sudo apt install usb-creator-gtk
For Kubuntu and Lubuntu 19.10:
sudo apt install usb-creator-kde
Create a Bootable USB key with Usb-creator in Ubuntu
Launch Bootable Disc Creator from the menu:
or for Ubuntu, Xubuntu, ... with the command:
usb-creator-gtk
and for Kubuntu:
usb-creator-kde
Select the ISO image (1) then your USB key (2). Be careful not to make a mistake, its content will be deleted. Then, click on Create startup disk (3).
Confirm the operation.
Then, authenticate yourself.
After a while, your Bootable USB drive will be ready.
To reuse your USB key as a storage device, you will need to use Gnome Disks or the command line to reformat it ... (see how to do this later in the tutorial)
Solution 2: Use Gnome-Disks to Create Bootable USB Drive in Ubuntu
Gnome-Disks or Disks is a utility offered by the GNOME project to manage disks (management of partitions, mount points, etc.) and it allows you to create a bootable USB stick from an ISO image.
Ubuntu and most of its variants other than Kubuntu and Lubuntu 19.10 install it as standard.
It also allows you to reformat your bootable USB key to reuse it as a storage key.
Install Gnome-Disks
If it is not present on your system, you can install gnome-disk utility with the following command:
sudo apt install gnome-disk-utility
Create a Bootable USB key with Gnome-Disks
Launch Disks from the menu:
or with the command:
gnome-disks
Select your USB key (1) then in the Menu (2) do Restore disk image ...
So select your ISO Image file (1), then do Start Restore (2).
Then validate by clicking on Restore.
And authenticate yourself.
There you have it, your Bootable USB key is ready.
Format your USB key with Gnome Disks to use it as a storage key
Select your USB key (1) then in the Menu (2) do Format disc… (3). this will erase all partitions on the disk.
I advise you to keep the default settings. And do Format ...
And confirm by clicking Format.
Now you have to recreate a partition on your USB key. Select your USB key (1) and click on the + icon (2)
By default, all available space is allocated to the new partition, click Next.
Finally, give a name to your USB key (1). You can activate Erase (2) to write 0s to all sectors, but it will take longer. You can also change the partition type (3), but to keep compatibility with other OS, I recommend keeping FAT. Then, do Create (4).
After a little while, your key is ready to store documents again.
Solution 3: Use the command line to create a Bootable USB drive in Ubuntu
In Linux, there are several commands to create a Bootable key from an ISO image file. Here is the method I use:
Create a bootable USB drive from the command line
First, identify on which Device corresponds to the USB key with:
lsblk
So, if one or more partitions of the key are, unmount them:
sudo umount / dev / sdXY
/ dev / sdXY: with X to adapt with the corresponding device letter and Y with the number corresponding to the partition to unmount (example: sdb1).
Finally, copy the image to the USB stick with:
sudo dd if = / path_to / image.iso of = / dev / sdX bs = 4M status = progress && sync
dd: command to copy a disk
if = / path_to / image.iso: to adapt with the path to your iso image
of = / dev / sdX: to be adapted with the device corresponding to your USB key (example: sdb)
bs = 4M: size of the blocks
status = progress: allows the indication of the progress of the operation (optional)
&&: to chain another command
sync: force the buffers to finish emptying on the key
And, finish by disconnecting then reconnecting your key.
Format your USB key from the command line to use it as a storage key
Under Linux, several tools allow you to manage the partitions of a disk from the command line like fdisk, cfdisk,… But, here is how to do it with fdisk.
Start by removing your USB key:
sudo umount / dev / sdXY
/ dev / sdXY: with X to adapt with the corresponding device letter and Y with the number corresponding to the partition to unmount (example: sdb1).
Then, to modify the partitions of your USB key, do:
sudo fdisk / dev / sdX
Then enter d to erase a partition. And redo the manipulation to erase all the existing partitions (in principle there are two ...):
So, do n to create a new partition. And, hit Enter four times to keep the following default settings:
Partition type: primary
partition number: 1
and First sector and Last sector to have the partition on the entire USB key
Now do t to change the partition type and b to change it to FAT32:
And, save the changes then exit with w:
q allows you to quit without modifying anything.
Finally, format your key in FAT32 to be able to use it:
sudo mkfs.vfat / dev / sdXY
/ dev / sdXY: adapt X and Y according to your configuration

Commentaires
Enregistrer un commentaire