November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Backup and Restore Files in Red Hat / CentOS 7

This procedure is to backup XFS-based file systems in Red Hat Enterprise Linux 7.x
             

Backing up a file system (/etc)

1. To backup the /etc/ filessystem to a file called “/tmp/mybackup”, issue the following command:

# cd /tmp

# xfsdump -0f mybackup   /dev/mapper/rhel-root -s etc

where:

-f: do the dump to the file “mybackup”

-0: do full backup (1 means incremental)

-s: backup the etc subtree from the filesystem /dev/mapper/rhel-root

 

Restoring the file system (/etc/)

1. To list all the created dumps with detailed information:

# xfsrestore -I

2. To restore a particular dump:

# xfsrestore –f mybackup /tmp

where:

-f: restore from the file “mybackup”

 

Interactive Restore

1. This exercise enables you to navigate through the backup file “mybackup”, and allows you to restore selected files instead of perfuming a full restore:

# cd /tmp

# xfsrestore –if mybackup /tmp

2. Once you get the restore prompt, you may ls and cd commands to navigate and list the files inside the backup file.

3. Select the files you want to restore by using the add command:

# add yum.conf

4. Once the selection is complete, write extract to restore the selected files.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>