{"id":7574,"date":"2018-06-16T10:00:12","date_gmt":"2018-06-16T02:00:12","guid":{"rendered":"http:\/\/rmohan.com\/?p=7574"},"modified":"2018-06-16T10:00:12","modified_gmt":"2018-06-16T02:00:12","slug":"backup-and-restore-files-in-red-hat-centos-7","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7574","title":{"rendered":"Backup and Restore Files in Red Hat \/ CentOS 7"},"content":{"rendered":"<section>\n<article>This procedure is to backup XFS-based file systems in <em>Red Hat Enterprise Linux 7.x<br \/>\n<\/em><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><br \/>\n<span id=\"more-548\"><\/span><br \/>\n<strong>Backing up a file system (\/etc)<\/strong><\/p>\n<p>1. To backup the \/etc\/ filessystem to a file called \u201c\/tmp\/mybackup\u201d, issue the following command:<\/p>\n<p># cd \/tmp<\/p>\n<p># xfsdump -0f mybackup\u00a0\u00a0 \/dev\/mapper\/rhel-root -s etc<\/p>\n<p><em>where:<\/em><\/p>\n<p><em>-f: do the dump to the file \u201cmybackup\u201d<\/em><\/p>\n<p><em>-0: do full backup (1 means incremental)<\/em><\/p>\n<p><em>-s: backup the etc subtree from the filesystem \/dev\/mapper\/rhel-root<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Restoring the file system (\/etc\/)<\/strong><\/p>\n<p>1. To list all the created dumps with detailed information:<\/p>\n<p># xfsrestore -I<\/p>\n<p>2. To restore a particular dump:<\/p>\n<p># xfsrestore \u2013f mybackup \/tmp<\/p>\n<p><em>where:<\/em><\/p>\n<p><em>-f: restore from the file \u201cmybackup\u201d<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Interactive Restore<\/strong><\/p>\n<p>1. This exercise enables you to navigate through the backup file \u201cmybackup\u201d, and allows you to restore selected files instead of perfuming a full restore:<\/p>\n<p># cd \/tmp<\/p>\n<p># xfsrestore \u2013if mybackup \/tmp<\/p>\n<p>2. Once you get the restore prompt, you may ls and cd commands to navigate and list the files inside the backup file.<\/p>\n<p>3. Select the files you want to restore by using the add command:<\/p>\n<p># add yum.conf<\/p>\n<p>4. Once the selection is complete, write extract to restore the selected files.<\/p>\n<\/article>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p> This procedure is to backup XFS-based file systems in Red Hat Enterprise Linux 7.x Backing up a file system (\/etc)<\/p>\n<p>1. To backup the \/etc\/ filessystem to a file called \u201c\/tmp\/mybackup\u201d, issue the following command:<\/p>\n<p># cd \/tmp<\/p>\n<p># xfsdump -0f mybackup \/dev\/mapper\/rhel-root -s etc<\/p>\n<p>where:<\/p>\n<p>-f: do the dump to the file \u201cmybackup\u201d<\/p>\n<p> [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7574"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7574"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7574\/revisions"}],"predecessor-version":[{"id":7575,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7574\/revisions\/7575"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}