Skip Headers
Oracle Hierarchical Storage Manager and QFS Software Command Reference
Section 1m: Maintenance Commands
Release 6.1.1
E70305-03

NAME

samfsck - Checks and repairs a StorageTek QFS or Oracle HSM file system

SYNOPSIS

samfsck [ -s scratch_dir ] [ -F [ -R ] ] [ -G ] [ -S ] [ -U ] [ -u fs_version ] [ -V ] [ -p ] [ -A | -a ] fs_name

AVAILABILITY

SUNWsamfs

DESCRIPTION

The samfsck command checks and optionally repairs a StorageTek QFS or Oracle HSM file system from the disk partitions that belong to fs_name. For fs_name, specify either a family set name from the mcf file or a mount point absolute path name from the ∕etc∕vfstab file. One or more disk partitions are specified in the mcf file. If no options are specified, samfsck checks and reports, but does not repair, all the blocks that belong to inodes and lists inodes which have duplicate blocks. samfsck also checks inodes which have blocks that are free blocks. If only one inode is listed in the duplicate list, that inode contains a block that is also free. To repair the file system, the file system must be unmounted, and the -F option specified.

If there are files encountered that are not attached to a parent directory, they will be moved to the ∕mount_point∕lost+found directory. If this directory does not exist, you must create this directory first and make it sufficently large to hold the expected number of disconnected files if you wish this to happen. Here is how to do this in the Bourne shell for a SAM file system mounted on ∕sam:

∕bin∕mkdir ∕sam∕lost+found
cd ∕sam∕lost+found
N=0
while [ $N -lt 1024 ]; do
    touch TMPFILE$N
    N=`expr $N + 1`
done
rm TMPFILE*

OPTIONS

-s scratch_dir

Specifies the scratch directory. If specified, this directory is used for the scratch files that are used. The default scratch directory is ∕tmp.

-F

Check and repair the file system. For all inodes that have duplicate blocks, mark those inodes offline if they have been archived. If the file system is not unmounted samfsck will exit with an error.

-G

Generate directory entry hash. In SAM-FS 3.5.0 and above, a hash code was added to directory entries to speed up directory searches. This is particularly useful for longer file names. The -G option, when used in conjunction with the -F option, will modify directory entries which do not have a proper hash value to have a hash. When the -G option is used without the -F option, the number of directory entries which could be hashed is reported. The presence of a hash value has no effect on versions of SAM-FS prior to 3.5.0.

-S

Convert the filesystem from a non-shared filesystem to a shared filesystem. This option is not available to filesystems with a version 1 superblock. The -F option must also be specified to convert a filesystem. This will cause samfsck to update the on-disk structures to make the filesystem shared. Note that samfsck does not update the ∕etc∕vfstab entry (see vfstab (4)), the mcf entry (see mcf (4)), or the shared hosts file (see samsharefs (1m)) for the filesystem, nor does it configure the services file (see services (4)) for shared SAM operations. These must be configured and updated before the filesystem is converted.

-U

Convert the filesystem from a shared filesystem to a non-shared filesystem. The -F option must also be specified to convert a filesystem. The on-disk structures of the filesystem are updated to make the filesystem non-shared. Note that samfsck does not update the ∕etc∕vfstab entry (see vfstab (4)), or the mcf entry (see mcf (4)). These must be configured and updated before the filesystem is converted.

-u fs_version

Convert the filesystem to the given fs_version. The only value that is valid for 5.0 is 2A. Only Filesystems version 2 can be converted to 2A. Filesystems version 2A can use 5.0 features like Online add∕remove, Large Host Table and Project IDs. Note that 2A filesystems are only mountable on 5.0 and not backwards compatible. The -F option must also be specified to convert a filesystem. The on-disk structures of the filesystem are updated to make the filesystem version 2A. Note that version 2A filesystems are not backward compatible or reversible.

-V

Turns on a verbose display of DEBUG information. This information is useful to Oracle analysts.

-R

Rename the file system. When specified along with the -F option, the -R option will rewrite the super block with the disk cache family set name found in ∕etc∕opt∕SUNWsamfs∕mcf. No action will be taken if the -R option is used without the -F option. It is important that sam-fsd be notified after any change to ∕etc∕opt∕SUNWsamfs∕mcf (see samd (1m)).

-p

Return an indication of the filesystem's health. Non-zero return indicates that the filesystem should not be mounted without first using samfsck to check and repair the filesystem (see EXIT STATUS). A zero return value indicates that the filesystem can be mounted immediately.

-A

Convert the POSIX extended ACL to the NFSV4 extended ACL. This operation is not reversible, and only applies to file system versions V2 or V2A. The -F option must also be specified to convert a filesystem. If errors are encountered when converting the POSIX extended ACL to the NFSV4 extended ACL, no conversion is made, use -a to forcibly convert the POSIX exteneded ACL. The -a and -A options are mutually exclusive. NOTE: This option is only available for Solaris 11 and higher.

-a

Forcibly convert the POSIX extended ACL to the NFSV4 extended ACL. This option removes the POSIX extended ACL from the inode if errors are encountered when converting the POSIX extended ACL to the NFSV4 extended ACL with -A option. The -F option must also be specified to convert a filesystem. The -A and -a options are mutually exclusive. NOTE: This option is only available for Solaris 11 and higher.

EXIT STATUS

The following exit values are returned:

0

The filesystem is consistent.

4

Nonfatal: Filesystem block counts need to be reconciled.

5

Nonfatal: Filesystem blocks can be reclaimed.

10

Nonfatal: Orphan inodes can be moved to lost+found.

20

Fatal: invalid directory blocks exist, overlapping blocks mapped to 2 inodes exist. Files∕directories will be marked offline if an archive copy exists or damaged if no archive copy exists.

30

Fatal: I∕O Errors occurred, but samfsck kept processing. Filesystem is not consistent.

35

Fatal: Argument errors terminated samfsck.

36

Fatal: Malloc errors terminated samfsck.

37

Fatal: Device errors terminated samfsck.

40

Fatal: Filesystem superblock is invalid.

41

Fatal: Filesystem option mask has non-backwards compatible options.

45

Fatal: Filesystem .inodes file is invalid.

50

Fatal: I∕O Errors terminated samfsck.

55

Nonfatal: The -p option was specified, and the filesystem should be checked and repaired prior to mounting.

FILES

∕etc∕opt∕SUNWsamfs∕mcf

The configuration file for samfs

∕etc∕vfstab

File system defaults table

SEE ALSO

samd (1m). samsharefs (1m).

mcf (4), services(4), vfstab(4).