1pcfs(7FS) File Systems pcfs(7FS)
2
3
4
6 pcfs - FAT formatted file system
7
9 #include <sys/param.h>
10 #include <sys/mount.h>
11 #include <sys/fs/pc_fs.h>
12
13 int mount(const char *spec,
14 const char * dir, int mflag,
15 "pcfs", NULL, 0, char *optptr,
16 int optlen);
17
18
20 pcfs is a file system type that enables direct access to files on FAT
21 formatted disks from within the SunOS operating system.
22
23
24 Once mounted, pcfs provides standard SunOS file operations and seman‐
25 tics. Using pcfs, you can create, delete, read, and write files on a
26 FAT formatted disk. You can also create and delete directories and list
27 files in a directory.
28
29
30 pcfs supports FAT12 (floppies) and FAT16 and FAT32 file systems.
31
32
33 pcfs file systems can be force umounted using the -f argument to
34 umount(1M).
35
36
37 The pcfs file system contained on the block special file identified by
38 spec is mounted on the directory identified by dir. spec and dir are
39 pointers to pathnames. mflag specifies the mount options. The MS_DATA
40 bit in mflag must be set. Mount options can be passed to pcfs using
41 the optptr and optlen arguments. See mount_pcfs(1M) for a list of
42 mount options supported by pcfs.
43
44
45 Because FAT formatted media can record file timestamps between January
46 1st 1980 and December 31st 2127, it's not possible to fully represent
47 UNIX time_t in pcfs for 32 bit or 64 bit programs. In particular, if
48 post-2038 timestamps are present on a FAT formatted medium and pcfs
49 returns these, 32bit applications may unexpectedly fail with EOVERFLOW
50 errors. To prevent this, the default behaviour of pcfs has been modi‐
51 fied to clamp post-2038 timestamps to the latest possible value for a
52 32bit time_t, which is January 19th 2038, 03:14:06 UTC when setting and
53 retrieving file timestamps. You can override this behavior using the
54 noclamptime mount option, as described in mount_pcfs(1M).
55
56
57 Timestamps on FAT formatted media are recorded in local time. If the
58 recording and receiving systems use different timezones, the represen‐
59 tation of timestamps shown on the two systems for the same medium might
60 vary. To correct this, pcfs provides a timezone mount option to
61 force interpretation of timestamps as read from a FAT formatted medium
62 in a given timezone (that of the recorder). By default, the local
63 timezone of the receiver is used. See mount_pcfs(1M) for details.
64
65
66 The root directory of a FAT formatted medium has no timestamps and pcfs
67 returns the time when the mount was done as timestamp for the root of
68 the filesystem.
69
70
71 The FAT filesystem doesn't support multiple links. As a result, the
72 link count for all files and directories in pcfs is hard-coded as "1."
73
74 Mounting File Systems
75 Use the following command to mount pcfs from diskette:
76
77 mount -F pcfs device-special directory-name
78
79
80
81
82 You can use:
83
84 mount directory-name
85
86
87
88
89 if the following line is in your /etc/vfstab file:
90
91 device-special - directory-namepcfs − no rw
92
93
94
95 Use the following command to mount pcfs from non-diskette media:
96
97 mount -F pcfs device-special:logical-drive directory-name
98
99
100
101
102 You can use:
103
104 mount directory-name
105
106
107
108
109 if the following line is in your /etc/vfstab file:
110
111 device-special:logical_drive − directory-name pcfs − no rw
112
113
114
115 device-special specifies the special block device file for the diskette
116 (/dev/disketteN) or the entire hard disk (/dev/dsk/cNtNdNp0 for a SCSI
117 disk, and /dev/dsk/cNdNp0 for IDE disks) or the PCMCIA pseudo-floppy
118 memory card (/dev/dsk/cNtNdNsN).
119
120
121 logical-drive specifies either the DOS logical drive letter (c through
122 z) or a drive number (1 through 24). Drive letter c is equivalent to
123 drive number 1 and represents the Primary DOS partition on the disk;
124 drive letters d through z are equivalent to drive numbers 2 through 24,
125 and represent DOS drives within the Extended FAT partition. Note that
126 device-special and logical-drive must be separated by a colon.
127
128
129 directory-name specifies the location where the file system is mounted.
130
131
132 For example, to mount the Primary DOS partition from a SCSI hard disk,
133 use:
134
135 mount -F pcfs /dev/dsk/cNtNdNp0:c /pcfs/c
136
137
138
139
140 To mount the first logical drive in the Extended DOS partition from an
141 IDE hard disk, use:
142
143 mount -F pcfs /dev/dsk/cNdNp0:d /pcfs/d
144
145
146
147
148 To mount a DOS diskette in the first floppy drive when volume manage‐
149 ment is not running use:
150
151 mount -F pcfs /dev/diskette /pcfs/a
152
153
154
155
156 If Volume Management is running, run volcheck(1) to automatically mount
157 the floppy and some removable disks.
158
159
160 To mount a PCMCIA pseudo-floppy memory card, with Volume Management not
161 running (or not managing the PCMCIA media), use:
162
163 mount -F pcfs /dev/dsk/cNtNdNsN /pcfs
164
165
166
167 Conventions
168 Files and directories created through pcfs must comply with either the
169 FAT short file name convention or the long file name convention intro‐
170 duced with Windows 95. The FAT short file name convention is of the
171 form filename[.ext], where filename generally consists of from one to
172 eight upper-case characters, while the optional ext consists of from
173 one to three upper-case characters.
174
175
176 The long file name convention is much closer to Solaris file names. A
177 long file name can consist of any characters valid in a short file
178 name, lowercase letters, non-leading spaces, the characters +,;=[], any
179 number of periods, and can be up to 255 characters long. Long file
180 names have an associated short file name for systems that do not sup‐
181 port long file names (including earlier releases of Solaris). The short
182 file name is not visible if the system recognizes long file names. pcfs
183 generates a unique short name automatically when creating a long file
184 name.
185
186
187 Given a long file name such as This is a really long filename.TXT, the
188 short file name will generally be of the form THISIS~N.TXT, where N is
189 a number. The long file name will probably get the short name THI‐
190 SIS~1.TXT, or THISIS~2.TXT if THISIS~1.TXT already exits (or THI‐
191 SIS~3.TXT if both exist, and so forth). If you use pcfs file systems on
192 systems that do not support long file names, you may want to continue
193 following the short file name conventions. See EXAMPLES.
194
195
196 When creating a file name, pcfs creates a short file name if it fits
197 the FAT short file name format, otherwise it creates a long file name.
198 This is because long file names take more directory space. Because the
199 root directory of a pcfs file system is fixed size, long file names in
200 the root directory should be avoided if possible.
201
202
203 When displaying file names, pcfs shows them exactly as they are on the
204 media. This means that short names are displayed as uppercase and long
205 file names retain their case. Earlier versions of pcfs folded all names
206 to lowercase, which can be forced with the PCFS_MNT_FOLDCASE mount
207 option. All file name searches within pcfs, however, are treated as if
208 they were uppercase, so readme.txt and ReAdMe.TxT refer to the same
209 file.
210
211
212 To format a diskette or a PCMCIA pseudo-floppy memory card in FAT for‐
213 mat in the SunOS system, use either the fdformat -d or the DOS FORMAT
214 command.
215
216 Boot Partitions
217 On x86 systems, hard drives may contain an fdisk partition reserved for
218 the Solaris boot utilities. These partitions are special instances of
219 pcfs. You can mount an x86 boot partition with the command:
220
221 mount -F pcfs device-special:boot directory-name
222
223
224
225
226 or you can use:
227
228 mount directory-name
229
230
231
232
233 if the following line is in your /etc/vfstab file:
234
235 device-special:boot − directory-name pcfs − no rw
236
237
238
239
240 device-special specifies the special block device file for the entire
241 hard disk (/dev/dsk/cNtNdNp0)
242
243
244 directory-name specifies the location where the file system is mounted.
245
246
247 All files on a boot partition are owned by super-user. Only the super-
248 user may create, delete, or modify files on a boot partition.
249
251 Example 1 Sample Displays of File Names
252
253
254 If you copy a file financial.data from a UNIX file system to pcfs, it
255 displays as financial.data in pcfs, but may show up as FINANC~1.DAT in
256 systems that do not support long file names.
257
258
259
260 The following are legal long file names. They are also illegal short
261 file names:
262
263 test.sh.orig
264 data+
265 .login
266
267
268 Other systems that do not support long file names may see:
269
270 TESTSH~1.ORI
271 DATA~1
272 LOGIN~1
273
274
275 The short file name is generated from the initial characters of the
276 long file name, so differentiate names in the first few characters. For
277 example, these names:
278
279 WorkReport.January.Data
280 WorkReport.February.Data
281 WorkReport.March.Data
282
283
284 result in these short names, which are not distinguishable:
285
286 WORKRE~1.DAT
287 WORKRE~2.DAT
288 WORKRE~13.DAT
289
290
291 These names, however:
292
293 January.WorkReport.Data
294 February.WorkReport.Data
295 March.WorkReport.Data
296
297
298 result in the more descriptive short names:
299
300 JANUAR~1.DAT
301 FEBRUA~1.DAT
302 MARCHW~1.DAT
303
305 /usr/lib/fs/pcfs/mount pcfs mount command
306
307
308 /usr/kernel/fs/pcfs 32-bit kernel module
309
310
312 See environ(5) for descriptions of the following environment variables
313 for the current locale setting: LANG, LC_ALL, LC_CTYPE, and LC_COLLATE.
314
316 chgrp(1), chown(1), dos2unix(1), eject(1), fdformat(1), unix2dos(1),
317 volcheck(1), mount(1M), mount_pcfs(1M), umount(1M), ctime(3C),
318 vfstab(4), environ(5), pcmem(7D)
319
321 Do not physically eject a FAT floppy while the device is mounted as
322 pcfs. If Volume Management is managing a device, use the eject(1) com‐
323 mand before physically removing media.
324
325
326 When mounting pcfs on a hard disk, make sure the first block on that
327 device contains a valid fdisk partition table.
328
329
330 Because pcfs has no provision for handling owner-IDs or group-IDs on
331 files, chown(1) or chgrp(1) may generate various errors. This is a lim‐
332 itation of pcfs, but it should not cause problems other than error mes‐
333 sages.
334
336 Only the following characters are allowed in pcfs short file names and
337 extensions:
338 0-9
339 A-Z
340 $#&@!%()-{}<>`_^~|'
341
342
343 SunOS and FAT use different character sets and have different require‐
344 ments for the text file format. Use the dos2unix(1) and unix2dos(1)
345 commands to convert files between them.
346
347
348 pcfs offers a convenient transportation vehicle for files between Sun
349 workstations and PCs. Because the FAT disk format was designed for use
350 under DOS, it does not operate efficiently under the SunOS system and
351 should not be used as the format for a regular local storage. Instead,
352 use ufs for local storage within the SunOS system.
353
354
355 Although long file names can contain spaces (just as in UNIX file
356 names), some utilities may be confused by them.
357
358
359 This implementation of pcfs conforms to the behavior exhibited by Win‐
360 dows 95 version 4.00.950.
361
362
363 When pcfs encounters long file names with non-ASCII characters, it con‐
364 verts such long file names in Unicode scalar values into UTF-8 encoded
365 filenames so that they are legible and usable with any of Solaris UTF-8
366 locales. In the same context, when new file names with non-ASCII char‐
367 acters are created, pcfs expects that such file names are in UTF-8.
368 This feature increases the interoperability of pcfs on Solaris with
369 other operating systems.
370
372 pcfs should handle the disk change condition in the same way that DOS
373 does, so you do not need to unmount the file system to change floppies.
374
375
376
377SunOS 5.11 6 Nov 2007 pcfs(7FS)