Ubuntu – backup /home folder on different drive through LiveUSB

backupboothard drive

I have two hard disks: sda & sdb. Ubuntu and all programs are installed in sda, and I use sdb to store my files; sdb is half-full.

I’m currently trying to solve a booting problem. The only way into the system is through a LiveUSB, from which I can view both sdX drives.

Before I do anything radical or stupid, I wonder whether I could use the backup tool in LiveUSB to backup my system into the sdb drive. Of course, I can sudo copy the entire /home folder to the other drive, but that won’t be much help when I’m finally able to boot or in case I finally decide to reinstall Ubuntu from scratch and need to recover my old settings.

Could anyone here help in this?

Best Answer

The backup tool in the live disk is not complete. It's tricky to install all the necessary components to get the backup working properly. You could simpler backup your /home folder with the cp command.

You can do this by, first mount your destination backup device (which may already be mounted since it's your /dev/sdb device.

Create a backup area for your destination and perform one of these two commands:

$ sudo cp -pvau ~/ /mnt/backupdir/

In the preceding command the /mnt/backupdir is the backup destination directory where you will be backing up your space. It will create a folder by the your username in the /mnt/backupdir folder.

This space could have been created on a partition off your /dev/sdb drive.

Alternatively you could backup your whole '/home` folder with this command:

$ sudo cp -pvau /home /mnt/backupdir/

This command would result in a folder called /mnt/backupdir/home with your personal home folder under there.

The copy arguments are:

p - preserve ownership and time stamps
v - give a verbose output during the process
a - archive (perform a recursive copy of all files and folders)
u - update files that have changed if they already exist in the destination.

You said you were concerned about during something "radical" which could loose your personal data.

Installing or reinstalling Ubuntu will not touch your /home folder or any other folders that you created on your installed partition unless you specifically elect the format option during the installation process. As long as you don't put a check mark in format your personal data will be preserved.

It's important to always have backups of your important data. But the install process will advise you that your data will be erased and not recoverable if you select to format. Also if you don't checkmark the format option, it'll still advise you which directorys (the system folders) that will be erased and recreated.

Related Question