Create Linux bootable USB from CLI
Project description
CometUSB
Python package for Linux distributions to create bootable USB.
See full documentation at: https://CometUSB.github.io/CometUSB/
Description
This is a python package exclusively for linux distributions. It has list of linux distributions you can choose to create the bootable media. In the corresponding release section you will find the installation files of several linux distributions.
Features
- Create UEFI with GPT and Legacy BIOS with MBR bootable USBs.
- Dual-partition layout: In case of UEFI system two partitions first small FAT32 for boot then NTFS in rest of the space for other files are created.
- Single-partition layout: In case of legacy systems only one NTFS partition is created in the entire disk for both boot and installation files.
- Automatically install GRUB for UEFI or legacy systems.
- Only shows removable disk to format which prevents wiping your main HDD/SSD. This avoids significant data loss.
Purpose of CometUSB.
While this tool can be used with any terminal, mostly it is created for broken/corrupt system, so even if in the recovery environment user is unable to fix the system, a bootable device can be created right away from the same interface without even relying on the other system to make it, this makes the tool robust and reliable.
Steps to work in broken system.
- Just boot into recovery mode from the GRUB menu while startup.
- Enable networking to have internet connection enabled.
- See the installation and usage guide to install and use respectively.
Installation
CometUSB is a Python package available on PyPI. It requires Python 3.8 or higher.
Prerequisites
Before installation, ensure you have:
- Linux Distribution: CometUSB is exclusively for Linux.
- Python 3.8+: Installed on your system.
- Administrative Rights (
sudo): The tool requiressudoprivileges to manage disks and partitions.
Install via pip
The most straightforward way to install CometUSB is using pip:
pip install cometusb
or
pipx install cometusb
or
python -m pip install cometusb
or
python3 -m pip install cometusb
If above command does not work, use virtual environment approach given below.
With virtual environment (venv).
python -m venv .venv
source .venv/bin/activate
pip install cometusb
If none of the above commands work, find out how to install python package in your system.
Usage Guide
CometUSB is run directly from the command line, requiring administrative privileges (sudo) because it must access and format your physical disk devices.
Basic Command Structure
You must always specify the Operating System name (-o) and the target system's BIOS type (-b).
sudo cometusb -o <OS_NAME> -b <BIOS_TYPE>
or
sudo cometusb --operating-system <OS_Name> --bios-type <BIOS_TYPE>
e.g, sudo cometusb -o linuxmint -b uefi
or if using virtual environment (venv), use sudo su like below.
(.venv) thesniper@thesniperpc:~$ sudo su
[sudo] password for thesniper:
root@thesniperpc:/home/thesniper cometusb -o linuxmint -b uefi
Type cometusb -h or cometusb --help to see the usage
Type cometusb --list-os or cometusb -l to see the list of available Operating System
CLI Reference
Required Arguments
| Option | Long Option | Description | Example |
|---|---|---|---|
-o |
--operating-system |
Name of the Operating System to download and install. | -o linuxmint |
-b |
--bios-type |
BIOS type (boot mode) for the target system. Specifies the partitioning scheme (GPT/MBR) and GRUB installation method. | -b uefi |
Optional Arguments
| Option | Long Option | Description |
|---|---|---|
-l |
--list-os |
Shows a list of the currently available and supported Operating Systems. |
-h |
--help |
Show the help message and exit. |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cometusb-1.1.tar.gz.
File metadata
- Download URL: cometusb-1.1.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdf8783ba7778a8c5aac6478010c76947b7e508bd66b44f3be000db5f7549313
|
|
| MD5 |
3642fda7ce63fbdb7d0604158f83c4a0
|
|
| BLAKE2b-256 |
880e894d88c7c5588db7018981de7abd4f2b3d2c42306c6fdfeb11115feba134
|
File details
Details for the file cometusb-1.1-py3-none-any.whl.
File metadata
- Download URL: cometusb-1.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e23e6a6eeb127e8c2c0e4ced445c134fcef69b74d664d47a890400ba87d7492
|
|
| MD5 |
4980b3840ba1ee04547436609fdce763
|
|
| BLAKE2b-256 |
696db4895ea8fb7092c97db932160c5a5de2fce845707c0417368044b137adc5
|