Little UFS2 FAQ (original) (raw)

Jeroen C. van Gelderen jeroen at vangelderen.org
Wed Apr 23 06:20:46 PDT 2003


Little UFS2 FAQ (20023/04/23), culled from contributions by:

Peter Schultz <peter at jocose.org> "Poul-Henning Kamp" <phk at phk.freebsd.dk> Marcin Dalecki <mdcki at gmx.net> CARTER Anthony <a.carter at cordis.lu> Robert Watson <rwatson at freebsd.org> Terry Lambert <tlambert2 at mindspring.com> Frank van der Linden <fvdl at wasabisystems.com> Manfred Antar <null at pozo.com> Narvi <narvi at haldjas.folklore.ee> Takahashi Yoshihiro <nyan at jp.FreeBSD.org> Alexander Pohoyda <alexander.pohoyda at gmx.net> Bruce Evans <bde at zeta.org.au> "Wilkinson,Alex" <Alex.Wilkinson at dsto.defence.gov.au>

What is UFS1?

The long-time BSD(?) native filesystem.

What is UFS2?

UFS2 is an extension to the well-known UFS. It adds 64 bit block pointers (breaking the 1T barrier), support for extended file storage, and a few other things.

Short summary of changes: o 64-bit pointers up the wazoo (implies that inodes have doubled in size, and now are 256 bytes) o Layout and functional changes to help support variable-size blocks (extent-like allocation) o Extension of various flag fields o Addition of per-inode extended attribute extent o Lazy inode initialization (watch newfs(8) fly)

Apart from these modifications all UFS1 code is being used in UFS2 unchanged.

What is the difference between UFS and FFS?

UFS (and UFS2) define on-disk data layout. FFS sits on top of UFS (1 or 2) and provides directory structure information, etc, etc. This FAQ is about a revision of UFS named UFS2.

What is the rationale for UFS2?

The motivating factor in the layout change was the need for better Extended Attribute (EA) support, and while the developers were at it they figured they'd do a bunch of other useful things too. UFS2 uses the same basic technologies as modern UFS1 (inodes, linear directory layout, soft updates, snapshotting, background file system checking, etc) so it was a relatively low-risk change.

Why did you not add while you were at it?

It would most likely require significant changes whereas the developers wanted to restrict themselves to low-risk modifications only. See previous question.

Which OSes support UFS2?

FreeBSD and NetBSD. (Others?)

What is the UFS2 status on FreeBSD?

As of 2003/04/20, newfs(8) and sysinstall(8) will create UFS2 file systems by default, unless explicitly specified. Users wanting to create UFS1 file systems for whatever reason (interoperability with earlier versions, etc) should be sure to employ the -O1 flag to newfs(8), or hit '1' in the label editor in sysinstall(8) to select UFS1.

What is the UFS2 status on NetBSD?

As of 2003/04/02 UFS2 is not (yet) the default type for FFS filesystems. newfs(8) will create a normal FFS filesystem by default. If you want an UFS2 fileystem, specify "-O 2" as an option.

No additional kernel options are needed for UFS2 support, it's contained within the FFS code.

Please note that older fsck binaries will complain a bit about filesystems if you boot a new kernel, because of some superblock changes. This is harmless. However, if you have 1.6 fsck binaries, they will signal a fatal superblock mismatch with the first alternate, because they compare too many fields (even ones that aren't useful). This is annoying, and I'd advise peole to upgrade their fsck_ffs binary before using a new kernel. 1.6.1 will have an fsck that is forward compatible. Again, none of this signals actual filesystem damage, but it's still annoying.

Does the /boot/loader now understand UFS2 on the root filesystem (i386)?

Yes, modulo the restriction that your root filesystem cannot be larger than 1.5TB. David Schultz et al. proposed a patch to remove this limitation.

Does the /boot/loader now understand UFS2 on the root filesystem (PC98)?

Nope. It is unknown if work is underway to address this.

Is there a UFS to UFS2 conversion tool?

No. You can however dump/restore from UFS to UFS2.

Will "dump" on UFS and "restore" on UFS2 filesystem work?

Yes, that will work.

Does UFS2 dynamically allocate inodes?

No it does not. Inodes are preallocated, but UFS2 lazily initializes them. This mainly means that newfs(8) runs much faster.

Does Grub work with UFS2?

No. Not yet(?).

-- Jeroen C. van Gelderen - jeroen at vangelderen.org

"They accused us of suppressing freedom of expression. This was a lie and we could not let them publish it." -- Nelba Blandon, Nicaraguan Interior Ministry Director of Censorship



More information about the freebsd-current mailing list