This script is designed to clone USB drives on a Linux system. It lists all connected USB drives, allows the user to select a source and destination drive, and then clones the source drive to the destination drive. This script must be run with root permissions.
- install the requirements.txt:
pip install -r requirements.txt
- ensure the script is executable:
chmod +x clone_usb.py
sudo python clone_usb.py
-
The script lists all connected USB drives and waits for a USB drive to be connected if none are detected.
-
It displays information about each detected USB drive, including the manufacturer and model.
-
The user is prompted to select the source drive to clone from and the destination drive to clone to.
-
Safety checks ensure that the source and destination drives are not the same.
-
The user is prompted to confirm the cloning operation.
-
The script uses the dd command, piped through pv for progress monitoring, to clone the source drive to the destination drive.
Important Notes
• Data Loss Warning: Cloning a drive will overwrite all data on the destination drive. Ensure you have backups of any important data.
• Root Permissions Required: The script must be run with root permissions to access and clone the drives.