[PATCH] Wipe other file systems when creating new UFS

Robert Millan rmh at freebsd.org
Sat Dec 10 16:46:13 UTC 2011


2011/12/9 Volodymyr Kostyrko <c.kworr at gmail.com>:
> <flame>
> Shouldn't it make us a coffee then? Making precautions against
> shooting-the-foot is a wrong choice for me. This way we need to extend it to
> support any other file system that can repair thyself upon mount in case
> user mistakenly mounted the wrong one.
> </flame>

This suggests you don't agree with the premise that file systems need
to be identifiable. We could argue about this, but note that existing
behaviour is entirely consistent with this premise:

- newfs stores an UFSv2 signature on disk
- fsck checks for this signature and refuses to operate
- newfs checks for UFSv1 signature and makes sure it is cleared out
before creating a new UFSv2
- the kernel checks for UFS signature before attempting to mount a file system

> What about drives that support SSD? Isn't it convenient to use TRIM in such
> cases?

As I'm quite unfamiliar with SSD, I'd rather have someone else answer
that.  My impression, however, is that this improvement would most
likely belong in berase() and be completely orthogonal to my patch.

> You messing up ZFS terminology a bit. Uberblock size is 1k and what you
> refer is ZFS vdev label. Size of vdev label is 256k. There are four vdev
> labels for each vdev - two at the beginning of the vdev and two at the end.

Ah yes, I probably confused the concepts, I was working from memory
and it's been a while since I read the spec.

> All vdev labels are _aligned_ to 256k. So technically this is not just last
> 512k.

I see that you mean.  I guess just aligning down "mediasize" to 256
kiB before using it would suffice?


More information about the freebsd-fs mailing list