Some files are 0KB large after moving them from one dataset to another

Obi-Wan

Dabbler
Joined
Dec 28, 2018
Messages
17
Hi!

I have my FreeNAS system up and running and I'm working on setting it up properly. When I tried moving some files from one dataset to another today, some of the files were suddenly 0KB in size, making them useless.

They weren't critical files in any way, but this raised a few flags. Did I do something wrong? Is there something wrong with my system?
  • I have is a single pool with two datasets, A and B.
  • Each dataset is shared through an SMB share.
  • From my Windows computer I can access the shares by writing \\ip.of.my.nas in the address bar of Explorer.
  • The two shares then show up as two folders
  • I can then open share A, cut some files from there, and open share B and paste them there.

This is what I did today, but I noticed afterwards that some of the files now have size zero.

Have I done something obviously wrong here? Should I not move files this way?

Also, if relevant:
  • I ran memtest for several days before I started using the system
  • All SMART tests indicate everything is fine
  • The files are listed as 0KB in the FreeNAS shell, not just in Windows Explorer
  • This specific Windows computer that I used is connected to the network using wi-fi

I'm still new to FreeNAS so I appreciate any and all insights!

Edit1: Adding my hardware specs
Motherboard:
Supermicro X11SSM-F
CPU: Intel Pentium G4560
Memory: Samsung DDR4-2400 16 GB ECC
PSU: Corsair RM650X v2
Case: Fractal Design Node 804
System disk: Crucial BX500 120 GB
Current storage disks: 2x WD Red 4 TB (mirrored)
 
Last edited:
Joined
Jan 4, 2014
Messages
1,644
Let's start with the details of your FreeNAS hardware and configuration. Also, have a read of the Forum Guidelines. It contains useful tips for newer members.
 

Obi-Wan

Dabbler
Joined
Dec 28, 2018
Messages
17
Thank you! I should probably add my build to my signature!

My build consists of:
Motherboard: Supermicro X11SSM-F
CPU: Intel Pentium G4560
Memory: Samsung DDR4-2400 16 GB ECC
PSU: Corsair RM650X v2
Case: Fractal Design Node 804
System disk: Crucial BX500 120 GB
Current storage disks: 2x WD Red 4 TB (mirrored)

I'm running FreeNAS-11.2-RELEASE-U1.


Also, I will add that the files that are now 0 in size are not important to me. But the reason for building this NAS was to create a secure place to store all my data, if I don't somewhat understand what went wrong in this case, then I don't feel that confindent in the NAS and that ruins the whole point somewhat.
 
Last edited:
Joined
Jan 4, 2014
Messages
1,644
There are several things to try first to isolate the source of the problem:
  1. Try a different Windows client. Repeat the test. If the issue disappears, you have an issue with the original Windows client to resolve.
  2. Bypass the wireless network. Retest with a wired connection. If the problem disappears, then you have a wireless issue to resolve.
  3. Update to the current version of FreeNAS 11.2-U2.1. There are plenty of bug fixes that have been implemented since U1. Try an extended copy from one dataset to another. Does the problem recur?
Edit: I've placed the update of the FreeNAS OS as the last thing to try based on @Heracles comments below.
 
Last edited:

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hey Obi-Wan,

Before going to 11.2-U2, I would take snapshots of everything before. Many people lost their data in that upgrade and only those with snapshots were able to recover them by cloning and promoting the snapshots.

As for testing how to migrate a file between shares from Windows, I dropped Windows about 10 years ago because it has always be so unreliable (or was so reliable at being chaotic...). From what you described, I am pretty sure the problem is in the Windows side. You can try to share over a different protocols like WebDav (windows can map them), using a different tools like FileZilla for FTP / SFTP, etc.

But on that one, my feeling points clearly to Windows as the culprit...
 

Obi-Wan

Dabbler
Joined
Dec 28, 2018
Messages
17
Thanks guys!

I'm going to try and see If I can reproduce the issue with a copy of some similar files. If I'm able to do so I will try a different Windows client, wired connection and perhaps boot Ubuntu from a USB and give that a go. I will try using some other tool instead of plain Explorer as well.

And I will definetly take some snapshots before upgrading now, thanks!
 
Joined
Dec 2, 2015
Messages
730
And I will definetly take some snapshots before upgrading now, thanks!
It may be wise to detach the pool(s) using the GUI before upgrading, and import them again after the upgrade has completed.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Hi!

