Files saved to USB have size 0.

..need I say that this is a disaster? To put it mildly? The good news is that it's very likely that the files I'm looking for are also (almost certainly) saved elsewhere. But still, absolutely truly nasty. I no longer have BSD on any of my laptops. ..I -have- been planing on putting it back on, using an alternate tutorial. This.. this, justifiably, freaks me out. What could cause this? No, I haven't searched anywhere else to see if others have had this problem. So this is almost just a straight-up rant. Something of this magnitude shouldn't be a problem. You shouldn't be able to -get- software that does this kind of thing. This is BSD. You're better than this.
 
Did you orderly remove the USB drive, after the files where copied and before removing it from the slot? Either on the command line using umount(8), or on any kind of DE, ejected the USB drive (similar like on Windows remove safely)?

In case not (or don’t know), the file system on the USB may be not consistent. In case it is UFS, run fsck(8) over it, and perhaps the data appears. Depending on the device identifier of the UFS volume the actual command may be: # fsck -fy /dev/da0pX. Replace X by the actual partition ID.
 
Did you orderly remove the USB drive, after the files where copied and before removing it from the slot? Either on the command line using umount(8), or on any kind of DE, ejected the USB drive (similar like on Windows remove safely)?

In case not (or don’t know), the file system on the USB maybe not consistent. In case it is UFS, run fsck(8) over it, and perhaps the data appears. Depending on the device identifier of the UFS volume the actual command may be: # fsck -fy /dev/da0pX. Replace X by the actual partition ID.

Many thanks for your response. I'm assuming your instructions (# fsck -fy /dev/da0pX) are for bsd, not ubuntu (which I'm currently using). I "wrote" this usb months ago. Long enough that I have no memory exactly what I did. I had a lot of trouble at the time, so this is really not that surprising. (..did I really just say that?.. ..hehe..) All that to say, I really can't give you more information until I decide to give bsd another try. That might be this year, it's possible. Until then, this post is here.. maybe it's presence will improve the universe in some way.. :) So ya, I've since found the file I was looking for on my other computer. I'm massively multiply backed up. (..wisdom bought with blood..)
 
Last edited:
The operating system isn't too relevant for this issue: properly unmounting an external device before unplugging it is mandatory on any OS. Sometimes, filesystems on external devices are mounted for synchronous operation (Windows is doing that, on *nix systems you can typically add the sync mount option to get the same behavior) in order to make data loss by forgetting to unmount unlikely. But this is no guarantee either, and it has a drawback: With every operation sent to the device "immediately", the I/O load is greatly increased (and even the device might be forced to do write cycles that could be avoided otherwise).
 
So, please begin by explaining what you did. Right now we only know "USB" and "file size 0". We don't know what kind of storage device it is (USB can be anything from a little memory stick to a big disk drive). We don't know what file system you use. We don't know how you mounted it. We don't know whether you correctly unmounted it before disconnecting it. We don't know how you wrote the data.

I can create lots of scenarios where the result you see is absolutely correct, and working as intended. In most of those scenarios, the user or sys admin did the wrong thing. So please give us more information, then we can perhaps help you diagnose what went wrong, and how to do better in the future.
 
Back
Top