Hi ,all the situation is that: when I upload a big file to share folder in samba and during the transmission I want to make snapshot for the share folder. So I have to stop the samba service to make the snapshot. After I stop samba service, the transmission is stopped but the file that is not transferred completely is still in the share folder. so I want to know how to delete the file that is not transferred completely after I stop the transmission to make snapshot. Thanks Best Regards Chaojie Xiao
On Mon, Mar 14, 2011 at 10:14:04PM -0400, Chaojie.Xiao at emc.com wrote:> Hi ,all > > the situation is that: when I upload a big file to share folder in samba and during the transmission I want to make snapshot for the share folder. > > So I have to stop the samba service to make the snapshot. After I stop samba service, the transmission is stopped but the file that is not transferred completely is still in the share folder. > > so I want to know how to delete the file that is not transferred completely after I stop the transmission to make snapshot.What exactly are you trying to achieve ? What kind of snapshots are you using, and why do you have to stop Samba to do this ? Sounds like you might need a custom VFS module to communicate with your snapshot service ? Jeremy.
I am currently using lvm snapshot. if I am uploading a big file to samba share folder and during the transmission I want to make a snapshot with lvcreate for the volume where share folder is. If I make snapshot when file is still transferred it might exist some issue because the file is not complete. So I want to know is there any method to delete the file that is being transferred if I want to make a snapshot. On Mon, Mar 14, 2011 at 10:14:04PM -0400, Chaojie.Xiao at emc.com wrote:> Hi ,all > > the situation is that: when I upload a big file to share folder in samba and during the transmission I want to make snapshot for the share folder. > > So I have to stop the samba service to make the snapshot. After I stop samba service, the transmission is stopped but the file that is not transferred completely is still in the share folder. > > so I want to know how to delete the file that is not transferred completely after I stop the transmission to make snapshot.What exactly are you trying to achieve ? What kind of snapshots are you using, and why do you have to stop Samba to do this ? Sounds like you might need a custom VFS module to communicate with your snapshot service ? Jeremy.
On Mon, Mar 14, 2011 at 10:48:33PM -0400, Chaojie.Xiao at emc.com wrote:> I am currently using lvm snapshot. if I am uploading a big > file to samba share folder and during the transmission I > want to make a snapshot with lvcreate for the volume where > share folder is. > > If I make snapshot when file is still transferred it might > exist some issue because the file is not complete. > > So I want to know is there any method to delete the file > that is being transferred if I want to make a snapshot.In the latest not yet released versions we have added the option "log writeable files on exit = yes/no". This logs all files that have been open for writing when an smbd exits unexpectedly for some reason. With that option you will at least know which files have been in that situation and take care of them properly. You can find the corresponding patch at http://git.samba.org/?p=samba.git;a=commitdiff;h=b2f45f20 Please be aware that just shutting down Samba will lead to corrupt files. We added that message for administrators who want to be informed about those potentially corrupt files. Volker -- SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen
So there is no method to delete the file that is beging transferred if I shutdown the samba service or just close specific share folder with smbcontrol. Right? On Mon, Mar 14, 2011 at 10:48:33PM -0400, Chaojie.Xiao at emc.com wrote:> I am currently using lvm snapshot. if I am uploading a big > file to samba share folder and during the transmission I > want to make a snapshot with lvcreate for the volume where > share folder is. > > If I make snapshot when file is still transferred it might > exist some issue because the file is not complete. > > So I want to know is there any method to delete the file > that is being transferred if I want to make a snapshot.In the latest not yet released versions we have added the option "log writeable files on exit = yes/no". This logs all files that have been open for writing when an smbd exits unexpectedly for some reason. With that option you will at least know which files have been in that situation and take care of them properly. You can find the corresponding patch at http://git.samba.org/?p=samba.git;a=commitdiff;h=b2f45f20 Please be aware that just shutting down Samba will lead to corrupt files. We added that message for administrators who want to be informed about those potentially corrupt files. Volker -- SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen
On Tue, Mar 15, 2011 at 09:31:50PM -0400, Chaojie.Xiao at emc.com wrote:> So there is no method to delete the file that is beging > transferred if I shutdown the samba service or just close > specific share folder with smbcontrol. Right?Correct. Samba does not really know what state such a file is in. It might be that someone is trying to transfer a huge file with a flaky connection, transferring remaining bytes after a reconnect. In this case deleting those files would be the wrong thing. With best regards, Volker Lendecke -- SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen