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