1

I have the problem, that I want to save backups to a NAS. Unfortunately the NAS is only avalable as CIFS network share (plus root SSH access). I do not want to modify anything in the configuration there as the NAS is also used by my collegues; thus I have to work mainly on my machine.

Using any *nix backup solution leads to the problem, that the CIFS does not allow *nix user/group information and file permissions. I now created a sparse file (via CIFS), a ext4 filesystem inside it and mounted it. Now I can use rsnapshot to create my backups sending the data to the (sparse) file, no problem so far.

The problem arises if I run the backup multiple times. Each time a (more or less) small bit of information is written. As far as I guess the ext4 inside the file allocates the sectors to be written "randomly". I mean that the fs will not try to reuse the blocks as much as possible. As soon as a new block gets used, the sparse file gets enlarged. But the old, now unused block does not get freed. So the file grows with every backup until the maximal size is reached.

Then clearly quite some free space might be there but the benefit of a sparse file is lost: The file requires the complete space on the NAS, even though only a part would be sufficient.

I have read of a possibility using TRIM, but I would guess that this is only possible if I could tell the host file system (on the NAS), that a special block was no more used. So I am looking for a fs that does a minimal new sector allocation.

If you have any better idea, please feel free to state your opinion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.