UFS losing all data on USB hard disk after reboot

Hello,

i'm running FreeBSD 14.2 RELEASE.
Recently i replaced my 500 GB HD with a 1 TB HD using the same USB case.
I created a new UFS partition and new mountpoint /hd with 2 subdirectories
/share1 and /share2 and chmod 777 both of them.
These 2 directories were configured as Samba shares.
The new partition was added to /etc/fstab
/dev/da0p1 /hd ufs rw 2 2
Then i placed some files into /hd/share1.

After a reboot all files and folders were gone and the HD was empty, except for .snap.
I then remade those 2 shares, rebooted and again the directories were gone.
This happened several times. I decided to let the machine run over night and tried
the next day with no additional changes made.
Strangely this time the 2 folders stayed even after several reboots.

Can somebody explain what happened here? I just don't want to lose data again.
 
I created a new UFS partition and new mountpoint /hd with 2 subdirectories
/share1 and /share2 and chmod 777 both of them.
These 2 directories were configured as Samba shares.
The new partition was added to /etc/fstab
/dev/da0p1 /hd ufs rw 2 2
Then i placed some files into /hd/share1.
Did you actually mount the filesystem before copying files?
 
Ops. I was very tired that day. Maybe that was the point and i forgot to mount the filesystem.
But it happened again after a reboot and the fstab entry should have automounted it the 2nd time.
 
I'm using ssh so i can't see any messages after the "reboot" command.
Where can i find those, dmesg? Sorry i'm not a pro.

As reported, today the filesystem mounts without any problem.
Is it possible that the SMR hard disk is causing sync/buffer problems?
My previous hard disk was using CMR recording.
 
I don't know about SMR disk, but what you get is typically the kind of problem you might have with UFS if the shutdown isn't clean (like a power outage). Yes, look at the dmesg ouput, this can provide some clues, but the "All buffers synced" never appears there.

I was thinking to a kernel panic at shutdown.

If you changed the disk, you have access to the machine, so try a reboot and stay in front of it.
 
Emrion The machine is running in headless mode and it would be quite some work to connect it to a monitor.
I'll keep in mind the syncing at shutdown if the problem reoccurs.

cracauer@ I copied the files from a Windows machine to the Samba share.
 
Hello,

i'm running FreeBSD 14.2 RELEASE.
Recently i replaced my 500 GB HD with a 1 TB HD using the same USB case.
I created a new UFS partition and new mountpoint /hd with 2 subdirectories
/share1 and /share2 and chmod 777 both of them.
These 2 directories were configured as Samba shares.
The new partition was added to /etc/fstab
/dev/da0p1 /hd ufs rw 2 2
Then i placed some files into /hd/share1.

After a reboot all files and folders were gone and the HD was empty, except for .snap.
I then remade those 2 shares, rebooted and again the directories were gone.
This happened several times. I decided to let the machine run over night and tried
the next day with no additional changes made.
Strangely this time the 2 folders stayed even after several reboots.

Can somebody explain what happened here? I just don't want to lose data again.
A little off topic, but…

I had the same problems with RAID 1 geom stuff and USB disks. It was inconsistent, but the geom tooling would “succeed” at writing the disk meta data, but never actually write the buffer complete. Somehow I got the disk to write completely once and was able to use two USBs as a raid drive for like a day, but saw the same problem where files wouldn't finish writing.

No problems with normal SATA disks. I am 100% convinced it’s data buffering and flushing issues. Would like to figure out a solution as USB flash disks as RAID is a great solution to cheap replace-able storage devices (imho).

Also running FreeBSD 14.1
 
granowski I never read anything positive about USB and RAID. Maybe the only solution worth considering would be a hardware RAID case with USB connection.

I really love those new SMR drives. Can recommend WD. *sarcasm off*

1.png
 
granowski I never read anything positive about USB and RAID. Maybe the only solution worth considering would be a hardware RAID case with USB connection.

I really love those new SMR drives. Can recommend WD. *sarcasm off*

View attachment 21516
I actually do have an OWC mercury pro hardware raid with a usb connection. Love it. I am trying to solve a different problem. However, usb external hardware raid is amazingly fast for redundant backup that is useable.
 
Back
Top