LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-06-2024, 04:32 PM   #1
tk3000
Member
 
Registered: Dec 2009
Location: lansing, MI
Distribution: slackware
Posts: 34

Rep: Reputation: 0
Backupt to network share (cifs) issues


Hello Folks,

I am facing some odd and maybe abnormal situation while backup files and directories from ext4 partitions to a smb/cifs network share whose partition is formated with ntfs.

Using rsync:

rsync -rvzhLKH --atimes *--times --exclude={'.cache','.Cache'} /opt/ /mnt/smb/USB_128GB_BACKUP/HP-ProBook_LinuxBox/opt/

=> some times the command preserve the timestamp, more often than not it does not preserve them -– same type of filesystems (ext4 => ntfs/cifs share)

It seems to copy everything (no incremental backup though, it is everything) and at the end it outputs the following:

sent 21.92G bytes *received 1.14M bytes *19.61M bytes/sec
total size is 23.51G *speedup is 1.07
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1336) [sender=3.2
.7]


Upon issue the command “du -BM -c”, at the end, the command outputs about 82GB which non-sense given that /opt only has about 23GB.

On the other hand if I used the following command:

ls -lR | awk '{ sum += $5 } END{ print sum } ' | awk '{print $1 / (1000*1000*1000) *}'

it outputs the right/expected amount: about 23GB.


So, the quandaries: 1) sometimes preserve and other times it does not preserve timestamps; 2) completely out of the wacky output from “du” for the cifs share; 3) no incremental backup (it always copies everything over and over); 4) the warning at the end, “rsync error: some files/attrs were not transferred (see previous errors) (code 23) “ at first does not add up since I did not request to have permissions transferred with the command issued, no --perms or -p parameter (likely it would not work with dissimilar filesystems)

Note: the system used is Slackware64 current.


Note: "rsync --version" return the following:

rsync version 3.2.7 protocol version 31
Copyright (C) 1996-2022 by Andrew Tridgell, Wayne Davison, and others.


Thanks!
 
Old 01-07-2024, 11:13 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,781

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
Quote:
*--times
The error is probably due to the above.

The following might be relevant to your problem. What version of SMB are you using to connect to the share as well as kernel version.

https://www.linuxquestions.org/quest...em-4175672742/
 
Old 01-07-2024, 11:57 AM   #3
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,762

Rep: Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763
#1 rsync is a file and folder synchronization tool, not a backup tool. It has no provision for storing data not preserved by the file systems.
#2 NTFS does not support Unix style file and folder timestamp data. EXT4 (and other Unix style file systems) will not support Microsoft style timestamps. Some utilities try to translate between them, but that is an uncertain kludge at best.

True backup software (like archive utilities) can capture that data AND METADATA intact, but does so to a tape or archive capsule. (Tar does this, for example.)

CIFS/SMB and NFS add another translation layer between, and I never recommend using them for backups if you have a better option.

ZABIX, BACKULA, and other enterprise level backup and recovery tools take care of this and allow direct over network backups from multiple operating systems, but are complex and overkill for the non-enterprise case.

If you are a competent Unix/Linux Admin I recommend doing compressed imaging for quarterly backups, and a burp server for your frequent backups to enable single file or folder restore and point-in-time recovery. (Burp uses rsync libraries to reduce traffic, deduplication at the block level, and compression to reduce storage requirements and speed up incremental backups.) It does require having a spare platform you can dedicate to backup storage use, and familiarity with ssh key base security.
 
Old 01-08-2024, 07:51 AM   #4
tk3000
Member
 
Registered: Dec 2009
Location: lansing, MI
Distribution: slackware
Posts: 34

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
The error is probably due to the above.

The following might be relevant to your problem. What version of SMB are you using to connect to the share as well as kernel version.

https://www.linuxquestions.org/quest...em-4175672742/

The "*" before --times was a typo. I issued the command as state in my first post without the typo and the same issue present itself.

The device hosting the shared drive (flash drive, formated with ntfs) is actually a Nighthawk RAX120V2 router. I would imagine that it is smb2 or smb3.

I will look into the link.

Thanks!
 
Old 01-08-2024, 07:56 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,781

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
Try using --dry-run without the -v option to see if rsync outputs the actual error or redirect output to a file.
 
Old 01-08-2024, 08:02 AM   #6
tk3000
Member
 
Registered: Dec 2009
Location: lansing, MI
Distribution: slackware
Posts: 34

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wpeckham View Post
#1 rsync is a file and folder synchronization tool, not a backup tool. It has no provision for storing data not preserved by the file systems.
#2 NTFS does not support Unix style file and folder timestamp data. EXT4 (and other Unix style file systems) will not support Microsoft style timestamps. Some utilities try to translate between them, but that is an uncertain kludge at best.

True backup software (like archive utilities) can capture that data AND METADATA intact, but does so to a tape or archive capsule. (Tar does this, for example.)

CIFS/SMB and NFS add another translation layer between, and I never recommend using them for backups if you have a better option.

ZABIX, BACKULA, and other enterprise level backup and recovery tools take care of this and allow direct over network backups from multiple operating systems, but are complex and overkill for the non-enterprise case.

If you are a competent Unix/Linux Admin I recommend doing compressed imaging for quarterly backups, and a burp server for your frequent backups to enable single file or folder restore and point-in-time recovery. (Burp uses rsync libraries to reduce traffic, deduplication at the block level, and compression to reduce storage requirements and speed up incremental backups.) It does require having a spare platform you can dedicate to backup storage use, and familiarity with ssh key base security.
Thanks for the insights.

Currently, I am using a powerful router (rav120v2) to host the drive been shared. So, it is very limited in terms of configuration, modification, fine tuning, etc. I also have a dedicate NAS (buffalo), but that also is limited. I was cogitating the use of a real linux box as file server (small computer device with raid and low power consumption), but that is something for the near future.

Imaging whole partition is certainly good idea as well for a full back every few months. Since in my case the /home and /opt (install third party software) are in dedicated partitions that would be easier.

Last edited by tk3000; 01-08-2024 at 08:07 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cifs "mount error 13 = Permission denied" CIFS SUCKS humbletech99 Linux - Networking 45 04-06-2020 05:31 AM
[SOLVED] CIFS share on old WinNT host - smbclient works, mount -t cifs doesn't Electrode Linux - Networking 4 04-19-2012 09:11 AM
manual mount cifs works but srcipt mount cifs has mount error (13): Permission denied CADIT Linux - Newbie 6 11-20-2009 02:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration