2

My wife has a laptop running Ubuntu, set up to do a backup each day onto an external hard disk. The Ubuntu machine has developed a critical power supply fault and we want to restore her files to a Win 10 machine pending repair of her laptop. Is this possible? At present I am some 1,600 miles away but, IIRC, the backup process was the one native to Ubuntu. I can't get any further details as the laptop won't boot beyond a simple message saying it is in power saving mode. She has tried all the obvious - check cables, reboot, etc. If I were there I would remove the HDD but I am attempting to find a solution remotely. Repair of the laptop is a secondary issue compared to recovering the files. (BTW, my own machines are backed up via SugarSync but SS refuses to acknowledge Linux.)

SteveH
  • 23

2 Answers2

1

I Assume you used Deja Dup, AKA Backup, the default backup app to make the backups in the external drive.

The Simple answer is NO! (Or Very Difficult)

There are two reasons for this:

  1. External Hard Disk format. It is not clear if the external backup disk you used is formatted ext4 the default format used by Ubuntu, or NTFS, the usual format the external USB hard drives are formatted for Windows. If the USB drive is formatted ext4 then see the answer by K7AAY for possible ways to read ext4 formatted drives in Windows.
  2. The compressed-incremental-multivolume-encrypted file format in which the backups are stored. Deja Dup (the default Backup program) does not simply copy the files from the laptop into the external drive. It stores them in in a compressed form so that every day only the changes made after the previous day's backup is stored (incremental). Large files are broken up to smaller chunks (multivolume) to keep the individual backup file sizes reasonable. Optionally, the backups can be encrypted with a password. The downside of this is it is not simple to restore the files without going through the app. There is no Windows version of Deja Dup I am aware of. Therefore even if the backup USB drive can be readable in Windows, restoring from these backups in a Windows computer will be very difficult.

Solution using Live Ubuntu USB

In this solution it does not matter if the backup USB drive was formatted ext4 or NTFS, as you will be booting from the Live Ubuntu USB to restore the backup.

I assume you do not have another computer with Ubuntu in it, but you have access to a Windows computer. To do this you will need:

  1. Another computer running Windows that can boot from USB
  2. Either sufficient disk space in this computer for a complete restore of all her files. Or a second empty USB drive to restore all her files. The empty USB drive should be formatted NTFS, so that Windows can read it later. Note, the backup files are compressed. The restored files may take more space than the backup files.
  3. A Live Ubuntu USB, the same one used to install Ubuntu into a computer.

Note: This method does not allow selective file or folder restore. You will need a internal or external drive or partition to hold all the files and folders backed up.

Step 1: Boot Windows computer using the Live Ubuntu USB

Use the Try Ubuntu without Installing... option. You don't want to install Ubuntu here. Wait till the familiar Ubuntu desktop shows up.

Step 2: Plugin the Backup USB drive (and the second USB Drive to restore to, if needed)

Make sure you can read and write create folders etc. in the external drive. Create a Restore folder where all the files will go.

If you intend to restore to the internal hard drive of the computer, this is the time to mount the internal partition and create a restore folder where all the files and folders will get dumped. Again make sure the partition has sufficient free space for the full restore.

Step 3: Open Deja Dup

Search for Backups in the application launcher and open the app. Select Restore:

enter image description here

Step 4: Select the location of the Backups

enter image description here

Backup Location should be the default Local Folder. Select Choose Folder and navigate to the mounted backup USB drive. It may look something like /media/<username>/BackupDrive/<laptopname>/<username>/deja-dup. You will know you have reached the right folder if you see lots and lots of files names starting with "duplicity" and ending with ".gz".

Select Forward to go to the next step

Step 5: The Date of Backup

Select the date of the backup you want to restore, the default is the most recent:

enter image description here

Select Forward

Step 6: Restore to Where?

Here you need to change the default setting to Restore to specific folder

enter image description here

Click on the Restore folder (None) and navigate to the folder you created either in the internal drive or in the second USB drive.

Step 7: Click Restore

enter image description here

Read the Summary information and make sure they are correct. and hit Restore. Wait for a few hours/days/weeks, depending on the amount of data and the speed of the the USB drives involved.

Step 8: Restart and boot to Windows

Once Restore is complete, reboot the Live Ubuntu USB using the power button in the drop down menu from the top right corner. Unplug the Live USB when prompted and hit Enter. When Windows boots up, you should be able to find the restored files and folders in the location you put them.

Windows Solution (Not Fun or Easy!)

Deja Dup stores the backup files in multiple compressed files. These files may be for an occasional full backup and regular incremental backups. When large files are backed up, they are broken into smaller chunks and then compressed into separate backup files. Optionally, backups may be encrypted with a password. See Deja Dup site for more information.

I have not tried this method. It is based on Deja Dup documentation for restoring by hand under the worst case scenario.

You Will Need:

