en	If instead, your Tails USB stick doesn't start, refer to our instructions on [[recovering data from the Persistent Storage when Tails doesn't start|recover]].

en	[[!img repair.png class="screenshot" alt="File System Errors dialog in Welcome Screen"]]
es	[[!img repairing.png link="no" class="screenshot" alt=""]]

en	Using `ddrescue` is more difficult but is better than the *Disks* utility to recover data if the hardware of your USB stick is failing.

en	Creating a partition image using the Disks utility

en	When the hardware of your USB stick is not failing, using the *Disks* utility is the simplest way of creating a partition image of your Persistent Storage.

en	Preparing the external hard disk

en	[[Set up an administration password|doc/first_steps/welcome_screen/administration_password]].

en	Choose to start without unlocking your Persistent Storage.

en	Plug in the hard disk on which you want to save the partition image of your Persistent Storage. You need as much free space as the size of your Persistent Storage, usually 8&nbsp;GB less than your Tails USB stick.

en	A new volume appears in the sidebar of the *Files* browser.

en	Right-click (on Mac, click with two fingers) on the new volume that appeared in the sidebar of the *Files* browser and choose *Properties* in the shortcut menu.

en	Take note of the free space in the volume.

en	Identifying your Persistent Storage in the Disks utility

en	Choose **Apps&nbsp;▸ Utilities&nbsp;▸ Disks** to open the *Disks* utility.

en	In the left pane of the *Disks* utility, identify your Tails USB stick in the list of storage devices.

en	Verify its brand and size.

en	In the left pane, click on the storage device that corresponds to your Tails USB stick.

en	In the right pane, this storage device should have 2 volumes, corresponding to 2 partitions on the USB stick.

en	1 volume with a **Tails** label and **FAT** content.

en	This volume corresponds to the system partition of your Tails.

en	1 volume with a **TailsData** label and **LUKS** content.

en	This volume corresponds to the encrypted version of your Persistent Storage.

en	In the right pane, click on the volume that corresponds to your Persistent Storage.

en	Verify that the content of the volume is of type **LUKS Encryption**.

en	Unlocking your Persistent Storage in the Disks utility

en	Before creating the partition image, unlock the encryption to access the decrypted version of your Persistent Storage. To do so:

en	Click [[!img lib/unlock.png link="no" class="symbolic" alt="Unlock selected encrypted partition"]].

en	In the **Enter passphrase to unlock** dialog, enter the passphrase of your Persistent Storage.

en	Click **Unlock**.

en	In the **Authentication Required** dialog, enter your administration password.

en	If unlocking fails at this step, your Persistent Storage is so damaged that decryption is impossible, making all your data completely unrecoverable.

en	In the right pane, click on the new volume that appears below the **LUKS** volume.

en	Verify that the content of the new volume is of type **Ext4**.

en	This volume corresponds to the decrypted version of your Persistent Storage.

en	Verify that the size of your decrypted Persistent Storage is smaller than the available free space in the external hard disk.

en	Take note of the device name of your Persistent Storage.

en	The device name is composed of `/dev/mapper/luks`, followed by letters and numbers.

en	Creating the partition image

en	Choose **[[!img lib/system-run.png link="no" class="symbolic" alt="Additional partition options"]]&nbsp;▸ Create Partition Image**.

en	In the **Create Disk Image** dialog:

en	In the **Name** field, specify *persistent-storage.img*.

en	In the **Save in Folder** menu, choose the external hard disk to which you want to save the partition image.
es	Aquí estamos presentando 2 técnicas diferentes para crear una imagen de partición de tu Almacenamiento Persistente.

en	Click the **Start Creating** button.

en	After the creation of the partition image finishes:

en	If the creation succeeded, shutdown Tails.

