Michael Tokarev
2022-Feb-12 19:27 UTC
[Samba] Windows User Profile corruption on a member server
12.02.2022 13:16, Michael Tokarev via samba wrote: .. I did some experiments here with user profiles. And it turned out the prob is quite severe. Lots of files, when copied from the samba server to windows10 machine, gets truncated. Small files can be truncated by a few bytes, larger files loses some blocks (the resulting size is usually dividable by 20480). Out of 104 total files in a freshly created win10 user profile, 40 gets corrupt. This is a huge number, this is 40% corruption ratio, it is not some random very rare event. And this is independent on the user presence in /etc/passwd - the same (similar, since it is different each time) corruption happens if the user in question exists as local linux user or not. There are no errors reported on either side. With this corruption samba is definitely not usable as a file server, at all. Any idea where to go from here? (samba is 4.13.13+dfsg-1~deb11u2, current on debian bullseye system). Thanks, /mjt
Michael Tokarev
2022-Feb-12 21:31 UTC
[Samba] Windows User Profile corruption on a member server
12.02.2022 22:27, Michael Tokarev via samba wrote: ... So I tried to debug this further. And it seems this has nothing to do with samba per se, it is some problem with windows. Maybe samba is somehow related to this too, but not within its file operations which are done exactly as windows client asked it. What I see here is that windows, while copying a user profile from the (samba) server (when this profile didn't exist), first creates small portion of each file, something in chunks of 20480 bytes. Yes it reads these 20480 bytes from samba and samba happily does what it was asked. So win populates whole thing with these small portions of each file, and immediately starts the user GUI. But neither the wallpaper nor the StartMenu links are complete at this time, and lots of other files too. But it continues to syncronize this profile "in the background", writing all data (including these first 20480 bytes) this time (and ofc. asking samba to read all the data this time).. I don't know where it stops (and it stops before completing), but the end result is still the same - lots of profile files become incomplete/corrupt. Regular file copy works fine from both samba and windows PoV. Only the profile sync is this awful, so far. So far I only observed this strange behavor when using a linux server joined to the AD domain (hence the subject). But I remember seeing something similar before with our previous setup too, - very very rarely. I dunno what the difference is, - the server is actually the same (just a new container on the same hardware, with similar settings). On the client we use Windows 10 LTSC 1809 with current updates. I'll probably install some over version of Win10 to see if it behaves differently. The whole thing is.. just terrible :) Thanks, /mjt
Jeremy Allison
2022-Feb-13 04:59 UTC
[Samba] Windows User Profile corruption on a member server
On Sat, Feb 12, 2022 at 10:27:11PM +0300, Michael Tokarev via samba wrote:>12.02.2022 13:16, Michael Tokarev via samba wrote: >.. > >I did some experiments here with user profiles. And it turned out >the prob is quite severe. Lots of files, when copied from the samba >server to windows10 machine, gets truncated. Small files can be truncated >by a few bytes, larger files loses some blocks (the resulting size is usually >dividable by 20480). Out of 104 total files in a freshly created win10 >user profile, 40 gets corrupt. This is a huge number, this is 40% corruption >ratio, it is not some random very rare event. > >And this is independent on the user presence in /etc/passwd - the same >(similar, since it is different each time) corruption happens if the user >in question exists as local linux user or not. > >There are no errors reported on either side. > >With this corruption samba is definitely not usable as a file server, at all. > >Any idea where to go from here? > >(samba is 4.13.13+dfsg-1~deb11u2, current on debian bullseye system).Is it possible that it is this bug ? https://bugzilla.samba.org/show_bug.cgi?id=14928 Fixed in latest 4.15.x, 4.14.x.