Backup Commands in Linux & Unix with Usage and Examples

Backup and Restore linux file system

ext2 ext3 ext4 backup and restore can be easily done with a dump utility which allows you to take full and incremental file system backup. Backup can be taken on a tape , file or a remote system and restore full or selective files

Dump is available at sourceforge.net http://dump.sourceforge.net/

Here are complete steps to get started with complete linux file system backup and restore

1. Install dump package

Dump package contains dump and restore utilities and it also installs tape device package rmt.

[[email protected] ~]# yum install dump

Installed:
dump.x86_64 1:0.4-0.24.b44.fc20

Dependency Installed:
rmt.x86_64 2:1.5.2-9.fc20
Complete!
[[email protected] ~]#

2. Full file system backup

After installation , dump can be used to take a file system backup
In this example we will take full backup /dev/sda9 backup

Numerical argument as 0 is full backup and susquent number represant the incrementatl backup corresponding to full back.

Synatx is : dump – < level number > -f < source filesystem device >

-u Update the file /etc/dumpdates

[[email protected] ~]# /sbin/dump -0u -f /dev/st0 /dev/sda9
DUMP: Date of this level 0 dump: Wed Feb 8 22:10:13 2017
DUMP: Dumping /dev/sda9 (/boot) to /dev/st0

DUMP: Writing 10 Kilobyte records
DUMP: mapping (Pass I) [regular files]

DUMP: Volume 1 started with block 1 at: Wed Feb 8 22:10:13 2017
DUMP: dumping (Pass III) [directories]

DUMP: 122150 blocks (119.29MB) on 1 volume(s)

DUMP: Average transfer rate: 61075 kB/s
DUMP: DUMP IS DONE
[[email protected] ~]#

3. Incremental backup

Numerical argument as 2 is Incremental backup and susquent number represant the incrementatl backup corresponding to full back.

-u updates the /etc/dumpdates files

[[email protected] ~]# /sbin/dump -2u -f /dev/st0 /dev/sda9
DUMP: Date of this level 2 dump: Wed Feb 8 22:14:13 2017
DUMP: Date of last level 1 dump: Wed Feb 8 22:13:06 2017
DUMP: Dumping /dev/sda9 (/boot) to /dev/st0

DUMP: Date of this level 2 dump: Wed Feb 8 22:14:13 2017

DUMP: DUMP IS DONE

4. Backup history

[[email protected] ~]# cat /etc/dumpdates
/dev/sda9 0 Wed Feb 8 22:10:13 2017 -0800
/dev/sda9 1 Wed Feb 8 22:13:06 2017 -0800
/dev/sda9 2 Wed Feb 8 22:14:13 2017 -0800
/dev/sda9 3 Wed Feb 8 22:15:27 2017 -0800
/dev/sda9 4 Wed Feb 8 22:15:43 2017 -0800
/dev/sda9 5 Wed Feb 8 22:15:34 2017 -0800

5. Important Files related to backup

/dev/st0
default tape unit to dump to
/etc/dumpdates
dump date records
/etc/fstab
dump table: file systems
/etc/mtab
dump table: mounted file systems
/etc/group
to find group operator

6. Exit Status

Dump exits with zero status on success. Startup errors are indicated with an exit code of 1; abnormal termination is indicated with an exit code of 3.

NEXT >> Solaris File System Backup using ufsdump

Pages: 1 2 3 4

Leave a Reply

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