1 '\" te
   2 .\" Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
   3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH PCFS 7FS "Nov 6, 2007"
   7 .SH NAME
   8 pcfs \- FAT formatted file system
   9 .SH SYNOPSIS
  10 .nf
  11 #include <sys/param.h>
  12 #include <sys/mount.h>
  13 #include <sys/fs/pc_fs.h>
  14 
  15 \fBint\fR \fBmount\fR(\fBconst char *\fR\fIspec\fR,
  16      \fBconst char *\fR \fIdir\fR, \fBint\fR  \fImflag\fR,
  17      \fB"pcfs", NULL, 0,\fR \fBchar *\fR\fIoptptr\fR,
  18      \fBint\fR \fIoptlen\fR);
  19 .fi
  20 
  21 .SH DESCRIPTION
  22 \fBpcfs\fR is a file system type that enables direct access to files on
  23 \fBFAT\fR formatted disks from within the SunOS operating system.
  24 .sp
  25 .LP
  26 Once mounted, \fBpcfs\fR provides standard SunOS file operations and semantics.
  27 Using \fBpcfs\fR, you can create, delete, read, and write files on a \fBFAT\fR
  28 formatted disk. You can also create and delete directories and list files in a
  29 directory.
  30 .sp
  31 .LP
  32 \fBpcfs\fR supports FAT12 (floppies) and FAT16 and FAT32 file systems.
  33 .sp
  34 .LP
  35 \fBpcfs\fR file systems can be force umounted using the \fB-f\fR argument to
  36 \fBumount\fR(1M).
  37 .sp
  38 .LP
  39 The \fBpcfs\fR file system contained on the block special file identified by
  40 \fIspec\fR is mounted on the directory identified by \fIdir\fR. \fIspec\fR and
  41 \fIdir\fR are pointers to pathnames. \fImflag\fR specifies the \fBmount\fR
  42 options. The \fBMS_DATA\fR bit in \fImflag\fR must be set. Mount options can be
  43 passed to \fBpcfs\fR  using the  optptr and optlen  arguments.  See
  44 \fBmount_pcfs\fR(1M) for a list of mount options supported by \fBpcfs\fR.
  45 .sp
  46 .LP
  47 Because FAT formatted media can record file timestamps between January 1st 1980
  48 and December 31st 2127, it's not possible to fully represent UNIX \fBtime_t\fR
  49 in \fBpcfs\fR for 32 bit or 64 bit programs. In particular, if post-2038
  50 timestamps are present on a FAT formatted medium and \fBpcfs\fR returns these,
  51 32bit applications may unexpectedly fail with \fBEOVERFLOW\fR errors. To
  52 prevent this, the default behaviour of \fBpcfs\fR has been modified to clamp
  53 post-2038 timestamps to the latest possible value for a 32bit \fBtime_t\fR,
  54 which is January 19th 2038, 03:14:06 UTC when setting and retrieving file
  55 timestamps. You can override this behavior using the \fBnoclamptime\fR mount
  56 option, as described in \fBmount_pcfs\fR(1M).
  57 .sp
  58 .LP
  59 Timestamps on FAT formatted media are recorded in local time. If the recording
  60 and  receiving systems use different timezones, the representation of
  61 timestamps shown on the two systems for the same medium might vary. To correct
  62 this,  \fBpcfs\fR  provides a  timezone mount option to force  interpretation
  63 of timestamps as read from a FAT formatted medium in a given  timezone (that of
  64 the recorder). By default, the local timezone of the  receiver is used. See
  65 \fBmount_pcfs\fR(1M) for details.
  66 .sp
  67 .LP
  68 The root directory of a FAT formatted medium has no timestamps and \fBpcfs\fR
  69 returns the time when the mount was done as timestamp  for the root of the
  70 filesystem.
  71 .sp
  72 .LP
  73 The FAT filesystem doesn't support multiple links. As a result, the link count
  74 for all files and directories in \fBpcfs\fR is hard-coded as "1."
  75 .SS "Mounting File Systems"
  76 Use the following command to mount \fBpcfs\fR from diskette:
  77 .sp
  78 .in +2
  79 .nf
  80 mount \fB-F\fR pcfs \fIdevice-special\fR \fIdirectory-name\fR
  81 .fi
  82 .in -2
  83 .sp
  84 
  85 .sp
  86 .LP
  87 You can use:
  88 .sp
  89 .in +2
  90 .nf
  91 mount \fIdirectory-name\fR
  92 .fi
  93 .in -2
  94 .sp
  95 
  96 .sp
  97 .LP
  98 if the following line is in your \fB/etc/vfstab\fR file:
  99 .sp
 100 .in +2
 101 .nf
 102 \fIdevice-special\fR - \fIdirectory-name\fRpcfs \(mi no rw
 103 .fi
 104 .in -2
 105 
 106 .sp
 107 .LP
 108 Use the following command to mount \fBpcfs\fR from non-diskette media:
 109 .sp
 110 .in +2
 111 .nf
 112 mount \fB-F\fR pcfs \fIdevice-special\fR:\fIlogical-drive\fR \fBdirectory-name\fR
 113 .fi
 114 .in -2
 115 .sp
 116 
 117 .sp
 118 .LP
 119 You can use:
 120 .sp
 121 .in +2
 122 .nf
 123 mount \fIdirectory-name\fR
 124 .fi
 125 .in -2
 126 .sp
 127 
 128 .sp
 129 .LP
 130 if the following line is in your \fB/etc/vfstab\fR file:
 131 .sp
 132 .in +2
 133 .nf
 134 \fIdevice-special\fR:\fIlogical_drive\fR \fB\(mi\fR \fIdirectory-name\fR \fBpcfs \(mi no rw\fR
 135 .fi
 136 .in -2
 137 
 138 .sp
 139 .LP
 140 \fIdevice-special\fR specifies the special block device file for the diskette
 141 (\fB/dev/diskette\fIN\fR\fR) or the entire hard disk
 142 (\fB/dev/dsk/c\fIN\fRt\fIN\fRd\fIN\fRp0\fR for a SCSI disk, and
 143 \fB/dev/dsk/c\fIN\fRd\fIN\fRp0\fR for \fBIDE\fR disks) or the \fBPCMCIA\fR
 144 pseudo-floppy memory card (\fB/dev/dsk/c\fIN\fRt\fIN\fRd\fIN\fRs\fIN\fR\fR).
 145 .sp
 146 .LP
 147 \fIlogical-drive\fR specifies either the \fBDOS\fR logical drive letter
 148 (\fBc\fR through \fBz\fR) or a drive number (\fB1\fR through \fB24\fR). Drive
 149 letter \fBc\fR is equivalent to drive number \fB1\fR and represents the Primary
 150 \fBDOS\fR partition on the disk; drive letters \fBd\fR through \fBz\fR are
 151 equivalent to drive numbers \fB2\fR through \fB24\fR, and represent \fBDOS\fR
 152 drives within the Extended \fBFAT\fR partition. Note that \fIdevice-special\fR
 153 and \fIlogical-drive\fR must be separated by a colon.
 154 .sp
 155 .LP
 156 \fIdirectory-name\fR specifies the location where the file system is mounted.
 157 .sp
 158 .LP
 159 For example, to mount the Primary \fBDOS\fR partition from a SCSI hard disk,
 160 use:
 161 .sp
 162 .in +2
 163 .nf
 164 mount \fB-F\fR pcfs /dev/dsk/c\fIN\fRt\fIN\fRd\fIN\fRp0:c /pcfs/c
 165 .fi
 166 .in -2
 167 .sp
 168 
 169 .sp
 170 .LP
 171 To mount the first logical drive in the Extended \fBDOS\fR partition from an
 172 \fBIDE\fR hard disk, use:
 173 .sp
 174 .in +2
 175 .nf
 176 mount \fB-F\fR pcfs /dev/dsk/c\fIN\fRd\fIN\fRp0:d /pcfs/d
 177 .fi
 178 .in -2
 179 .sp
 180 
 181 .sp
 182 .LP
 183 To mount a \fBDOS\fR diskette in the first floppy drive when volume management
 184 is not running use:
 185 .sp
 186 .in +2
 187 .nf
 188 mount \fB-F\fR pcfs /dev/diskette /pcfs/a
 189 .fi
 190 .in -2
 191 .sp
 192 
 193 .sp
 194 .LP
 195 If Volume Management is running, run \fBvolcheck\fR(1) to automatically mount
 196 the floppy and some removable disks.
 197 .sp
 198 .LP
 199 To mount a \fBPCMCIA\fR pseudo-floppy memory card, with Volume Management not
 200 running (or not managing the \fBPCMCIA\fR media), use:
 201 .sp
 202 .in +2
 203 .nf
 204 mount \fB-F\fR pcfs /dev/dsk/c\fIN\fRt\fIN\fRd\fIN\fRs\fIN\fR /pcfs
 205 .fi
 206 .in -2
 207 .sp
 208 
 209 .SS "Conventions"
 210 Files and directories created through \fBpcfs\fR must comply with either the
 211 \fBFAT\fR short file name convention or the long file name convention
 212 introduced with Windows 95. The \fBFAT\fR short file name convention is of the
 213 form \fIfilename\fR[.\fIext\fR], where \fIfilename\fR generally consists of
 214 from one to eight upper-case characters, while the optional \fIext\fR consists
 215 of from one to three upper-case characters.
 216 .sp
 217 .LP
 218 The long file name convention is much closer to Solaris file names. A long file
 219 name can consist of any characters valid in a short file name, lowercase
 220 letters, non-leading spaces, the characters \fB+,;=[]\fR, any number of
 221 periods, and can be up to 255 characters long. Long file names have an
 222 associated short file name for systems that do not support long file names
 223 (including earlier releases of Solaris). The short file name is not visible if
 224 the system recognizes long file names. \fBpcfs\fR generates a unique short name
 225 automatically when creating a long file name.
 226 .sp
 227 .LP
 228 Given a long file name such as \fBThis is a really long filename.TXT\fR, the
 229 short file name will generally be of the form \fBTHISIS~\fR\fIN\fR\fB\&.TXT\fR,
 230 where \fIN\fR is a number. The long file name will probably get the short name
 231 \fBTHISIS~1.TXT\fR, or \fBTHISIS~2.TXT\fR if \fBTHISIS~1.TXT\fR already exits
 232 (or \fBTHISIS~3.TXT\fR if both exist, and so forth). If you use \fBpcfs\fR file
 233 systems on systems that do not support long file names, you may want to
 234 continue following the short file name conventions. See \fBEXAMPLES\fR.
 235 .sp
 236 .LP
 237 When creating a file name, \fBpcfs\fR creates a short file name if it fits the
 238 \fBFAT\fR short file name format, otherwise it creates a long file name. This
 239 is because long file names take more directory space. Because the root
 240 directory of a \fBpcfs\fR file system is fixed size, long file names in the
 241 root directory should be avoided if possible.
 242 .sp
 243 .LP
 244 When displaying file names, \fBpcfs\fR shows them exactly as they are on the
 245 media. This means that short names are displayed as uppercase and long file
 246 names retain their case. Earlier versions of \fBpcfs\fR folded all names to
 247 lowercase, which can be forced with the \fBPCFS_MNT_FOLDCASE\fR mount option.
 248 All file name searches within \fBpcfs\fR, however, are treated as if they were
 249 uppercase, so \fBreadme.txt\fR and \fBReAdMe.TxT\fR refer to the same file.
 250 .sp
 251 .LP
 252 To format a diskette or a \fBPCMCIA\fR pseudo-floppy memory card in \fBFAT\fR
 253 format in the SunOS system, use either the \fBfdformat\fR \fB-d\fR or the
 254 \fBDOS\fR \fBFORMAT\fR command.
 255 .SS "Boot Partitions"
 256 On x86 systems, hard drives may contain an \fBfdisk\fR partition reserved for
 257 the Solaris boot utilities. These partitions are special instances of
 258 \fBpcfs\fR. You can mount an x86 boot partition with the command:
 259 .sp
 260 .in +2
 261 .nf
 262 mount \fB-F\fR pcfs \fIdevice-special\fR:boot \fIdirectory-name\fR
 263 .fi
 264 .in -2
 265 .sp
 266 
 267 .sp
 268 .LP
 269 or you can use:
 270 .sp
 271 .in +2
 272 .nf
 273 \fBmount \fIdirectory-name\fR\fR
 274 .fi
 275 .in -2
 276 .sp
 277 
 278 .sp
 279 .LP
 280 if the following line is in your \fB/etc/vfstab\fR file:
 281 .sp
 282 .in +2
 283 .nf
 284 \fIdevice-special\fR:boot \(mi \fIdirectory-name\fR pcfs \(mi no rw
 285 .fi
 286 .in -2
 287 .sp
 288 
 289 .sp
 290 .LP
 291 \fIdevice-special\fR specifies the special block device file for the entire
 292 hard disk (\fB/dev/dsk/c\fIN\fRt\fIN\fRd\fIN\fRp0\fR)
 293 .sp
 294 .LP
 295 \fIdirectory-name\fR specifies the location where the file system is mounted.
 296 .sp
 297 .LP
 298 All files on a boot partition are owned by super-user. Only the super-user may
 299 create, delete, or modify files on a boot partition.
 300 .SH EXAMPLES
 301 \fBExample 1 \fRSample Displays of File Names
 302 .sp
 303 .LP
 304 If you copy a file \fBfinancial.data\fR from a UNIX file system to \fBpcfs\fR,
 305 it displays as \fBfinancial.data\fR in \fBpcfs\fR, but may show up as
 306 \fBFINANC~1.DAT\fR in systems that do not support long file names.
 307 
 308 .sp
 309 .LP
 310 The following are legal long file names. They are also \fBillegal\fR short file
 311 names:
 312 
 313 .in +2
 314 \fBtest.sh.orig\fR
 315 .in -2
 316 .br
 317 .in +2
 318 \fBdata+\fR
 319 .in -2
 320 .br
 321 .in +2
 322 \fB\&.login\fR
 323 .in -2
 324 .sp
 325 .LP
 326 Other systems that do not support long file names may see:
 327 
 328 .in +2
 329 \fBTESTSH~1.ORI\fR
 330 .in -2
 331 .br
 332 .in +2
 333 \fBDATA~1\fR
 334 .in -2
 335 .br
 336 .in +2
 337 \fBLOGIN~1\fR
 338 .in -2
 339 .sp
 340 .LP
 341 The short file name is generated from the initial characters of the long file
 342 name, so differentiate names in the first few characters. For example, these
 343 names:
 344 
 345 .in +2
 346 \fBWorkReport.January.Data\fR
 347 .in -2
 348 .br
 349 .in +2
 350 \fBWorkReport.February.Data\fR
 351 .in -2
 352 .br
 353 .in +2
 354 \fBWorkReport.March.Data\fR
 355 .in -2
 356 .sp
 357 .LP
 358 result in these short names, which are not distinguishable:
 359 
 360 .in +2
 361 \fBWORKRE~1.DAT\fR
 362 .in -2
 363 .br
 364 .in +2
 365 \fBWORKRE~2.DAT\fR
 366 .in -2
 367 .br
 368 .in +2
 369 \fBWORKRE~13.DAT\fR
 370 .in -2
 371 .sp
 372 .LP
 373 These names, however:
 374 
 375 .in +2
 376 \fBJanuary.WorkReport.Data\fR
 377 .in -2
 378 .br
 379 .in +2
 380 \fBFebruary.WorkReport.Data\fR
 381 .in -2
 382 .br
 383 .in +2
 384 \fBMarch.WorkReport.Data\fR
 385 .in -2
 386 .sp
 387 .LP
 388 result in the more descriptive short names:
 389 
 390 .in +2
 391 \fBJANUAR~1.DAT\fR
 392 .in -2
 393 .br
 394 .in +2
 395 \fBFEBRUA~1.DAT\fR
 396 .in -2
 397 .br
 398 .in +2
 399 \fBMARCHW~1.DAT\fR
 400 .in -2
 401 .SH FILES
 402 .ne 2
 403 .na
 404 \fB\fB/usr/lib/fs/pcfs/mount\fR\fR
 405 .ad
 406 .RS 26n
 407 \fBpcfs\fR \fBmount\fR command
 408 .RE
 409 
 410 .sp
 411 .ne 2
 412 .na
 413 \fB\fB/usr/kernel/fs/pcfs\fR\fR
 414 .ad
 415 .RS 26n
 416 32-bit kernel module
 417 .RE
 418 
 419 .SH ENVIRONMENT VARIABLES
 420 See \fBenviron\fR(5) for descriptions of the following environment variables
 421 for the current locale setting: LANG, LC_ALL, LC_CTYPE, and LC_COLLATE.
 422 .SH SEE ALSO
 423 \fBchgrp\fR(1), \fBchown\fR(1), \fBdos2unix\fR(1), \fBeject\fR(1),
 424 \fBfdformat\fR(1), \fBunix2dos\fR(1), \fBvolcheck\fR(1), \fBmount\fR(1M),
 425 \fBmount_pcfs\fR(1M), \fBumount\fR(1M), \fBctime\fR(3C), \fBvfstab\fR(4),
 426 \fBenviron\fR(5), \fBpcmem\fR(7D)
 427 .SH WARNINGS
 428 Do not physically eject a \fBFAT\fR floppy while the device is mounted as
 429 \fBpcfs\fR. If Volume Management is managing a device, use the \fBeject\fR(1)
 430 command before physically removing media.
 431 .sp
 432 .LP
 433 When mounting \fBpcfs\fR on a hard disk, make sure the first block on that
 434 device contains a valid \fBfdisk\fR partition table.
 435 .sp
 436 .LP
 437 Because \fBpcfs\fR has no provision for handling owner-IDs or group-IDs on
 438 files, \fBchown\fR(1) or \fBchgrp\fR(1) may generate various errors. This is a
 439 limitation of \fBpcfs\fR, but it should not cause problems other than error
 440 messages.
 441 .SH NOTES
 442 Only the following characters are allowed in \fBpcfs\fR short file names and
 443 extensions:
 444 .br
 445 .in +2
 446 \fB0-9\fR
 447 .in -2
 448 .br
 449 .in +2
 450 \fBA-Z\fR
 451 .in -2
 452 .br
 453 .in +2
 454 \fB$#&@!%()-{}<>`_^~|'\fR
 455 .in -2
 456 .sp
 457 .LP
 458 SunOS and \fBFAT\fR use different character sets and have different
 459 requirements for the text file format. Use the \fBdos2unix\fR(1) and
 460 \fBunix2dos\fR(1) commands to convert files between them.
 461 .sp
 462 .LP
 463 \fBpcfs\fR offers a convenient transportation vehicle for files between Sun
 464 workstations and \fBPCs.\fR Because the \fBFAT\fR disk format was designed for
 465 use under \fBDOS,\fR it does not operate efficiently under the SunOS system and
 466 should not be used as the format for a regular local storage. Instead, use
 467 \fBufs\fR for local storage within the SunOS system.
 468 .sp
 469 .LP
 470 Although long file names can contain spaces (just as in UNIX file names), some
 471 utilities may be confused by them.
 472 .sp
 473 .LP
 474 This implementation of \fBpcfs\fR conforms to the behavior exhibited by Windows
 475 95 version 4.00.950.
 476 .sp
 477 .LP
 478 When \fBpcfs\fR encounters long file names with non-ASCII characters, it
 479 converts such long file names in Unicode scalar values into UTF-8 encoded
 480 filenames so that they are legible and usable with any of Solaris UTF-8
 481 locales. In the same context, when new file names with non-ASCII characters are
 482 created, \fBpcfs\fR expects that such file names are in UTF-8. This feature
 483 increases the interoperability of \fBpcfs\fR on Solaris with other operating
 484 systems.
 485 .SH BUGS
 486 \fBpcfs\fR should handle the disk change condition in the same way that
 487 \fBDOS\fR does, so you do not need to unmount the file system to change
 488 floppies.