.if n .pH rn4.chap3 @(#)chap3	40.33
.\" Copyright 1989 AT&T
.BK  "Software Notes"
.CH "File Systems" "3"
.H 1 "File Systems Notes"
.IX istart UNIX System V Release 4, file system notes
.IX istart file system, software notes
.H 2 "Virtual File System"
.H 3 "Source Compatibility"
.IX VFS, source compatibility
VFS constitutes an extensive rewrite of the
file system code. No substantial source compatibility 
should be expected for file system code written prior to SVR4.0.
.H 3 "Future Directions"
.IX VFS, future directions
Aspects of the VFS interface (particularly the interaction
between file system code and the Virtual Memory system)
are subject to change in future releases of the system.
Absolute compatibility is not guaranteed.
.H 3 "File System Files"
.IX VFS, \f4vfstab\fP files
.IX VFS, \f4mnttab\fP file format
.IX \f4mnttab\fP(4)
.IX \f4vfstab\fP(4)
The two system files \f4/etc/checklist\f1 and \f4/etc/fstab\f1 will 
be provided in SVR4.0 for compatibility. However, the
information from these two files is now contained in \f4/etc/vfstab\f1.
The commands \f4fsck\f1 and \f4ncheck\f1 now use \f4/etc/vfstab\f1 instead of
\f4/etc/checklist\f1, and the \f4mount\f1 command now uses \f4/etc/vfstab\f1
instead of \f4/etc/fstab\f1.
.P
The format of the \f4/etc/mnttab\f1 file has changed.
The file is now readable, and contains five fields.
.H 3 "Switchout"
.IX VFS, switchout
The following commands were coded to work on the VFS
switchout mechanism: \f4clri\f1, \f4dcopy\f1, \f4df\f1, 
\f4ff\f1, \f4ncheck\f1, \f4fsck\f1,
\f4fsdb\f1, \f4labelit\f1, \f4mkfs\f1, \f4mount\f1, \f4umount\f1, 
and \f4volcopy\f1. These commands have a generic module 
and file system specific modules which
the generic will call. Commands operating on unmounted file
systems shall either have the file system type supplied on
the command line with the \f4-F\f1 option, or an appropriate 
entry shall be provided by the administrator in \f4/etc/vfstab\f1.
.H 2 "Filesystem Commands"
.P
.IX \f4clri\fP command, function subsumed by \f4fsdb\fP
The \f4clri\f1 command is currently working
under the switchout mechanism(see Switchout)
but will be dropped in a future
release. It's functionality is being 
subsumed by \f4fsdb\f1 \f4-z\f1.
.IX \f4fsdb\fP(1M)
.P
The output of the \f4df\f1 command without any options and with
the \f4-t\f1 option has changed. The format is different 
and \f4i-nodes\f1 has changed to \f4files\f1. 
However, the current output format of df will not be
supported in a future release and will be replaced by a new
format currently provided under the \f4-k\f1 option.
.P
.P
The function previously supplied by the \f4fsstat\f1 command
.IX \f4fsstat\fP command, function subsumed by \f4fsck\fP
.IX \f4fsck\fP(1M)
is now provided by \f4fsck -m\f1. \f4fsstat\f1 will be provided in SVR4.0,
but its support will be dropped in a future release.
.P
For the \f4fsck\f1 command, matching in \f4/etc/vfstab\f1 is performed
on the \f4fsckdev\f1 entry
in each line, \f2not\f1 the special entry.  This implies that
\f4mount /usr\f1 will work, but \f4fsck /usr\f1 will not. 
\f4fsck <fsckdev entry for /usr>\f1, however, will work.
.P
\f4fsck\f1 without any options or arguments will
execute on all filesystems in \f4/etc/vfstab\f1
which have 1 in the \f4fsck\f1 pass field. To
avoid corruption, do not attempt this on any system in
multi-user mode.
.P
The \f4mountall\f1 code has changed to use \f4fsck -m\f1 to determine
if a file system is suitable for mounting.
.P
.H 3 "Future Directions"
The format of the \f4mount\f1 command will be replaced 
in a future release by a new format currently provided under 
the \f4-v\f1 option.
.P
Since the \f4ff\f1 command is more flexible, it is intended
that one day it will supersede \f4ncheck\f1. 
In a future release,
\f4ff\f1 will subsume all functionality of 
\f4ncheck\f1 and \f4ncheck\f1 will be removed from the system.
.H 2 "File System Types"
.H 3 s5
.IX s5-FSTypes, size checking changes
The s5 specific \f4fsck\f1 command code has changed for 
size checking. The "possible file size error" that was suppressed
with the \f4-q\f1 option no longer exists. If the number of blocks
in an inode exceeds the file size, the user is asked if the
excess blocks should be recovered or deleted. If a directory size
is not a multiple of the directory structure size, the user is
asked if the size should be set to the address of the
last byte of the file or left unchanged.
.P
The \f4-b\f1 option to the s5 specific \f4mkfs\f1 is not 
supported at the end of the command line as was the case 
in SVR3.2.
This option is now used before the special device in the 
command line.
.P
The option \f4-r\f1 of the s5 specific \f4mount\f1 command will
be provided in SVR4.0 for compatibility, but the function 
of this option will be done by the \f4-o ro\f1 option.
The \f4-r\f1 option will be removed in a future release. 
.P
The s5 \f4mkfs\f1 no longer checks that more than
65536 total inodes are requested. If a file system
is created with more than this number, the total
number of free inodes will be incorrect in the
superblock because the field is type \f4ushort\f1.
Therefore, one should not attempt to create a
filesystem with more than 65536 total inodes.
.H 3 RFS
See Chapter 4, \f2Networking Notes\f1, for information on
Remote File Sharing(RFS) implementation issues.
.H 3 "\f4/proc\fP File System"
Utilities that use \f4/proc\f1 can become hung if they try to read
.IX /proc file system, locking utilities
information about an existing hung process. They may sleep
waiting to lock a process' information. If that
process happens to be hung, the utility may also sleep
forever. This problem should only become apparent if a user
executes a utility that does locking in \f4/proc\f1 (such as \f4ps\f1 or
\f4priocntl\f1), and the system currently has a live process that
is hung after locking its process information.
.H 3 "UFS"
.IX \f4ufs\fP-FSType, new \f4ff\fP and \f4fsdb\fP commands
.IX \f4ufs\fP-FSType, unsupported BSD commands
.IX \f4ufs\fP-FSType, istart source compatibility
The UFS file system is intended to be compatible with the BSD file system.
.H 4 "New Commands"
Two new commands, \f4ff\f1 and \f4fsdb\f1, similar to their counterparts
for the \f4s5\f1 file system, are supported for UFS. These
commands are not contained in SunOS or BSD.
.H 4 "Source Compatibility"
.H 4 "\f4mount\f1"
The BSD "\f4mount\f1 \f4-a\f1" option is 
not supported in UFS.  \f4mountall\f1 should be
used to mount all file systems (including UFS file systems) 
specified in \f4/etc/vfstab\f1.
The following options to \f4mount\f1, which are supported in SunOS, are not
supported for UFS in SVR4: \f4grpid\f1, \f4quota\f1, 
\f4noquota\f1, \f4noauto\f1.
The "\f4suid\f1" option is not supported; UFS filesystems
are mounted with \f4setuid\f1 execution allowed by default. The
"\f4nosetuid\f1" option is available to mount UFS file systems
with \f4setuid\f1 execution disallowed.
.P
The \f4-p\f1 option to \f4fsck\f1 (supported as suboption \f4p\f1 
under \f4-o\f1) does not work in parallel, as it does in BSD/SunOS.
.P
Unlike SunOS/BSD which uses the errno message \f4EDQUOTA\f1, no 
special \f4errno\f1 is returned when a user tries
to exceed quota limits. Instead, an \f4errno\f1 is returned that 
indicates failure due to the lack of space. The errno message 
\f4ENOSPC\f1 is the most common.
.H 4 "Known Problems"
Given a corrupted UFS file system, if the file system is
mounted read-only, \f4fsck\f1 is executed, and then the \f4remount\f1
option is used to mount the file system read-write, any
changes \f4fsck\f1 may have made will be destroyed (i.e. the file
system will still be corrupted). This is because the \f4remount\f1
option is handled differently for s5 than it is for
UFS. It is expected that the behavior of UFS will be changed
to match the behavior of s5 in this instance in a future
release.
.H 4 "\f4ufsdump/ufsrestore\f1"
.IX \f4ufsdump\fP(1M), problem
\f4ufsdump\f1 sometimes reports more blocks written than it 
actually writes. Therefore, the blocks reported by \f4ufsrestore\f1 
and \f4ufsdump\f1 may be slightly different.
The dump is executed correctly and should be usable. If a
there is a discrepancy between the two commands on the
number of blocks in the dump, the number reported by \f4ufsrestore\f1, 
which should be slightly less than that reported by \f4ufsdump\f1, 
is correct.
.H 4 "\f4proto file\f1"
Neither the BSD \f4mkproto\f1 command nor the s5 \f4mkfs -p\f1 option 
is supported in UFS.
.H 4 "\f4ncheck\f1"
The \f4-m\f1 option works only for inodes specified under the
\f4-i\f1 option.
.H 4 "\f4quota\f1 Command"
The \f4quota\f1 command will not work correctly in all
cases unless all UFS filesystems that are currently mounted
have a quotas file. 
.IX \f4ufs\fP-FSType, iend source compatibility
.H 3 "UFS Root File System"
.IX \f4ufs\fP-FSType, \f4ufs\fP as root file system
.H 4 "Kernel"
It is assumed that the UFS file system intended to serve as
the root file system is properly prepared and has the proper
files on it to serve as root.
.P
To use UFS file system as the root file system, one must change
ROOTFSTYPE (in \f4master.d/kernel\f1) from "s5" to "ufs" 
and re-build the kernel.
.P
If this file system is located in a disk
partition other than the default, an entry for \f4ROOTDEV\f1 must
be placed in the \f4/stand/system\f1 file before the kernel is
rebuilt(see the \f4/stand/system\f1 file for more details). In
addition, it may be necessary to change the two device files,
\f4/dev/rroot\f1 and \f4/dev/root\f1, to have the same device
designation as the char and block device files for the disk slice that
contains the root file system. Finally, entries in
\f4/etc/vfstab\f1 may have to be changed to note 
where new file systems reside.
.H 4 "Commands"
Commands should be built from \f4:mkcmd\f1 so that loader options are set
to not use dynamic libraries.
.IX iend file system, software notes
.H 2 "Symbolic Links"
.IX symbolic links, Release 4 and SunOS
.H 3 "Source Compatibility"
SVR4.0 vs. SunOS\(tm 4.0 
The following list references a few of the 
incompatibilities between SVR4 and SunOS features.
.H 4 "System Calls"
.H 4 \f4link\f1 
SVR4.0 allows hard links to symbolic links; SunOS does not
.H 4 \f4chown\f1
SVR4.0 \f4chown\f1 follows symbolic links and changes the 
owner and group of the referenced file; SunOS \f4chown\f1 
does not follow, but changes the owner and 
group of the symbolic link.
.H 4 \f4lchown\f1
This command is new in SVR4.0. It is the same as 
\f4chown\f1 except \f4lchown\f1 
does not follow a symbolic link. Rather, it 
changes the owner and group of the symbolic link.
.H 4 Commands
.H 4 \f4file\f1
SVR4.0 default is to follow and use \f4-h\f1 option 
to not follow; SunOS default is not follow 
and use \f4-L\f1 option to follow.
.H 4 \f4tar\f1
SVR4.0 has \f4-L\f1 option to follow symbolic links; 
SunOS has \f4-h\f1 option to follow.
.H 4 \f4find\f1
SVR4.0 has \f4-follow\f1 option to follow; SunOS does not.
.H 4 \f4cpio\f1 
SVR4.0 has \f4-L\f1 option to follow; SunOS does not.
.IX iend UNIX System V Release 4, file system notes