Windows does not come with all the tools needed such as gpg to decrypt the encrypted files.

  1. Gpg4Win is the Windows version of gpg. You will need it only if the backups are encrypted.
  2. tar is a file/folder compression program used by Deja Dup. Newer versions of Windows 10 includes this utility.
  3. Be comfortable with the Windows command line.

The instructions below are from Deja Dup documentation.

Introduction

Deja Dup stores your data in small chunks called volumes. Some volumes belong to the periodic 'full' or fresh backups and others to the 'inc' or incremental backups. Starting with a full backup set of volumes at volume 1, you'll need to restore files volume by volume.

You have to look at a sample file name and understand its various parts:

duplicity-full.20110127T131352Z.vol1.difftar.gpg

duplicity is the name of the underlying program used by Deja Dup. All files must start with this prefix.

full or inc indicates the type of backup, full or incremental.

20110127 is the date of the backup, in this example, January 27, 2011.

131352 is the time of the backup in the standard format used by Linux.

vol1 is the volume number.

difftar is the suffix used by Deja Dup to indicate compressed data files.

gpg or gz indicates if the file is encrypted by gpg or compressed without encryption.

We will use this example file name for the instructions.

If Encrypted!

If you encrypted your backup, first you must decrypt the volume with gpg:

gpg --output duplicity-full.20110127T131352Z.vol1.difftar --decrypt duplicity-full.20110127T131352Z.vol1.difftar.gpg

This will give you a decrypted file duplicity-full.20110127T131352Z.vol1.difftar for the next step.

Decompress

If you just decrypted the file you will have duplicity-full.20110127T131352Z.vol1.difftar.

If your backups were not encrypted to begin with you will have a file duplicity-full.20110127T131352Z.vol1.difftar.gz.

Use the tar command to decompress the file:

tar xf duplicity-full.20110127T131352Z.vol1.difftar.gz

The decompression process will create the folders multivolume_snapshot and snapshot. After you decompress all the volumes, you will need to combine the chunks in the multivolume_snapshotfolder to recreate the large files.

Let's say you backed up a huge file /home/jane/essay.txt. You will have a folder called multivolume_snapshot/home/jane/essay.txt.

Use the following commands:

cd multivolume_snapshot/home/jane/essay.txt
type * > essay.txt

The first command changes the current directory to essay.txt.

The second command concatenates all the chunks into a single file called essay.txt inside the folder essay.txt. The original instructions used the linux cat command. Since cat is not in Windows, I substituted it with type. However, it may not work with files that are not in plain-text format.

Note: You may have to list the file names inside the folder in the order instead of *, to get the file back.

Restore Incremental Backup

Once you have restored the full backup you will have most of your files excepts the new files and the changes made after the full-backup was made.

Deja Dup documentation suggests use rdiff to stitch together files with incremental changes. Since this utility is not available in Windows, I am not sure if this can be done in Windows.

Hope this helps

user68186
  • 33,360
  • 2
    Thank you for a very comprehensive answer which will no doubt be of value to many other people too. – SteveH Mar 03 '20 at 09:19
0

0) Laptop with a power supply fault? Almost all laptop power supplies are external. Generic replacements are easily available if you can't find your particular brand's exact replacement.

Replace the external power supply with another, and that may resolve the problem with nothing more needed; but, then maybe the power supply is inside the laptop (as sometimes is seen with high performance machines) and all that's outside is a power cord.

1) There is an Open Source driver you can add to Windows 10 to enable it to read files from an ext2/3/4 partition. I would never, never, use it to write or change files on an ext2/3/4 partition because of how many ties it has my data, but reading should be OK.

However, if the default Ubuntu backup app Déjà Dup you will find the backup destination has files which Windows cannot automatically read as they were encrypted by rsync. You would need to add more (Open Source, free) software to the Windows machine to extract data files from the backup. You can also preserve the backup files on a Windows filesystem until you can get them onto another Ubuntu machine to extract the data.

2) A similar commercial product is advertised, but I've never used it.

3) Before the laptop goes into repair, you can remove the internal drive easily on almost all laptops with one Phillips head screwdriver. Consult your hardware and repair guide for that laptop, or if you don't have it, tell us the model part number from the serial number sticker and we can search for it. 'Model' numbers elsewhere on the laptop are not specific enough to zero in on the right model.

4) Or, you can get a second external drive, boot from an Ubuntu Live USB you can make from Windows, format that #2 external as NTFS, and copy the backup across. Since you have not specified the app used not the command invoked to perform backup, we can't tell you exactly how to extract the individual files from the backup archive, but you can do that later.

K7AAY
  • 17,202
  • @user68186 Touché! Corrected with chagrin. – K7AAY Feb 28 '20 at 21:54
  • 1
    Thanks for the response. The external drive had been formatted on an XP machine prior to its use for these backups. She resolved the power issue by allowing the battery to go completely flat and then fully charged it before restarting the laptop. Seems to be working so far! She also has a new Win10 laptop but much prefers Ubuntu. – SteveH Mar 03 '20 at 09:30