Ffs: Difference between revisions

From Hackepedia
Jump to navigationJump to search
No edit summary
Line 17: Line 17:
=== UFS2 ===
=== UFS2 ===


[[FreeBSD]] and [[NetBSD]] have a second version of FFS that allows filesystem sizes greater than 1 TB.  This is UFS2.  The size of an UFS2 inode is 256 bytes and thus UFS1 and UFS2 are not compatible.
[[FreeBSD]] and [[NetBSD]] have a second version of FFS that allows [[filesystem]] sizes greater than 1 TB.  This is UFS2.  The size of an UFS2 inode is 256 bytes and thus UFS1 and UFS2 are not compatible.


=== Soft Updates ===
=== Soft Updates ===

Revision as of 14:33, 27 October 2005

The Berkeley FFS resides on a disk partition in blocks greater or equal to 4096 bytes (no less). It has a super block that contains filesystem specific data (eg. when the last fsck took place) which is at block 0. It also has backup superblocks in case the first superblock is corrupted (fsck -b to repair a broken superblock and check the filesystem with an alternate superblock), the next superblock is at block 32 and the others are made known at newfs time.

# newfs /dev/rsvnd0a
Warning: cylinder groups must have a multiple of 2 cylinders
Warning: 64 sector(s) in last cylinder unallocated
/dev/rsvnd0a:   65536 sectors in 656 cylinders of 1 tracks, 100 sectors
        32.0MB in 3 cyl groups (250 c/g, 12.21MB/g, 3136 i/g)
super-block backups (for fsck -b #) at:
 32, 25032, 50032,

Here in the example the backups are 32, 25032 and 50032. To find out the alternate superblocks after a filesystem has already been created use newfs -N.

Next (not counting the super-blocks) the filesystem is split into 2 parts. One for a long sequence of inodes and the other for data. The inodes are the reference points for objects and data in the filesystem and they hold information such as permissions, file link count, file size, atime, mtime, ctime, disk blocks used by file, chflags, file owner and file group. The size of a UFS1 inode is 128 bytes. By default an inode exists for every 8192 bytes of filesystem space, this is tweakable with newfs.

For more information on FFS see A fast filesystem for UNIX.

UFS2

FreeBSD and NetBSD have a second version of FFS that allows filesystem sizes greater than 1 TB. This is UFS2. The size of an UFS2 inode is 256 bytes and thus UFS1 and UFS2 are not compatible.

Soft Updates

You will want to check out soft-updates if you have ffs, and most likely install it on all partitions except / (example for FreeBSD):

$ less -XF /usr/src/sys/contrib/softupdates/README

To see if you have soft-updates enabled: on FreeBSD:

$ mount 
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad0s1g on /backup (ufs, local, soft-updates)
/dev/ad0s1e on /tmp (ufs, local, soft-updates)
/dev/ad0s1f on /usr (ufs, local, soft-updates)
/dev/ad0s1d on /var (ufs, local, soft-updates)

on OpenBSD

$  mount
/dev/wd0a on / type ffs (local, softdep)
/dev/wd0e on /usr type ffs (NFS exported, local, nodev, softdep)
/dev/wd0d on /var type ffs (local, nodev, nosuid, softdep)
mfs:22707 on /tmp type mfs (asynchronous, local, nodev, nosuid, size=261120 512-blocks)