0

My Fedora system recently crashes with strange error messages, so I am worried that my ~5 years old SSD is failing.

Now I want to rescue my data from this SSD and reinstall Fedora from scratch on a new SSD.

I created a bootable Fedora USB flash drive and booted it without mounting the failing SSD. Now I want to rescue the data from this SSD onto an external 8TB HDD (~4TB free space). The SSD has a capacity of 1TB, but only ~250 GB are actually used.

I think ddrescue is a good option for that?

How can I use ddrescue? I want to get my data and the logfile in a new folder on the 8TB external HDD. I don't want to overwrite any data.

I don't know which file system my external HDD uses. I don't know the filesystems used by the partitions of my failing SSD (on which Fedora is installed).

So in my case I can run this command:

sudo ddrescue -n /dev/nvme0n1 /run/media/liveuser/Elements/Backup/backup.img /run/media/liveuser/Elements/Backup/log.log

If nvme0n1 is the SSD from which I want to save the data and /run/media/liveuser/Elements/Backup/ is the folder where I want to store the backup and the logfile?

Should I use the --sparse option? What are the pros and cons? Should I allocate 1TB for backup.img via truncate? What are the pros and cons? How large will backup.img be? ~250GB or 1TB?

ChatGPT tells me that I don't need to use truncate and that the backup.img will be approximately 250GB large. However, Gemini strongly recommends using truncate and tells me that the file will take approximately 1TB even without truncate and that the only way to get it to ~250GB is using the --sparse option. Which one is true?

Should I use options such as -f or -n? What do these options do?

Giacomo1968
  • 58,727
Jakob
  • 353

1 Answers1

1

Go ahead and use the ddrescue command you have shown as an example.

It will just write to a file called backup.img and if it runs out of space? It will self-abort the operation.

This is the command you propose using:

sudo ddrescue -n /dev/nvme0n1 /run/media/liveuser/Elements/Backup/backup.img /run/media/liveuser/Elements/Backup/log.log

Go ahead and use it! It will just write to a file called backup.img and if it runs out of space? It will self-abort the operation. That backup.img file is just a self-contained file like any other file; it poses utterly no risk to the data that is already on that drive.

In fact, if the image grows significantly past 250 GB just abort the operation and go back to the drawing board.

The command is 100% safe and the data you have on the 8TB HDD that has about 4TB free space you will be completely safe.

If you have about 4TB of free space, that is much more than enough to store a 1TB backup even if only about 250 GB are actually used.

In conclusion, you have much more free space on the external 8TB drive than is needed for a 1TB backup let alone a 250 GB backup. There should be no worries at all.

Giacomo1968
  • 58,727