How to use floppy disks with Solaris


IMPORTANT: When you use a floppy disk on a Sun, anyone
	on that Sun can read and write the floppy!
	Hopefully no one will abuse this, but if you have
	very private or critical data on a floppy you should
	be aware of it.

Solaris supports a number of operations on floppy disks. It can mount floppy disks with DOS (or Unix) filesystems so the files on the floppy can be accessed just like any other files. It can read and write floppy disks using commands like tar, dd and cpio. It can format floppy disks and create DOS (or Unix) filesystems on them. Below are descriptions of how to do these operations.

To access files on a floppy disk formatted with a DOS filesystem

  1. Insert the disk into the floppy drive and run volcheck:
    	% volcheck
    
    This will mount your floppy disk in the directory /floppy. You can make sure it's there like this:
    	% ls -F /floppy
    	floppy0@	noname/
    
    or this:
    	% df
    	[ df will print all of the regular file systems and somewhere
    	  amongst them (usually at the end) will be something like: ]
    	/vol/dev/diskette0/noname
    			1423    1156      267     81%   /floppy/noname
    
    or:
    	/floppy/noname (/vol/dev/diskette0/noname): 534 blocks 0 files
    
    depending on which version of df you are using.

  2. Now you can access the files on your floppy disk just like regular files. You can ls them, cat them, rm them, cp them, etc.
    	% ls /floppy/noname
    	bin4.tgz     dosemu.tgz   image.tgz    sc.tgz       term107.tgz
    	diska2       faq.tar      lilo.tgz     shlibs.tgz
    

  3. When you are done, run the eject command which will unmount your floppy from the filesystem and eject it:
    	% eject
    
    If it doesn't eject your floppy, and instead complains about `/vol/dev/rdiskette0/noname: Device busy' or something like that, that means some process is still using a file on the floppy. If your current directory is somewhere on the floppy, cd somewhere else. If you are running any processes that are accessing the floppy kill them. After that you should be able to eject your floppy.

To access a floppy disk using commands such as tar, dd and cpio

  1. Insert the disk into the floppy drive and run volcheck:
    	% volcheck
    
    This will setup special device files in the /vol/dev/diskette0 and /vol/dev/rdiskette0 directories which you can use to access your floppy:
    	blaze-dev$ ls -l /vol/dev/diskette0/ /vol/dev/rdiskette0/
    	/vol/dev/diskette0/:
    	total 0
    	brw-rw-rw- 1 nobody   nobody    91,   3 Feb 24 11:40 unlabeled
    
    	/vol/dev/rdiskette0/:
    	total 0
    	crw-rw-rw- 1 nobody   nobody    91,   3 Feb 24 11:40 unlabeled
    

  2. Most documentation says to use the special files such as /dev/rfd0, /dev/rfd0c or /dev/rdiskette0 to access a floppy with programs like tar, dd and cpio. The volume manager program is using these files so if you try to access them you will get a `Device busy' error. You have to use the other special files that the volume manager created, such as /vol/dev/rdiskette0/unlabeled. You can tar stuff onto the floppy disk:
    	% tar cf /vol/dev/rdiskette0/unlabeled prog.c prog.C prog.f
    
    and verify that it is OK:
    	% tar tvf /vol/dev/rdiskette0/unlabeled
    
    If you're writing a Linux boot floppy of the bare Slackware bootdisk, you would do it something like this:
    	% dd if=bare of=/vol/dev/rdiskette0/unlabeled obs=18k
    

  3. When you are done with your disk, eject it:
    	% eject
    

To format a floppy disk

  1. Insert the disk into the floppy drive and run volcheck:
    	% volcheck
    
    This will setup special device files in the /vol/dev/diskette0 and /vol/dev/rdiskette0 directories which you can use to format your floppy:
    	blaze-dev$ ls -l /vol/dev/diskette0/ /vol/dev/rdiskette0/
    	/vol/dev/diskette0/:
    	total 0
    	brw-rw-rw- 1 nobody   nobody    91,   3 Feb 24 11:40 unlabeled
    
    	/vol/dev/rdiskette0/:
    	total 0
    	crw-rw-rw- 1 nobody   nobody    91,   3 Feb 24 11:40 unlabeled
    

  2. If you're going to use a floppy disk with commands like tar, dd and cpio, you only have to format it. If you're going to use it as a DOS filesystem, then you have to format it and create a DOS filesystem on it. The fdformat command does both of these.

    To format a disk to be used by tar, dd and cpio, use this command:

    	% fdformat /vol/dev/rdiskette0/unlabeled
    
    To format a disk and create a DOS filesystem on it, use this command:
    	% fdformat -t dos /vol/dev/rdiskette0/unlabeled
    
    This will take a few minutes.

  3. After you've formatted the disk you can eject it with the eject command:
    	% eject
    
    If you've created a DOS filesystem on the floppy then you have to eject the floppy, and then re-insert and re-run volcheck to have it mounted on /floppy. If you're going to use the floppy with commands like tar, dd and cpio it is not necessary to eject the floppy, re-insert it and run volcheck, you can just continue using the floppy, although the fdformat command may have changed the device name of the floppy (it might be called /vol/dev/rdiskette0/unnamed_floppy instead of /vol/dev/rdiskette/unlabeled).

The above information was taken from a document originally written by John Oleynick, juo@cs.rutgers.edu (who is no longer at Rutgers).

This page last updated September 19, 1995.