Perform backups for the Linux operating system

This question asked again and again by a new Linux sys admins:

How do I perform backups for my Linux operating system?

So I am putting up all necessary information you ever need to know about backup. The main aim is to provide you necessary software, links and commands to get started as soon as possible.

Backup is essential

First a backup is essential. You need a good backup strategy to:

  • Minimize time from disaster such as server failure or human error (file deleted) or acts of God
  • To avoid downtime
  • Save money and time
  • And ultimately to save your job 😉

A backup must provide

  • Restoration of a single/individual files
  • Restoration of file systems

What to backup?

  • User files and dynamic data [databases] (stored in /home or specially configured partitions or /var etc).
  • Application software (stored in /usr)
  • OS files
  • Application configuration files (stored in /etc, /usr/local/etc or /home/user/.dotfiles)

Different types of backups

  • Full backups: Each file and directory is written to backup media
  • Incremental backups (Full + Incremental backup): This backups are used in conjunction with full backup. These backups will be incremental if each original piece of backed up information is stored only once , and then successive backups only contain the information that changed since the previous one. It use file’s modification time to determine which file need to backup.

So when you restore incremental backup:

  1. First restore the last full backup
  2. Next every subsequent incremental backup you need to restore

Preferred Backup Media

  1. Tape (old and trusted method)
  2. Network (ftp, nas, rsync etc)
  3. Disk (hard disk, optical disk etc)

Test backups

Please note that whichever backup media you choose, you need to test your backup. Perform tests to make sure that data can be read from media.

Backup Recommendation

My years of experience show that if you follow following formulas you are most likely to get back your data in worst scenario:
(a) Rotate backup media
(b) Use multiple backup media for same data such as ftp and tape
(c) Keep old copies of backups offsite

In short create good disaster recovery plan.

General procedure to restore a Linux/UNIX box

There is not golden rule or procedure but I follow these two methods:

Method # 1: Reinstall everything, restore everything, and secure everything

Use this method (bare metal recovery) if your server is cracked or hacked or hard drive is totally out of order:

  1. Format everything
  2. Reinstall os
  3. Configure data partitions (if any)
  4. Install drivers
  5. Restore data from backup media
  6. Configure security

Method # 2: Use of recovery CD/DVD rom

Use this method if your box is not hacked and system cannot boot or MBR damaged or accidental file deletion etc:

  1. Boot into rescue mode.
  2. Debug (or troubleshoot) the problem
  3. Verify that disk partitions stable enough (use fsck) to put backup data
  4. Install drivers
  5. Restore data from backup media
  6. Configure security

Linux (and other UNIX oses) backup tools

Luckily Linux/UNIX provides good set of tools for backup. We have almost covered each and every tool mentioned below. Just follow the link to get more information about each command and its usage:

It is also recommended that you use RAID or LVM (see consistent backup with LVM) or combination of both to increase reliability of data.

A note about MySQL or Oracle database backup

Backing up database server such as MySQL or Oracle needs more planning. Generally you can apply a table write lock and use mysql database dump utility to backup database. You can also use LVM volume to save database data.

A note about large scale backup

As I said earlier tar is good if you need to backup small amount of data that does not demands high CPU or I/O. Following are recommended tools for backup that demands high CPU or I/O rate:

(a) amandaAMANDA, the Advanced Maryland Automatic Network Disk Archiver, is a backup system (open source software) that allows the administrator to set up a single master backup server to back up multiple hosts over network to tape drives/changers or disks or optical media.

(b) Third party commercial proprietary solutions:
Top three excellent commercial solutions:

If you are looking to perform the tasks of protecting large-scale computer systems use above solutions and following two books will give you good idea:

Recommended further readings

I hope this small how to provide enough information to anyone to kick start your backup operation. Tell me if I am missing something or if you have a better backup solution or strategy, please comment back.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 15 comments so far... add one

CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
15 comments… add one
  • Mhrd Sep 3, 2017 @ 22:21

    Hey guy’s
    Thanks for perfect and practical articles.
    I have a question
    As you mentioned im exactly a new linux sys admin. A brave one😀

    The action of back-up is just copy the imported files at the first and restore it back in satisfying situation??
    Generally We just copy and restore them??

  • ansar Jun 30, 2012 @ 13:24


    I am facing the problem with redhat linux 5. I am using two redhat. One for main server and other one is backup server, End of the day i used to take backup from main server to backup server by using command ” rsync -av . by using this command datas are getting backup as incrimental . But when i delete any file from main server then i run this rsync command it is not updating with backup server.
    So my requirement is any data has been deleted from server it should synchronize and delete that particular file from backup server too

    Please any one can help me out……..

  • kunal vaidya Jun 18, 2012 @ 8:38

    Hi Vivek,

    I have a question for you since i am struggling to find a detailed answer of this.
    As in windws various backup types can be explained on the basis of archive bit, similarly on what basis we generate incremental backups in Linux. Second how can we restore incremental backup (Lets say you have created incremental backup using tar -g options), need this with example.
    And can we have differential backup in Linux?

  • deelipkumar yadav May 2, 2012 @ 5:56

    how to take a backup of os in linux help me

  • Alessio Feb 26, 2012 @ 3:56

    I have been googleing the net for a week. I need a GUI based program with a box that displays a “backup all” option 🙂

    Come on, guys. I have second drive and wich to backup my linux on my primary drive to it.

    How do I back it all up¿

  • Soni Peterson Dec 22, 2011 @ 8:54

    I need some help in taking backup of system video drivers as well as to create exxact replica machine

  • Purnima Jul 27, 2011 @ 21:10


    I need some help in doing Backup/Restore of the OS Settings and System Configuration. How should i do back up for that in Linux,please guide me are there
    any links available for Backup of OS Setting and system configuration for Linux,please let me know ASAP.

  • Ramakrishna May 17, 2011 @ 7:36


    This is Ramakrishna, Really your backup article is so pretty. we are improving our technical backup skills by following your articles. really these are awesome ones..
    can you provide any additional backup opensource softwares and methods in linux(Redhat) / Unix (solaris 10).

    with best regards

  • kiran kumar D.S Mar 30, 2010 @ 4:41

    hi this is kiran,i have a query of how to restore a file which is permanently deleted in ubuntu 9.04.plz answer my question in the nearest time.bye

  • Jeff Kayser Nov 12, 2009 @ 18:23

    I was researching Linux backups, and discovered that although dump/restore (and it’s variants) are good backup programs for UNIX, they are NOT good backup programs for Linux. So says Linus Torvalds:

  • Ravindra Lawand Mar 19, 2009 @ 4:07

    I have a query, how can we take back up in Red Hat Linux by attaching tape drives to it, means
    by which command we mount drive and then by which command backup will be stored in that tape,
    kindly suggest..

  • Deepu Oct 12, 2007 @ 10:07

    Many thanks for remembering us with some of the useful steps to be undertaken before taking backup.
    Also i would like to mention about another backup tool – “MondoRescue”. For me it worked fine – easy backup, recovery, etc. Its even available for the 64 bit machines..

  • artiomix Aug 2, 2007 @ 21:20

    Nice one! Thanks! I recommend to use Unix ‘dump’ and ‘restore’ utilities for entire filesystem backup.

  • Wondwossen Jul 10, 2007 @ 7:02

    My name is Wondwossen , I am from Ethiopia , Africa .I am a system admin at a state bank.I really liked what you have preseted here. It has really helped me a lot. Thank for your effort keep it up

    • George Fleites Apr 29, 2011 @ 4:15

      This is a very good information about how important backups are, now that I know all that what should I do?
      Type “Backup my server to the USB drive” at the console?
      Thank you, George

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @