Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

System Administration Guide: Devices and File Systems
Previous Next

What's New in File Systems?

This section describes new file system features in the Solaris Solaris Express release.

For a complete listing of new Solaris features and a description of Solaris releases, see Solaris Express Developer Edition What’s New.

File System Monitoring Tool (fsstat)

Solaris Express 4/06: A new file system monitoring tool, fsstat, is available to report file system operations. You can use several options to report activity, such as by mount point or by file system type.

For example, the following fsstat command displays all ZFS file system operations since the ZFS module was loaded:

$ fsstat zfs
 new  name   name  attr  attr lookup rddir  read read  write write
 file remov  chng   get   set    ops   ops   ops bytes   ops bytes
 268K  145K 93.6K 28.0M 71.1K   186M 2.74M 12.9M 56.2G 1.61M 9.46G zfs

For example, the following fsstat command displays all file system operations since the /export/ws file system mounted.

$ fsstat /export/ws
new  name   name  attr  attr lookup rddir  read read  write write
file remov  chng   get   set    ops   ops   ops bytes   ops bytes
   0     0     0 18.1K     0  12.6M    52     0     0     0     0 /export/ws

The default form is to report statistical information in easy to understand values, such as Gbytes, Kbytes, and Mbytes.

For more information, see fsstat(1M).

Solaris ZFS File System

Solaris Express 12/05: ZFS, a revolutionary new file system, provides simple administration, transactional semantics, end-to-end data integrity, and immense scalability. In addition, ZFS provides the following administration features:

  • Backup and restore capabilities

  • Device management support

  • GUI administration tool

  • Persistent snapshots and cloning features

  • Quotas that can be set for file systems

  • RBAC-based access control

  • Storage pool space reservations for file systems

  • Support for Solaris systems that have zones installed

You can set up both ZFS and UFS file systems on the same Solaris system. However, you cannot use ZFS as a root file system. For information about additional limitations when using ZFS, see The ZFS File System in Solaris Express Developer Edition What’s New.

For more information about using ZFS, see ZFS Administration Guide.

Enhancements to UFS File System Utilities (fsck, mkfs, and newfs)

Solaris Express 12/05: The file system check utility, fsck, has been enhanced to include features from the FreeBSD 4.9 version of the fsck program, as well as other enhancements.

The fsck utility in this Solaris release includes the following improvements:

  • Checks and repairs file systems more thoroughly and provides improved error messages. For example, in some scenarios, fsck determines what structures are missing and replaces them appropriately.

  • Automatically searches for backup superblocks.

  • Reports when fsck needs to be rerun.

  • When clearing directories, fsck now attempts to recover directory contents immediately and therefore, reduces the time spent rerunning this utility.

  • If fsck finds duplicate blocks, and not all files that reference the duplicate blocks were cleared, fsck reports the inode numbers at the end of the fsck run. Then, you can use the find command to review the inodes that are damaged.

  • Improved error messages regarding the status of extended attributes and other special files, such as device files and ACL entries, are included.

  • Includes a -v option to enable more verbose messages.

In addition, the newfs and mkfs commands have been updated to include new options for displaying a file system's superblock information in text or dumping the superblock information in binary format.

newfs [ -S or -B ] /dev/rdsk/...
-S

Displays the file system's superblock in text

-B

Dumps the file system's superblock in binary

mkfs [ -o calcsb or -o calcbinsb ] /dev/rdsk/... size
-o calcsb

Displays the file system's superblock in text

-o calcbinsb

Dumps the file system's superblock in binary

The fsck utility uses this superblock information to search for backup superblocks.

The following sections describe specific fsck enhancements and their corresponding error messages. For step-by-step instructions on using the fsck utility to repair a damaged superblock, see How to Restore a Bad Superblock ( Solaris Express Release).

Automatic Search for Backup Superblocks

The following fsck error message examples illustrate the automatic backup superblock discovery feature.


Caution - If a file system has a damaged superblock and it was created with newfs or mkfs customized parameters, such as ntrack or nsect, using fsck's automatically discovered superblock for the repair process could damage your file system.

In the case of a file system that was created with customized parameters and it has a bad superblock, fsck provides the prompt to cancel the fsck session:

CANCEL FILESYSTEM CHECK?

  • If the file system was created with the newfs command and fsck responds that just the primary superblocks are corrupted, then consider letting fsck restore the superblock.

    # fsck /dev/dsk/c1t2d0s0
    ** /dev/rdsk/c1t2d0s0
    BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED
    
    LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? no
    
    
    LOOK FOR ALTERNATE SUPERBLOCKS WITH NEWFS? yes
    
    FOUND ALTERNATE SUPERBLOCK 32 WITH NEWFS
    
    USE ALTERNATE SUPERBLOCK? yes
    
    FOUND ALTERNATE SUPERBLOCK AT 32 USING NEWFS
    If filesystem was created with manually-specified geometry, using
    auto-discovered superblock may result in irrecoverable damage to
    filesystem and user data.
    
    CANCEL FILESYSTEM CHECK? no
    
    ** Last Mounted on
    ** Phase 1 - Check Blocks and Sizes
    ** Phase 2 - Check Pathnames
    ** Phase 3a - Check Connectivity
    ** Phase 3b - Verify Shadows/ACLs
    ** Phase 4 - Check Reference Counts
    ** Phase 5 - Check Cylinder Groups
    CORRECT GLOBAL SUMMARY
    SALVAGE? y
    
    
    UPDATE STANDARD SUPERBLOCK? y
    
    81 files, 3609 used, 244678 free (6 frags, 30584 blocks, 0.0% 
    fragmentation)
    
    ***** FILE SYSTEM WAS MODIFIED *****
  • If the file system was created with the mkfs command and fsck responds that just the primary superblocks are corrupted, then consider letting fsck restore the superblock.

    # fsck /dev/dsk/c1t2d0s0
    ** /dev/rdsk/c1t2d0s0
    BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED
    
    LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? yes
    
    FOUND ALTERNATE SUPERBLOCK 32 WITH MKFS
    
    USE ALTERNATE SUPERBLOCK? yes
    
    FOUND ALTERNATE SUPERBLOCK AT 32 USING MKFS
    If filesystem was created with manually-specified geometry, using
    auto-discovered superblock may result in irrecoverable damage to
    filesystem and user data.
    
    CANCEL FILESYSTEM CHECK? no
    
    ** Last Mounted on
    ** Phase 1 - Check Blocks and Sizes
    ** Phase 2 - Check Pathnames
    ** Phase 3a - Check Connectivity
    ** Phase 3b - Verify Shadows/ACLs
    ** Phase 4 - Check Reference Counts
    ** Phase 5 - Check Cylinder Groups
    CORRECT GLOBAL SUMMARY
    SALVAGE? y
    
    
    UPDATE STANDARD SUPERBLOCK? y
    
    81 files, 3609 used, 243605 free (117 frags, 30436 blocks, 0.0% 
    fragmentation)
    
    ***** FILE SYSTEM WAS MODIFIED *****

The following example illustrates what would happen if you specified fsck's -y option in a damaged superblock scenario. You are automatically dropped out of the fsck session. A message is displayed to rerun it with the alternate superblock.

# fsck -y /dev/dsk/c1t2d0s0
# 
** /dev/rdsk/c1t2d0s0
BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED

LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS?  yes


LOOK FOR ALTERNATE SUPERBLOCKS WITH NEWFS?  yes

SEARCH FOR ALTERNATE SUPERBLOCKS FAILED.

USE GENERIC SUPERBLOCK FROM MKFS?  yes

CALCULATED GENERIC SUPERBLOCK WITH MKFS
If filesystem was created with manually-specified geometry, using
auto-discovered superblock may result in irrecoverable damage to
filesystem and user data.

CANCEL FILESYSTEM CHECK?  yes

Please verify that the indicated block contains a proper
superblock for the filesystem (see fsdb(1M)).

