Step By Step Guide To Backup Ext2, Ext3, or Ext4 File Systems in Linux

You should always backup your data whether you are using Linux, Windows or any other distros. Well, In this tutorial, we will guide you to backup Ext2, Ext3 or Ext4 file systems in Linux.

How To Backup Ext2, Ext3, or Ext4 File Systems in Linux

We will take the help of backup tool to backup filesystem in Linux.

Install Dump Command in Linux

The Dump tool is available on the Linux repository. The Dump tool can backup, record or restore the data in Linux. You can also partially backup files on Linux. Run the following command to install dump tool in Linux. Following command is applicable if you are using Ubuntu or debian based distros.

sudo apt-get install dump

For RedHat and Fedora Linux user, Run the following command to install dump.

sudo yum install dump

For Arch Linux users, Run the following command to install dump on Arch system

sudo pacman -S dump

For SuSE Linux users, Run the following command to install dump on SuSE Linux

sudo zypper install dump

Now, run the following command to backup disk in Linux.

Command to take the backup of sda1

sudo dump -0uf /mybackup_directoryname/sda1.dump /dev/sda1

Command to take the backup of sda2

sudo dump -0uf /mybackup_directoryname/sda2.dump /dev/sda2

Command to take the backup of sda3

sudo dump -0uf /mybackup_directoryname/sda3.dump /dev/sda3

This will take the backup of /boot file system on Linux
udo dump -0f /mybackup_directoryname/boot.0 /boot

Command to take the partial backup of Linux file systems using dump tool.

sudo dump -0f /mybackup_directoryname/configurations.dump /etc/default /etc/network

How To Restore the File Systems From Backup In Linux

Run the following command to restore the file systems from the backup file in Linux.

sudo restore -xf /mybackup_directoryname/configurations.dump

 

Summary: Let us know if you have any other methods to take the backup in Linux.

Leave a comment

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