Mounting FAT-32 partitions in OpenSolaris

I had a hard time with mounting a FAT-32 partition in OpenSolaris - it just wouldn't mount. Finally I found out that I need to use the -F pcfs parameter to tell mount the filesystem type. It hit me by surprise because in Linux you don't need to specify a parameter - Linux mount will detect the filesystem type for you. So in case you want to mount a FAT-32 partition, the command looks like this:

$ mount -F pcfs /dev/dsk/c5d0p4 /mnt/dosdisk

Obviously you need to change the controller and partition number according to your hardware/disk partitioning.

Comments:

Minor nit -- it's mount -F pcfs ... on Solaris, -t is linux :)

Posted by Jason on August 08, 2008 at 12:10 PM GMT #

Oops, you're right, I fixed the command in the post.

Posted by Roman Strobl on August 08, 2008 at 01:12 PM GMT #

I agree this is strange. When I moved to Solaris 2.1 from Interactive UNIX (which is based on SVR3.2), this hit me because even Interactive UNIX all those years earlier before SOlaris or Linux automatically detected the filesystem type in the mount command (using fstyp(1M) under the covers).

However, something I observed later gave me a clue why automatic detection might be deliberately missing. I grabbed a used floppy which was laying on the desk (would have been PCFS formatted) and reformatted it as a UFS floppy. I then copied on a Jumpstart sysidcfg file, and popped it into the drive of an Ultra 1 for jumpstart to find and read the sysidcfg. This didn't work. After much pulling out of hair and crawling through the Jumpstart scripts, I found it first tries to mount the floppy as a PCFS floppy, and only if that fails does it mount it as a UFS floppy, i.e. it has it's own crude auto-detection built in. After some further experimentation, I find I can mount it as a PCFS floppy and see all the DOS files which were on it originally, or I can mount it as a UFS floppy and see my sysidcfg file. Of course, jumpstart was mounting it as a PCFS floppy, and not finding a sysidcfg file. Why does this work? Well, UFS doesn't use the first 8kB of any device to avoid trampling on any disk label or boot code which might be there. In this case, that left enough of the PCFS filesystem intact on the disk for it to be mountable. The UFS structures were further on, making that mountable too. So without knowing the history of the floppy, it wasn't possible to safely guess the filesystem type on it. By the way, ISO9660 (CD/DVD) filesystems also don't use the start of the media, for exactly the same reason UFS doesn't.

Posted by Andrew Gabriel on August 08, 2008 at 03:02 PM GMT #

That is fascinating Andrew, Thanks for the heads up !

Posted by EdwardOCallaghan on August 09, 2008 at 12:44 AM GMT #

I had,anithing to comment.

Posted by luis guillermo alfonsin on August 11, 2008 at 07:02 AM GMT #

Note that in some cases you need to specify the number of the FAT partition by appending a ':[n]' to the end of the device id, where [n] is the number of the logical partition.

I try to document the odds and ends I find on my blog, 'ok boo' - http://blog.clockworm.com

Thanks much for your excellent starting tutorial!

Posted by Blake Irvin on August 18, 2008 at 05:05 PM GMT #

Roman,

Could you add, or create a new blog entry, that describes how to find the device id (the /dev/dsk/c\* ) that maps to your FAT32 disk?

I always forget every time I go to do this. :-|

thanks,

charlie ...

Posted by huntch on September 22, 2008 at 08:13 AM GMT #

you want either 'format' or 'rmformat' (if the device is something like a USB disk.

'rmformat' will probably require you to disable volfs first.

cheers,
blake

Posted by Blake Irvin on September 22, 2008 at 08:35 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today