Science Fair Projects Ideas - Unix File System

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

Unix File System

(Redirected from UFS2)

UNIX file system (UFS) is a file system used by many unix and Unix-like operating systems. It is derived from the Berkeley Fast File System (FFS), which itself was originally developed from FS in the first versions of UNIX developed at Bell Labs.

Nearly all BSD unix derivatives including FreeBSD, NetBSD, OpenBSD, NeXTStep, and Solaris use a variant of UFS. In Mac OS X it is available as an alternative to HFS. In Linux, partial UFS support is available and the native Linux ext2 filesystem is derived from UFS.

Contents

Implementation and structure

A UFS filesystem is composed of the following parts:

  • a few blocks at the beginning of the partition reserved for boot blocks (which must be initialized separately from the filesystem)
  • a superblock, containing a magic number identifying this as a UFS filesystem, and some other vital numbers describing this filesystem's geometry and statistics and behavioral tuning parameters
  • a collection of cylinder groups; Each cylinder group has the following components:
    • a backup copy of the superblock
    • a cylinder group header, with statistics, free lists, etc, about this cylinder group, similar to those in the superblock
    • a number of inodes, each containing file attributes
    • a number of data blocks

Inodes are numbered sequentially. The first several inodes are reserved for historical reasons, followed by the inode for the root directory.

Directory files contain only the list of filenames in the directory and the inode associated with each file. All file metadata is kept in the inode.

History and evolution

Early versions of unix used a filesystem they referred to simply as FS. FS only included the boot block, superblock, a clump of inodes, and the data blocks. This worked well for the small disks early unixes were designed for, but as technology advanced and disks got larger, moving the head back and forth between the clump of inodes and the data blocks they referred to caused thrashing. BSD optimized this in FFS by inventing cylinder groups, breaking the disk up into smaller chunks, each with its own inode clump and data blocks.

The intent of BSD FFS is to try to localize associated data blocks and metadata in the same cylinder group, and ideally, all of the contents of a directory (both data and metadata for all the files) in the same or near by cylinder group, thus reducing fragmentation caused by scattering a directory's contents over a whole disk.

Some of the performance parameters in the superblock included number of tracks and sectors, disk rotation speed, head speed, and alignment of the sectors between tracks. In a fully optimized system, the head could be moved between close tracks to read scattered sectors off of alternating tracks while waiting for the platter to spin around.

As disks grew larger and larger, sector level optimization became obsolete (especially with disks that used linear sector numbering and variable sectors per track), and fragmented reads became more of a problem. To combat this, BSD increased the filesystem block size from one sector to 8k. This has several effects. The chances of a file's sectors being contiguous is much greater. The amount of overhead to list the file's blocks is reduced. The number of blocks representable in a fixed bit width block number is increased (allowing for larger disks).

With larger block sizes, disks with many small files would waste a lot of space, so BSD added block level fragmentation, where the last partial block of data from several files may be stored in a single "fragment" block instead of multiple mostly empty blocks.

Present and future

Most vendors adapted UFS to their own uses, adding proprietary extensions that may not be recognized by other vendors' versions of unix. Surprisingly, many have continued to use the original block size and data field widths as the original UFS, so some degree of (read) compatibility remains across platforms.

FreeBSD 5.0 introduced UFS2, which adds support for volumes over 1TB in size. It has since been ported to NetBSD.

Linux has the ext2 file system which was rewritten from scratch based on concepts from UFS. Ext2 supports setting block size at filesystem initialization to allow for larger disks, and 64 bit data fields in the inode to allow for larger files. Ext3 adds journaling. Linux includes a UFS implementation for binary compatibility at the read level with other unices, but since there is no standard implementation for the vendor extensions to UFS, linux does not have full support for writing to UFS.

As of Solaris 7, Sun Microsystems included UFS Logging in the Solaris Operating Environment, which brought filesystem journaling to UFS. Solaris UFS also has extensions for large files and large disks and other features.

References

  • Little UFS2 FAQ
  • Unix System V documentation
  • Man pages from multiple flavors of unix
  • /usr/include/sys/fs/ufs_inode.h and other include files from multiple flavors of unix

See also

External links

  • McKusick, 2002. Running "fsck" in the Background html pdf file
12-03-2008 10:22:39
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice