{"id":233,"date":"2021-07-23T12:26:06","date_gmt":"2021-07-23T12:26:06","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/how-to-resolve-cifs-mounted-backup-drive-permissions-errors\/"},"modified":"2021-07-23T12:26:06","modified_gmt":"2021-07-23T12:26:06","slug":"how-to-resolve-cifs-mounted-backup-drive-permissions-errors","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/how-to-resolve-cifs-mounted-backup-drive-permissions-errors\/","title":{"rendered":"How to Resolve CIFS-mounted Backup Drive Permissions Errors"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\">\n<div id=\"versioned-article-header\">\n<p class=\"valid-version-info\"><em>Valid for versions 82 through the latest version<\/em><\/p>\n<\/div>\n<div id=\"version-select-group\" aria-label=\"select versions\">\n<h4>Version:<\/h4>\n<h4>82<\/h4>\n<\/div><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<p>When you attempt to perform a backup to a Common Internet File System (CIFS)-mounted drive, you may receive errors that resemble the following example:<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">\/bin\/cp: failed to preserve ownership <span style=\"color:#66d9ef\">for<\/span> <span style=\"color:#e6db74\">`<\/span><span style=\"color:#e6db74\">': Permission denied \/bin\/cp: failed to preserve ownership for `'<\/span>: Permission denied<\/code><\/pre>\n<\/div>\n<p>These <code>Permission denied<\/code> errors may result from missing extended attributes on the CIFS-mounted drive.<\/p>\n<div class=\"callout callout-cpanel\">\n<div class=\"callout-heading\">More:<\/div>\n<div class=\"callout-content\">\n<p>For more information about CIFS, read our Backup Configuration documentation.<\/p>\n<\/p><\/div>\n<\/div>\n<h2 id=\"resolve-the-error\">Resolve the error<\/h2>\n<p>To resolve the permission denied errors for the CIFS-mounted drive, perform the following steps:<\/p>\n<ol>\n<li>\n<p>Edit the <code>\/etc\/fstab<\/code> file so that the CIFS-mounted drive uses the <code>user_xattr<\/code> option. This will resemble the following example:<\/p>\n<\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">4\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\">    <span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">dev<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">mapper<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">centos_centos<\/span><span style=\"color:#f92672\">--<\/span><span style=\"color:#ae81ff\">7<\/span><span style=\"color:#f92672\">--<\/span><span style=\"color:#a6e22e\">clone<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#a6e22e\">root<\/span> <span style=\"color:#f92672\">\/<\/span>                       <span style=\"color:#a6e22e\">xfs<\/span>     <span style=\"color:#a6e22e\">defaults<\/span>        <span style=\"color:#ae81ff\">1<\/span> <span style=\"color:#ae81ff\">1<\/span>\n    <span style=\"color:#a6e22e\">UUID<\/span>=<span style=\"color:#ae81ff\">01<\/span><span style=\"color:#a6e22e\">c6e08e<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#a6e22e\">bbd1<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">4046<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#a6e22e\">af48<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#a6e22e\">beaf233746d4<\/span> <span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">boot<\/span>                   <span style=\"color:#a6e22e\">xfs<\/span>     <span style=\"color:#a6e22e\">defaults<\/span>        <span style=\"color:#ae81ff\">1<\/span> <span style=\"color:#ae81ff\">2<\/span>\n    <span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">dev<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">mapper<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">centos_centos<\/span><span style=\"color:#f92672\">--<\/span><span style=\"color:#ae81ff\">7<\/span><span style=\"color:#f92672\">--<\/span><span style=\"color:#a6e22e\">clone<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#a6e22e\">swap<\/span> <span style=\"color:#a6e22e\">swap<\/span>                    <span style=\"color:#a6e22e\">swap<\/span>    <span style=\"color:#a6e22e\">defaults<\/span>        <span style=\"color:#ae81ff\">0<\/span> <span style=\"color:#ae81ff\">0<\/span>\n    <span style=\"color:#f92672\">\/\/<\/span><span style=\"color:#ae81ff\">192.0.2.0<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">mybackup<\/span> <span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">backup<\/span> <span style=\"color:#a6e22e\">cifs<\/span> <span style=\"color:#a6e22e\">user<\/span>,<span style=\"color:#a6e22e\">uid<\/span>=<span style=\"color:#ae81ff\">500<\/span>,<span style=\"color:#a6e22e\">rw<\/span>,<span style=\"color:#a6e22e\">suid<\/span>,<span style=\"color:#a6e22e\">credentials<\/span>=<span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">root<\/span><span style=\"color:#f92672\">\/<\/span>.<span style=\"color:#a6e22e\">cifs<\/span>,<span style=\"color:#a6e22e\">user_xattr<\/span> <span style=\"color:#ae81ff\">0<\/span> <span style=\"color:#ae81ff\">0<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<p>In this example, line 4 displays the CIFS-mounted drive entry.<\/p>\n<ul>\n<li>The local user owns the mounted files.<\/li>\n<li>The CIFS drive\u2019s access credentials reside in the <code>\/root\/.cifs<\/code> file.\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>We <strong>strongly<\/strong> recommend that you store your CIFS-mounted drive\u2019s access credentials in a separate, secure file.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Run the <code>remount mount<\/code> command to remount the CIFS-mounted drive.<\/p>\n<\/li>\n<li>\n<p>Run the <code>lsattr \/CIFS_mount<\/code> command to add the extended attributes.<\/p>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>The mount does <strong>not<\/strong> support extended attributes if the <code>lsattr \/CIFS_mount<\/code> command returns the following error:<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">Error means not available: lsattr: Inappropriate ioctl <span style=\"color:#66d9ef\">for<\/span> device While reading flags on ...<\/code><\/pre>\n<\/div><\/div>\n<\/div>\n<\/li>\n<\/ol><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Valid for versions 82 through the latest version Version: 82 Overview When you attempt to perform a backup to a Common Internet File System (CIFS)-mounted drive, you may receive errors that resemble the following example: \/bin\/cp: failed to preserve ownership for `&#8217;: Permission denied \/bin\/cp: failed to preserve ownership for `&#8217;: Permission denied These Permission &hellip;<\/p>\n","protected":false},"author":1,"featured_media":234,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/233"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=233"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/233\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/234"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}