#752 Issue closed: BACKUP_URL=cifs:// does not work because it uses noatime option

Labels: bug, support / question, fixed / solved / done

DamienGombaultRecia opened issue at 2016-01-08 11:13:

Hi.

I try to use BACKUP_URL=cifs:// but it fails because noatime option does not exist for cifs protocol.
Tested with CentOS 7.2 (up to date).

ERROR: Mount command 'mount -v -o rw,noatime,guest //xxx/xxx/tmp /tmp/rear.Q89mvOdrDdmhh0F/outputfs' failed.
Aborting due to an error, check /var/log/rear/rear-localhost.log for details

In /var/log/message :

Jan  8 12:10:12 localhost kernel: CIFS: Unknown mount option "noatime"
Jan  8 12:10:12 localhost rear[20257]: ERROR: Mount command 'mount -v -o rw,noatime,guest //xxx/xxx/tmp /tmp/rear.Q89mvOdrDdmhh0F/outputfs' failed.

noatime is set in file :
lib/global-functions.sh:108: local defaultoptions="rw,noatime"

noatime should not be used with CIFS protocol.

gdha commented at 2016-01-09 12:46:

You should define (see man page of rear):

       BACKUP_URL=cifs://
           To backup to a Samba share (CIFS), use BACKUP_URL=cifs://cifs-server-name/share/path. To provide
           credentials for CIFS mounting use a /etc/rear/.cifs credentials file and define
           BACKUP_OPTIONS="cred=/etc/rear/.cifs" and pass along:

               username=_username_
               password=_secret password_
               domain=_domain_

You got that error, because of the guest if-section in lib/global-functions.sh. If you would leave the noatime away you would have an issue with permissions.

DamienGombaultRecia commented at 2016-01-09 13:11:

If I manually mount my (anonymous) CIFS mountpoint with
mount -v -o rw,guest //xxx/xxx/tmp /mnt (without noatime)
it works.

If I try to mount it with noatime (rear defaults), it fails because it is not supported by CIFS :
localhost kernel: CIFS: Unknown mount option "noatime"

gdha commented at 2016-01-09 15:19:

@DamienGombaultRecia And you want to mount as guest on purpose?

DamienGombaultRecia commented at 2016-01-09 15:36:

Yes, I mount it as guest on purpose.
I will test with a login/password protected CIFS mount point.
I think the guest option does not matter, it just tell the CIFS utils that there is no password.
But I think to noatime option will cause the same problem.

gdha commented at 2016-01-11 08:48:

@DamienGombaultRecia If you use BACKUP_OPTIONS then you won't be using noatime option unless you add it in there.
However, I agree with you about noatime option: it doesn't seem to be a valid option for cifs (anymore?).

DamienGombaultRecia commented at 2016-01-11 09:22:

I have set BACKUP_OPTIONS="guest" and it works, thank you (I thought BACKUP_OPTIONS was appended to defaultoptions (not replaced)).
However I think the noatime should not be used as a default at least for CIFS.

gdha commented at 2016-01-11 09:41:

@DamienGombaultRecia You said "However I think the noatime should be be used as a default at least for CIFS" - is this correct? I thought not would be better?

DamienGombaultRecia commented at 2016-01-11 09:51:

I fixed my comment.


[Export of Github issue for rear/rear.]