Linux 101 : Backing up and restoring a filesystem

Before backing up a filesystem, we will need to make sure that it is healthy by using the below command:

After checking our filesystem, we need to "unmout" its partition:

If we can't "unmout" our partition, we could back it up - dump it - while its it not used by a lot of processes/users to avoid having corrupted copies:

Below is a short description of the above parameters:
  • 0 : means a full backup
  • u : it means that the file "/etc/dumpdates" will be updated after a successful backup.
  • f : orders the "dump" command to "dump" the backup to a file.

The backup file has to be on a different partition than the one we are backing up.

To restore our filesystem, we first create a fresh partition, we mount it and we "cd" into it:


Leave as a comment: