Freebsd – Can fsck on ufs cause data loss

filesystemsfreebsdfsck

I'm on FreeBSD8. I have a problem with a partition. I can't mount it. It says "Operation not permitted."

I run fsck -t ufs /dev/da0p1. After it finish the operation, I can mount it successfully. But there is no any data in the partition now. I don't know if it had some data or not.

Q: run fsck on unmounted partition. Can it cause data loss? and if yes, is there a way to recover it?

edit: I run only fsck -t ufs /dev/da0p1. No -y or -n and when it ran, it printed Phase1,2,3,4,… and finish successfully. There is no prompt along the way.

Best Answer

It depends on what you said "yes" to. Without knowing a lot more about your filesystem, what was on it, and what it displayed and asked while fsck'ing, it will be very hard to answer usefully.

The short answer is yes, it can remove data. It tries very hard not to by putting stuff it finds in lost+found on that drive, but it is recovering from a filesystem which is apparently corrupted. In other words, when you're dealing with FS corruption, anything may be lost.