deucalion setup-drive¶
Prepares a drive for backups in one of the five layouts: formats and/or encrypts it, creates the backup folder, puts a copy of Deucalion and a READ-ME file on its normal part (if it has one), and registers it as your default backup drive.
$ deucalion setup-drive --help
usage: deucalion setup-drive [-h] [--layout {encrypt-all,encrypt-part,encrypt-folder,plain,as-is}]
[--method {veracrypt,luks}] [--size GB] [--name NAME]
[--yes-erase DRIVE] [-y]
[device]
prepare a drive for backups (format, encrypt)
positional arguments:
device the drive, e.g. /dev/sdb (asked if not given)
options:
-h, --help show this help message and exit
--layout {encrypt-all,encrypt-part,encrypt-folder,plain,as-is}
--method {veracrypt,luks}
encryption method
--size GB size of the encrypted part or folder
--name NAME a name for the backup drive
--yes-erase DRIVE confirm erasing, e.g. --yes-erase sdb
-y, --yes don't ask for other confirmations
Three layouts erase the drive
encrypt-all, encrypt-part and plain erase everything on the drive. Deucalion shows the
drive's parts and how much they hold, and asks you to type the drive's name (such as sdb)
before it erases anything. Your system disk is never offered and is refused if you name it.
Asked or given¶
Run it without options and it asks everything, one question at a time. Each option answers one question in advance:
| Option | Question it answers | Values |
|---|---|---|
device |
Which drive? | the whole drive, e.g. /dev/sdb (not a part like /dev/sdb1) |
--layout |
How should the backup be stored? | encrypt-all (whole drive), encrypt-part (encrypted part + normal part), encrypt-folder (encrypted folder, keeps the drive's files), plain (exFAT, no encryption), as-is (keep the drive as it is) |
--method |
Which encryption? (encrypted layouts) | veracrypt or luks |
--size GB |
Size of the encrypted part / Size of the encrypted folder | gigabytes, e.g. 500 or 0.5 |
--name |
A name for this backup drive | e.g. Backup (default Deucalion) |
--yes-erase DRIVE |
To confirm, type the drive name | the drive's short name, e.g. sdb |
-y, --yes |
Continue? (layouts that don't erase), and Install it now? for exfatprogs |
The menus only offer what fits the drive: on an empty drive, the two layouts that keep the drive's files aren't offered, so the numbers in the menu change. Read the text, not just the number.
The password is always asked (twice, at least 8 characters; nothing appears while you type). It is never accepted as an option, so it doesn't end up in your terminal history.
The password can't be recovered
Write it down and keep it somewhere safe. Without it, the backup can't be opened by anyone.
Examples¶
Everything asked (encrypted part + normal part, VeraCrypt):
$ deucalion setup-drive
Which drive?
1) /dev/sda Backup Drive 8.0 GB
Choose [1-1] (default 1):
/dev/sda Backup Drive 8.0 GB
(empty)
How should the backup be stored?
1) Encrypt the whole drive
2) Encrypted part for the backup + a normal part for other files
3) No encryption: erase and format the whole drive as exFAT
Choose [1-3] (default 1): 2
Which encryption?
1) VeraCrypt: open it on Linux, macOS and Windows (with VeraCrypt)
2) LUKS: built into Ubuntu, no extra software, Linux only
Choose [1-2] (default 1): 1
Size of the encrypted part for backups? [default 5 GB, max 7 GB]: 5
A name for this backup drive [Deucalion]: Backup
Summary
Drive: /dev/sda Backup Drive 8.0 GB
Layout: Encrypted part for the backup + a normal part for other files (veracrypt)
Encrypted size: 5.0 GB
EVERYTHING on /dev/sda will be erased.
To confirm, type the drive name (sda): sda
Choose the password for the backup. It cannot be recovered if you forget it: write it down and keep it somewhere safe.
Backup password:
Type it again:
Erasing /dev/sda and creating a new partition table
Creating the VeraCrypt volume (you will be asked for your administrator password)…
Encrypting (VeraCrypt)…
Unlocking (VeraCrypt volumes can take up to a minute)…
Creating the exFAT filesystem inside
Unlocking (VeraCrypt volumes can take up to a minute)…
Backup drive 'Backup' is ready: /media/alex/Backup/Deucalion-Backup
Done. Back up with: deucalion backup (drive 'Backup')
With options (whole drive, LUKS); only the confirmation and the password are asked:
$ deucalion setup-drive /dev/sda --layout encrypt-all --method luks --name Big
/dev/sda Big Drive 64.0 GB
(empty)
Summary
Drive: /dev/sda Big Drive 64.0 GB
Layout: Encrypt the whole drive (luks)
EVERYTHING on /dev/sda will be erased.
To confirm, type the drive name (sda): sda
Choose the password for the backup. It cannot be recovered if you forget it: write it down and keep it somewhere safe.
Backup password:
Type it again:
Erasing /dev/sda and creating a new partition table
Encrypting (LUKS)…
Backup drive 'Big' is ready: /media/alex/Big/Deucalion-Backup
Done. Back up with: deucalion backup (drive 'Big')
Without any question (plain exFAT; for scripts):
$ deucalion setup-drive /dev/sdc --layout plain --name Small --yes-erase sdc
/dev/sdc Small Drive 64.0 MB
(empty)
Summary
Drive: /dev/sdc Small Drive 64.0 MB
Layout: No encryption: erase and format the whole drive as exFAT
EVERYTHING on /dev/sdc will be erased.
Erasing /dev/sdc and creating a new partition table
Backup drive 'Small' is ready: /media/alex/Small/Deucalion-Backup
Done. Back up with: deucalion backup (drive 'Small')
The other layouts: whole drive, VeraCrypt · encrypted folder · plain exFAT · as it is.
What it needs¶
exfatprogsfor exFAT (plain, the normal part, and VeraCrypt's inside); it offers to install it.- VeraCrypt for VeraCrypt layouts: "VeraCrypt is needed to create a VeraCrypt volume. Install it from
https://www.veracrypt.fr/en/Downloads.html (Ubuntu .deb), then run this again." Or run
deucalion deps --install --veracrypt. - The administrator password for VeraCrypt (to create and open the volume).
Other messages you may see:
| Message | Meaning |
|---|---|
/dev/sdX is not an external drive (your system disk is never offered). |
The device isn't an external drive Deucalion may change. |
No external drive found. Plug one in and try again. |
Nothing plugged in. |
This drive has no usable filesystem; choose a layout that formats it. |
encrypt-folder or as-is on an empty or unmounted drive. |
Choose a size for the encrypted part that leaves room for the normal part. |
--size too small (under 64 MB) or too large. |
This drive is FAT32, which cannot hold files of 4 GB or more. |
Encrypted folder of 4 GB or more on a FAT32 drive. |
Only N GB are free on this drive. |
Encrypted folder larger than the free space. |
… already exists. |
An encrypted folder file is already there; Deucalion never replaces it. |
To erase the drive non-interactively, pass --yes-erase sdX |
No terminal to ask in, and --yes-erase missing. |
Could not tell which disk holds your system, so no drive will be changed (this protects your system disk). |
Unusual system disk setup (for example a ZFS root); nothing is changed. |
Exit codes¶
0 set up; 1 an error, or you didn't confirm ("Nothing was changed."); 130 stopped.
Related¶
- Choosing a drive and the drive setup tutorials
- The app's setup wizard