Advice for hacking on ufs/ffs

Oliver Fromme olli at
Fri Jul 28 09:27:55 UTC 2006

Rick C. Petty wrote:
 > Dag-Erling Smørgrav wrote:
 > > Rick C. Petty wrote:
 > > > Shane Adams wrote:
 > > > > I used dd to create 1G file.
 > > > A faster way is:
 > > >     touch filename
 > > >     truncate -s 1g filename
 > > 
 > > no, this will result in a fragmented image, which will hurt run-time
 > > performance.


 > Not necessarily.  If you install a variant of windoze, the installer will
 > format the disk first, writing zeros (and metadata) sequentially, and
 > thus the allocation will not be fragmented.

Not true.  Last time I installed Windows, it did not
overwrite the whole disk.  If it did that, it would
have taken _way_ too long (hours instead of minutes).

 > In the case of UFS newfs
 > only the metadata will be written for each cylinder group

No.  Only the superblock copies and block bitmaps are
written during newfs, nothing else.

 > and thus the
 > logical blocks for all metadata will be contiguous.

Nope.  As soon as you start writing to such a file system,
it will start allocating space for inodes, indirect block
lists, directories and file data, which will probably lead
to massive fragmentation.

Best regards

Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD:
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

With Perl you can manipulate text, interact with programs, talk over
networks, drive Web pages, perform arbitrary precision arithmetic,
and write programs that look like Snoopy swearing.

More information about the freebsd-fs mailing list