I have my FreeNAS system up and running and I'm working on setting it up properly. When I tried moving some files from one dataset to another today, some of the files were suddenly 0KB in size, making them useless.

They weren't critical files in any way, but this raised a few flags. Did I do something wrong? Is there something wrong with my system?
  • I have is a single pool with two datasets, A and B.
  • Each dataset is shared through an SMB share.
  • From my Windows computer I can access the shares by writing \\IP.of.my.nas in the address bar of Explorer.
  • The two shares then show up as two folders
  • I can then open share A, cut some files from there, and open share B and paste them there.

This is what I did today, but I noticed afterwards that some of the files now have size zero.

Have I done something obviously wrong here? Should I not move files this way?

Also, if relevant:
  • I ran memtest for several days before I started using the system
  • All SMART tests indicate everything is fine
  • The files are listed as 0KB in the FreeNAS shell, not just in Windows Explorer
  • This specific Windows computer that I used is connected to the network using wi-fi

I'm still new to FreeNAS so I appreciate any and all insights!

Edit1: Adding my hardware specs
Motherboard:
Supermicro X11SSM-F
CPU: Intel Pentium G4560
Memory: Samsung DDR4-2400 16 GB ECC
PSU: Corsair RM650X v2
Case: Fractal Design Node 804
System disk: Crucial BX500 120 GB
Current storage disks: 2x WD Red 4 TB (mirrored)
What is the reason behind moving the file from Dataset A to Dataset B?
If you SSH into Freenas, you can use "mc" as in Midnight Commander and move the files that way. Or if you need to just move them into a new dataset becasue of the name or because you want to change the dataset and pool structure, you can just use the "zfs rename" command.
Best to use SSH with "screen" as not to interrupt transfers already started.
 
Last edited:

Obi-Wan

Dabbler
Joined
Dec 28, 2018
Messages
17
Thanks everyone!

I've tried moving files around the same way as before, but no "luck" in reproducing the issue yet. I was thinking that in order to isolate and understand what went wrong I would have to be able to do it again, now after trying to make it happen it just seems more like I must have been doing something else, or there must have been something about those specific files. I will keep at it!

There was nothing particular about the files that are now gone, just video files of different sizes and formats. There were other files with the same formats of larger and smaller size, that were not affected.
 

Obi-Wan

Dabbler
Joined
Dec 28, 2018
Messages
17
What is the reason behind moving the file from Dataset A to Dataset B?
If you SSH into Freenas, you can use "mc" as in Midnight Commander and move the files that way. Or if you need to just move them into a new dataset becasue of the name or because you want to change the dataset and pool structure, you can just use the "zfs rename" command.
Best to use SSH with "screen" as not to interrupt transfers already started.

I'm working on setting up the datasets and the structure that I want and I was really just experimenting. I want to have a dataset for my Plex media and was moving files into that dataset among other things. I realize I should probably use SSH and ensure the files are being moved locally and not transfered to my Windows client first, as I suspect is the case when copying between two separate shares in Windows.

I will ask a somewhat related question. Is is safer, data integrity-wise, to use SSH when transfering data from a client to the server? I.e., is there a smaller chance of data being corrupted or destroyed compared to using Explorer to copy the files from some local folder to the share?


I have been copying files like crazy, just like I did that one time when some of the files got corrupted, but have not had a similar issue yet. Since I had several files go corrupt that one time this leads me to thing there must have been something particular happening that one time, and that it is not something generally wrong. Still, I have no idea what that might have been.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
If the files you want to move or copy are already on the server, but in a different location, it will be much better to perform the operation within Freenas as opposed to using Windows or other file explorer over the network.
I think, when you request a file to be moved within a SMB share, the request is sent to Freenas to handle the move so the file doesn't get downloaded and then uploaded to the server. Corruption will be covered by ZFS.

On the other hand, if you are moving files from one share to another, then Freenas will not know about it and the file will be downloaded then uploaded. Because the file will be traveling on the LAN ( there are error checking in place I believe to catch corrupted data) . When the file is in RAM on your local machine, there is no errors correction (unless you have a PC with ECC RAM).

The reason for 0KB file should not be due to data corruption, at least not on Freenas (ZFS) side , but most likely caused by some permission issue or loss of connectivity during the copy or move process.

If all you want is to relocate datasets, you can do that with a ZFS command.
If you still want to copy or move the files, I recommand you use "screen" under CLI over SSH (being connected to your Freenas box through SSH and in a CLI terminal run the "screen" command.
The best solution to the file transfer is through the use of "mc" "Midnight Commander".
 
Top