en	You can now safely start [[recovering data from the Persistent Storage|fsck#welcome]].

en	If the creation failed, try the second technique described below to [[create a partition image using `ddrescue` on the command line|fsck#ddrescue]] instead.

en	Creating a partition image using ddrescue on the command line

en	If creating a partition image using the *Disks* utility fails, you can try this second technique using `ddrescue`, which can be more resilient to hardware failures.

en	The `ddrescue` utility tries to copy first the parts of the Persistent Storage that are not failing and skips over the parts that are failing. After that, you can run `ddrescue` again to try to copy the parts that failed the first time.

en	In the *Files* browser, navigate to the folder of the external hard disk where you want to save the partition image of your Persistent Storage.
es	Aquí estamos presentando 2 técnicas diferentes para crear una imagen de partición de tu Almacenamiento Persistente.

en	Right-click in the empty space of the right pane and choose **Open in Console** in the shortcut menu.

en	Doing so opens a console that is configured to operate in this folder.

en	In the console, execute the following command. Replace /dev/mapper/luks-xyz with the device name found when [[identifying your *Persistent Storage* in the *Disks* utility|fsck#identify]].

en	sudo ddrescue /dev/mapper/luks-xyz persistent-storage.img ddrescue.log

en	The output of `ddrescue` looks like this:

en	GNU ddrescue 1.29 Press Ctrl-C to interrupt ipos: 749404 kB, non-trimmed: 0 B, current rate: 34996 kB/s ipos: 1446 MB, non-trimmed: 0 B, current rate: 24772 kB/s opos: 1446 MB, non-scraped: 0 B, average rate: 33629 kB/s non-tried: 9290 MB, bad-sector: 0 B, error rate: 0 B/s rescued: 1446 MB, bad areas: 0, run time: 43s pct rescued: 13.46%, read errors: 0, remaining time: 1m 31s time since last successful read: 0s Copying non-tried blocks... Pass 1 (forwards)
es	GNU ddrescue 1.27 Press Ctrl-C to interrupt ipos: 749404 kB, non-trimmed: 0 B, current rate: 34996 kB/s ipos: 1446 MB, non-trimmed: 0 B, current rate: 24772 kB/s opos: 1446 MB, non-scraped: 0 B, average rate: 33629 kB/s non-tried: 9290 MB, bad-sector: 0 B, error rate: 0 B/s rescued: 1446 MB, bad areas: 0, run time: 43s pct rescued: 13.46%, read errors: 0, remaining time: 1m 31s time since last successful read: 0s Copying non-tried blocks... Pass 1 (forwards)

en	The section about **bad areas** refers to errors reading the data of your Persistent Storage, most likely because of hardware failures.

en	After `ddrescue` finishes:

en	If bad areas were reported, try leaving your USB stick to rest for some minutes and executing the same `ddrescue` command again to copy more data.

en	We recommend that you replace your USB stick and [[copy the partition image to a new USB stick|fsck#copy]] after you execute `ddrescue` several times.

en	If no bad areas were reported or if the same bad areas were reported after several executions of the `ddrescue` command, it means that all the data that could be rescued was copied to the partition image.

en	Shut down Tails.

en	You can now safely start [[recovering data from the Persistent Storage|fsck#welcome]].

en	Recovering data from the Persistent Storage

en	After [[creating a partition image|fsck#image]], you can safely try to recover data from your Persistent Storage without risking erasing more data.

en	We are presenting here 3 recovery techniques that work in different cases. We recommend that you try the 3 techniques one after the other.

en	[[Repairing the file system from the Welcome Screen|fsck#welcome]]

en	If the hardware of your USB stick is not failing, repairing the file system from the Welcome Screen is likely the easiest technique.

en	[[Copying the partition image to a new USB stick|fsck#copy]]

en	If the hardware of your USB stick is failing, you might still be able to repair the file system of your Persistent Storage after copying the partition image to a new USB stick.

en	[[Analyzing the partition image using *Autopsy*|fsck#autopsy]]

en	[*Autopsy*](https://www.autopsy.com/) is an advanced digital forensics tool that allows recovering files, even from broken file systems.

en	Repairing the file system from the Welcome Screen

en	If the hardware of your USB stick is not failing, repairing the file system from the Welcome Screen is likely the easiest technique.

en	Start on the Tails USB stick that has file system errors.

en	In the Welcome Screen, try to unlock the Persistent Storage.

en	When the error message about file system errors appears, click on the **Repair File System** button.

en	[[!img repair.png class="screenshot" alt="File System Errors dialog in Welcome Screen"]]
es	[[!img repairing.png link="no" class="screenshot" alt=""]]

en	The repair of the file system starts.

en	The repair can take a long time, from a few seconds to several hours.

en	If the repair takes more than a day, shutdown Tails and try [[analyzing the partition image using *Autopsy*|fsck#autopsy]] instead.

en	After the repair finishes:

en	If the repair succeeded, start Tails and verify the content of your Persistent Storage.

en	We recommend that you keep the partition image for some time.

en	If you realize later on that some files are missing or damaged, you might be able to recover them by [[analyzing the partition image using Autopsy|fsck#autopsy]].

en	If the repair failed, try to [[copy the partition image to a new USB stick|fsck#copy]] as described below.

en	Copying the partition image to a new USB stick

en	If the hardware of your USB stick is failing, you might still be able to repair the file system of your Persistent Storage after copying the partition image to a new USB stick.

en	Creating a new Tails USB stick with Persistent Storage

en	[[Install Tails|install]] on a new USB stick.

en	The new USB stick must be at least as large as your current Tails USB stick.

en	Start on the new Tails.

en	When starting Tails, [[set up an administration password|doc/first_steps/welcome_screen/administration_password]].

en	Create a Persistent Storage on the new Tails.

en	Close the Persistent Storage settings after creation, when the list of features is displayed.

en	The process described below overwrites the contents and configuration of the new Persistent Storage. So, it does not matter which features you turn on after creating the Persistent Storage.

en	Copying the partition image onto the new USB stick

en	In the left pane of the *Disks* utility, identify your new Tails USB stick in the list of storage devices.

en	In the left pane, click on the storage device that corresponds to your new Tails USB stick.

en	In the right pane, this storage device should have 3 volumes.

en	1 volume with a **TailsData** label and **Ext4** content.

en	This volume corresponds to the decrypted version of your Persistent Storage.

en	In the right pane, click on the **Ext4** volume, which is the one that corresponds to the decrypted version of your Persistent Storage.

en	In the attributes below the volume, verify that its device is */dev/mapper/TailsData_unlocked*.

en	Click on the [[!img lib/media-playback-stop.png link="no" class="symbolic" alt="Unmount selected partition"]] button to unmount the Persistent Storage.

en	Plug in the hard disk on which you saved the partition image of your Persistent Storage.

en	Choose **[[!img lib/system-run.png link="no" class="symbolic" alt="Additional partition options"]]&nbsp;▸ Restore Partition Image**.

en	Click on the **Start Restoring** button.

en	After the restoration finishes, restart on the new Tails USB stick.

en	Fixing the file system errors on the new USB stick

en	If an error message about file system errors appears, click on the **Repair File System** button.

en	If the repair failed, try to [[analyze the partition image using *Autopsy*|fsck#copy]] as described below.

en	Analyzing the partition image using Autopsy

en	[*Autopsy*](https://www.autopsy.com/) is an advanced digital forensics tool that allows recovering files, even from broken file systems.

en	*Autopsy* is open source and available for free on Windows, macOS, and Linux.

en	To avoid leaving traces of the content of your Persistent Storage on the operating system where *Autopsy* is used, we recommend that you use *Autopsy* in Tails. But, *Autopsy* is easier to install in Windows than in Tails.

en	We are not providing step-by-step instructions on how to install and use *Autopsy*.

en	If you don't feel confident installing and using *Autopsy* on your own, we recommend that you get help from someone with more experience with Linux and data recovery.

en	You can also read the [Autopsy User Documentation](http://sleuthkit.org/autopsy/docs/user-docs/latest).

en	Installing *Autopsy* in Tails

en	The general steps are:

en	From the [download page](https://www.autopsy.com/download/), download the 2 binaries needed to run *Autopsy*:

en	The DEB file of *The Sleuth Kit*.

en	The ZIP file of *Autopsy*.

en	From the [installation instructions of *Autopsy* for Linux](https://github.com/sleuthkit/autopsy/blob/develop/Running_Linux_OSX.md), download the 2 scripts needed for the installation:

en	Execute the following commands in a *Console*. Replace version with the version number of *The Sleuth Kit* and *Autopsy* that you downloaded.

en	sudo dpkg -i sleuthkit-java_version_amd64.deb
es	sudo dpkg -i sleuthkit-java_4.12.1-1_amd64.deb

en	bash install_application.sh -z autopsy-version.zip -i ~/Persistent/autopsy -j /usr/lib/jvm/java-17-openjdk-amd64
es	bash install_application.sh -z autopsy-4.21.0.zip -i ~/Persistent/autopsy -j /usr/lib/jvm/java-17-openjdk-amd64

en	/home/amnesia/Persistent/autopsy/autopsy-version/bin/autopsy

en	When starting for the first time, *Autopsy* freezes on **Starting modules**.

en	Press **Enter** to continue.

en	Using *Autopsy* to analyze the partition image

en	Start *Autopsy*.

en	After the analysis finishes, the files that were recovered are listed in different ways in the left sidebar, for example, both as a file system tree and by type of files.

en	[[!img autopsy.png class="screenshot" alt="Autopsy in Tails showing files recovered from the partition image of a Persistent Storage"]]