Use floppy on Solaris

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).
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值