loop device with sparse file on NTFS over Samba
I'm trying to backup my linux server to a remote computer - but the remote computer is running windows. So I set up a sparse file on an NTFS drive, built and ext3 filesystem on it, and mount it as a loop device over samba. It appears to work - it gives no errors and lets me add and delete files and folder. But after unmounting and remounting the device, most often it reverts back to the way it was right after mounting it the last time - new files created are not there, and files that were deleted are still there.
Does anyone have any idea what is going on? Is there something that I need to flush when I unmount? To mount and unmount I use the following code:
mount -t smbfs //RemoteWindowsMachine/RemoteFolder /mnt/backupsamba
losetup /dev/loop0 /mnt/backupsamba/BackupExt2.img
mount -t ext3 /dev/loop0 /mnt/remotebackup
losetup -d /dev/loop0
Thanks for the advice . . . any more?
Thanks for the advice. I had created the file in a similar manner - I did it on the windows machine using cygwin. I made a sparse file, however - so maybe there's some conflict there. I formatted it using mke2fs.
I tried using cifs, but I get the same results - I can mount it, add files, delete file, but then when I unmount and remount, some of the files are gone, and some that should be gone because I deleted them are still there ???
Anyone have any idea what's up?