FSCK was running in YES mode.  If you wish to run in that mode using
the alternate superblock, run `fsck -y -o b=453920 /dev/rdsk/c1t2d0s0'.

The following fsck error message scenario illustrates the new prompts for the backup superblock, but the fsck run is not canceled, in this example. Canceling the fsck session would be an appropriate response if this file system was created with customized parameters or if there is some other concern about running fsck on this file system.

The various superblock error conditions are provided in italics as follows:

# fsck /dev/rdsk/c0t1d0s0

** /dev/rdsk/c0t1d0s0

BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED
BAD SUPERBLOCK AT BLOCK 16: NUMBER OF DATA BLOCKS OUT OF RANGE
BAD SUPERBLOCK AT BLOCK 16: INODES PER GROUP OUT OF RANGE
BAD SUPERBLOCK AT BLOCK 16: MAGIC NUMBER WRONG
BAD SUPERBLOCK AT BLOCK 16: BAD VALUES IN SUPER BLOCK
BAD SUPERBLOCK AT BLOCK 16: NCG OUT OF RANGE
BAD SUPERBLOCK AT BLOCK 16: CPG OUT OF RANGE
BAD SUPERBLOCK AT BLOCK 16: NCYL IS INCONSISTENT WITH NCG*CPG
BAD SUPERBLOCK AT BLOCK 16: SIZE OUT OF RANGE
BAD SUPERBLOCK AT BLOCK 16: NUMBER OF DIRECTORIES OUT OF RANGE
BAD SUPERBLOCK AT BLOCK 16: ROTATIONAL POSITION TABLE SIZE OUT OF RANGE
BAD SUPERBLOCK AT BLOCK 16: SIZE OF CYLINDER GROUP SUMMARY AREA WRONG
BAD SUPERBLOCK AT BLOCK 16: INOPB NONSENSICAL RELATIVE TO BSIZE

LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? yes

FOUND ALTERNATE SUPERBLOCK 32 WITH MKFS

USE ALTERNATE SUPERBLOCK? yes

FOUND ALTERNATE SUPERBLOCK AT 32 USING MKFS
If filesystem was created with manually-specified geometry, using
auto-discovered superblock may result in irrecoverable damage to
filesystem and user data.

CANCEL FILESYSTEM CHECK? no

** Last Mounted on 
** Phase 1 - Check Blocks and Sizes
** Phase 2a - Check Duplicated Names
** Phase 2b - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups

SALVAGE? yes


UPDATE STANDARD SUPERBLOCK? yes

82 files, 3649 used, 244894 free (6 frags, 30611 blocks, 0.0% 
fragmentation)

***** FILE SYSTEM WAS MODIFIED *****
fsck Reports When it Needs to be Rerun

Better reporting by fsck about when it needs to be rerun should alleviate the time and necessity of running it multiple times, which can be particularly time consuming on large file systems.

The following new messages prompt you to rerun the fsck utility at the end of an error scenario:

***** PLEASE RERUN FSCK *****

Or:

Please rerun fsck(1M) to correct this.

These new prompts resolve the previous difficulty in determining whether fsck should be rerun or not.

Unless you are prompted to rerun fsck as in the above messages, there is no need to run fsck, even after you see the following message:

***** FILE SYSTEM WAS MODIFIED *****

However, it doesn't harm the file system to rerun fsck after this message. This message is just informational about fsck's corrective actions.

New fsck Messages Regarding Extended Attributes

New fsck messages are included that report on and repair files with extended attributes. For example:

BAD ATTRIBUTE REFERENCE TO I=1 FROM I=96
Attribute directory I=97 not attached to file I=96
  I=96  OWNER=root MODE=40755
SIZE=512 MTIME=Jul 21 16:23 2005 
DIR= <xattr> 

FIX?  yes
ZERO LENGTH ATTR DIR I=12  OWNER=root MODE=160755
SIZE=0 MTIME=Jul 21 16:25 2005 
CLEAR?  yes
File should BE marked as extended attribute
  I=22  OWNER=root MODE=100644
SIZE=0 MTIME=Jul 21 16:36 2005 
FILE=  <xattr>

FIX?  yes
UNREF ATTR DIR  I=106  OWNER=root MODE=160755
SIZE=512 MTIME=Jul 21 16:36 2005 
RECONNECT?  yes
File I=107 should NOT be marked as extended attribute
  I=107  OWNER=root MODE=100644
SIZE=0 MTIME=Jul 21 16:36 2005 
FILE=?/attfsdir-7-att

FIX?  yes
DIR I=106 CONNECTED.
Better Handling of Duplicate Blocks or Fragments

The fsck error messages now reports information about blocks, fragments, or a LFNs, which are the logical fragment numbers from the start of the file. For example, you might see output similar to the following:

** Phase 1 - Check Blocks and Sizes
FRAGMENT 784 DUP I=38 LFN 0
FRAGMENT 785 DUP I=38 LFN 1
FRAGMENT 786 DUP I=38 LFN 2
.
.
.

fsck processes objects as fragments, but in previous Solaris releases, only reported object information as blocks. It now correctly reports as fragments.

If fsck finds error conditions that involve duplicate blocks or fragments, fsck offers to display the uncleared files at end of the fsck output. For example, you might see output similar to the following:

LIST REMAINING DUPS?  yes

Some blocks that were found to be in multiple files are still
assigned to file(s).
Fragments sorted by inode and logical offsets:
Inode 38:
  Logical Offset  0x00000000               Physical Fragment  784
  Logical Offset  0x00000800               Physical Fragment  786
  Logical Offset  0x00001000               Physical Fragment  788
  Logical Offset  0x00001800               Physical Fragment  790

Then, you can use the find -i inode-number command to identify the name of inode 38, in this example.

Previous Next

 
 
  Published under the terms fo the Public Documentation License Version 1.01. Design by Interspire