Mounting a floppy disk

I thought mounting a floppy drive in obsd would be the same as in linux, but it's not. Depending on the distro, in linux you could do:

    # mount /dev/fd0 /floppy

but not so in obsd.

I had a floppy I wanted to go from my win2k machine to my standalone obsd box, so it was msdos formatted. I went to /mnt and created a floppy dir

    # cd /mnt
    # mkdir floppy

Then you have to mount the floppy:

    # mount -t msdos /dev/fd0c /mnt/floppy

The -t msdos tells mount to use msdos instead of the default ffs filesystem. Then you put whatever you want in /mnt/floppy and it goes on the floppy. Works the same of course with deleting files.

I did more looking after that and found out how to format a floppy and mount it for the ffs filesystem.

First, as root, do a format. This will also verify that the floppy is OK. When you put in a bad disk like I did, it'll spit some garbage on the screen, but don't worry cause it'll keep going.

    # fdformat fd0

Next we need to partition the floppy. Use disklabel:

    # disklabel -E fd0

    Initial label editor (enter '?' for help at any prompt)
    > p

    device: /dev/rfd0c
    type: floppy
    disk: floppy disk
    label: fictitious
    bytes/sector: 512
    sectors/track: 18
    tracks/cylinder: 2
    sectors/cylinder: 36
    cylinders: 80

    total sectors: 2880
    free sectors: 2880
    rpm: 300

    16 partitions:
    #        size   offset    fstype   [fsize bsize   cpg]
      c:     2880        0    unused        0     0         # (Cyl.    0 - 79)
    > a a
    offset: [0]

    size: [2880]
    FS type: [4.2BSD]
    > w
    > q
    No label changes.
    #

Constructing the actual file system is next (if you skipped the disklabel part, use fd0c instead of fd0a). We'll use the command newfs for this:

    # newfs fd0a

...and mount your floppy:

    # mount -t ffs /dev/fd0a /mnt

As you can see, that's slightly different from the way we mounted the msdos disk. You can even leave off the -t ffs since that is the filesystem that mount will default to.


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <hr /> <a> <p> <em> <strong> <cite> <code> <blockquote> <ul> <ol> <li> <dl> <dt> <dd> <div> <img> <h1> <h2> <h3> <h4> <h5>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options