Pardon my insistence (and my long post), but I'm trying to understand.
I'm doing some tests with rsnapshot, so I configured the
/opt/etc/rsnapshot.conf like this (removing unnecessary lines):
Code: Select all
# All snapshots will be stored under this root directory.
snapshot_root /opt/var/rsnapshot/
# LOCALHOST
backup /share/Public/script/ localhost/
So the only data that I'm backing up is the folder
script under the
Public share. I put 3 text files (File1.txt, File2.txt and File3.txt) into that folder.
Then I run 2 times rsnapshot:
Code: Select all
[/] # rsnapshot hourly
[/] # rsnapshot hourly
[/] # ls -l /opt/var/rsnapshot/
drwxr-xr-x 3 admin administ 4096 May 26 19:07 hourly.0/
drwxr-xr-x 3 admin administ 4096 May 26 19:08 hourly.1/
OK, that's right. Now I want to mount this folder in read-only mode under the
Backup dir of the
Public folder (another time I've tried also not saving it under Public, but the results are the same!). So I follow your tips:
Code: Select all
[/] # mkdir /share/Public/Backup
[/] # ls -l /share/Public/
drwxr-xr-x 2 admin administ 4096 May 26 19:11 Backup/
[/] # /bin/mount --bind /opt/var/rsnapshot /share/Public/Backup
[/] # /bin/mount -o remount,ro /share/Public/Backup
[/] # mount | grep Backup
/share/HDA_DATA/.qpkg/Optware/var/rsnapshot on /share/HDA_DATA/Public/Backup type none (ro,bind)
Right, the folder is mounted read-only. Now I can try to delete any file under SSH also by root and it (correctly) doesn't work:
Code: Select all
[/] # rm -f /share/Public/Backup/hourly.0/localhost/share/Public/script/File1.txt
rm: unable to remove `/share/Public/Backup/hourly.0/localhost/share/Public/script/File2.txt': Read-only file system
OK, now I go to the Windows computer (but I think that a Linux with Samba will be the same) and browse the
Public/Backup share.
This is the folder tree:
Code: Select all
\\QNAP\Public\Backup.
├───hourly.0
│ └───localhost
│ └───share
│ └───Public
│ └───script
│ └───File1.txt
│ └───File2.txt
│ └───File3.txt
└───hourly.1
└───localhost
└───share
└───Public
└───script
└───File1.txt
└───File2.txt
└───File3.txt
Now the problem raises:
- If I try to delete the hourly.0 folder, the system won't (OK)
- If I try to delete the localhost folder inside hourly.0, the system won't (OK)
- If I try to delete the share folder inside hourly.0/localhost, the system won't (OK)
- If I try to delete the Public folder inside hourly.0/localhost/share, the system don't delete the folder (OK) but it removes all the files and the script subfolder (NOOO!)
- If I try to delete, for example, File2.txt inside hourly.1/localhost/share/Public/script the file is erased (NOOO!)
I know that I bother you so much, but if you could try to reproduce this behaviour on your TS-239 I will thank you a lot.
I don't think I'm missing anything... maybe it's a bug on Samba?