Tested on an Ubuntu 20.04 live USB previously prepared with gparted and unetbootin.
I have zero affiliation with FreeFileSync. I just figured out how to use it to back up data from a nonbootable MacBook is all, after mounting the AFPS Apple Filesystem with https://github.com/linux-apfs/linux-apfs-rw, and I'm just documenting this for posterity's sake.
Can I install it directly into an Ubuntu Live USB, after you boot it and click the "Try Ubuntu" option?
Yes. Here is how to install FreeFileSync onto the live USB:
First, prepare the live USB.
- Gparted steps [rough idea--these instructions are not perfectly step-by-step for a beginner]: on your main Ubuntu computer, open gparted. Click your USB drive from the dropdown menu in the top-right. Click Device -> Create Partition Table. WARNING, CONTINUING WITH THIS WILL ERASE ALL CONTENTS ON THE DEVICE. Be sure to choose the correct device, and only proceed if you are okay erasing everything on it. Choose the "msdos" option and continue. Now click the device and put a
fat32
partition onto the whole thing. Click the green checkmark to apply it.
- Unetbootin [rough idea--these instructions are not perfectly step-by-step for a beginner]: install unetbootin with
sudo apt update && sudo apt install unetbootin
. Download the latest version of Ubuntu here https://ubuntu.com/download/desktop, and use Unetbootin to put that .iso file onto the drive you just prepared above.
Boot and install FreeFileSync
Boot onto the drive and click "Try Ubuntu". Then, connect to the internet. Next, do these steps in the terminal:
# Ensure you are in a "writeable" dir. Cd to your home dir, which is writeable:
cd ~
# Open the Firefox browser and go here: https://freefilesync.org/download.php
# Find the Linux download link. Use it in this command:
# Download FreeFileSync:
wget https://freefilesync.org/download/FreeFileSync_12.2_Linux.tar.gz
# Extract it; this gives you "FreeFileSync_12.2_Install.run". If you get errors
# when you run this step, see the troubleshooting section below.
tar -xf FreeFileSync_12.2_Linux.tar.gz
# Run the installer
./FreeFileSync_12.2_Install.run
# press `y` to accept the license agreement
# Press `1` to toggle until "Install for all users" says "YES"
# Optionally, press `3` to toggle until "Create desktop shortcuts" says "YES"
# Press Enter to continue and install.
# Done.
# Run FreeFileSync as `sudo`, to be able to copy anything, since you're on a
# liveusb after-all. If you run withOUT `sudo`, it may not be able to open or
# access the files you are trying to copy to or from anyway.
sudo freefilesync
That's it!
Troubleshooting
On multiple occasions when testing the above steps, I saw the following error when running the tar -xf
command:
ubuntu@ubuntu:~$ tar -xf FreeFileSync_12.2_Linux.tar.gz
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
If you see this problem, you likely have a corrupted .tar.gz image and need to run the wget
command to download FreeFileSync again. Once you run the wget
command again, you can compare the new file against the old file by looking at the old and new sizes and sha256sum
s as follows. If they differ, it confirms that the original file was corrupted:
# download the file again
wget https://freefilesync.org/download/FreeFileSync_12.2_Linux_NEW.tar.gz
# compare sizes
ls -alF FreeFileSync_12.2_Linux.tar.gz # old
ls -alF FreeFileSync_12.2_Linux_NEW.tar.gz # new
# compare sha256sums
sha256sum FreeFileSync_12.2_Linux.tar.gz # old
sha256sum FreeFileSync_12.2_Linux_NEW.tar.gz # new
Donation version: parallel (multi-threaded) comparing and copying
I discovered over the last couple days that if you donate to FreeFileSync to download the donation version, you get a benefit I've found to be really useful: multi-threaded parallel comparison and copying. I think it's worth giving a few dollars for this feature. Once you install the donation edition, click on the gear settings icon next to the "Compare" button, and edit the "Parallel file operations" box to set the number of threads it will use to 1~2x the number of cores you have. Ex: I might set it to 8 threads if my computer has 4 or 6 cores. FreeFileSync mentions parallel operations here: https://freefilesync.org/manual.php?topic=performance. Even though the setting is under the "Compare" gear settings, it affects and speeds up copying/syncing too.
See also
- My answer on how to copy data with FreeFileSync and
rsync
: SuperUser: Convert NTFS partition to ext4 - How to copy the data?
Other things to try
- Use mkusb to get a live USB with persistence, so you don't have to re-install FreeFileSync every time you reboot: https://calvin.me/create-persistent-ubuntu-16-04-live-usb-even-boots-ram/
- Boot the live USB to RAM too, to significantly improve its run-time performance! See the "Extra: Boot the Live USB to RAM" section at the end of the article.