*BSD News Article 47947


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!zombie.ncsc.mil!news.mathworks.com!gatech!howland.reston.ans.net!xlink.net!ka.sub.net!rz.uni-karlsruhe.de!news.uni-stuttgart.de!uni-regensburg.de!lrz-muenchen.de!fauern!news.tu-chemnitz.de!irz401!uriah.heep!bonnie.heep!not-for-mail
From: j@bonnie.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: I have a few questions
Date: 26 Jul 1995 15:25:08 +0200
Organization: Private U**x site, Dresden.
Lines: 44
Message-ID: <3v5fnk$lp6@bonnie.tcd-dresden.de>
References: <3v0rbh$1r6@agate.berkeley.edu>
Reply-To: joerg_wunsch@uriah.heep.sax.de
NNTP-Posting-Host: 192.109.108.139
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Michael Heldebrant <hmike@soda.CSUA.Berkeley.EDU> wrote:
>How do I format and mount a floppy disk?  I have no idea how to do this

RTFM fdformat(8), disklabel(8), newfs(8), mformat(1) (if you've got
  mtools installed), mount(8), mount_msdos(8).

fdformat /dev/rfd0

disklabel -r -w fd0 floppy|floppy5
newfs -i 65536 -l 1 -u 15|18 -t 2 /dev/rfd0a
mount /dev/fd0 /mnt

or, after formatting

mformat -t 80 -h 2 -s 15|18 a:	# oops, i think mformat'ted floppies
mount -t msdos /dev/fd0 /mnt	# are not yet mountable :-(
(or use mdir/mread/mwrite)

Note that you can also use the raw floppy after low-level formatting.
That's something not known in messy DOS (and almost impractically
there, look into ``rawrite.c'' for the ugly things involved), but
common practice in Unix environments to transfer just a few files to
another machine.  The program certainly most commonly in use for this
is tar(1), it will treat the floppy very similar to a (small) tape.
It will operate on the floppy without actually mounting it, and you
aren't restricted to the FAT filesystem 8.3 limitations.

tar cvf /dev/rfd0 myfiles...	# create a new floppy
tar rvf /dev/rfd0 myfiles...	# append to existing tar floppy
tar t[v]f /dev/rfd0		# list contents
tar xvf /dev/rfd0 [myfiles...]	# extract to current directory

tar descends through directories, so if any of ``myfiles'' above is a
directory, the whole tree below it will be handled.  It's good
practice to create tar archives starting with just a directory name
(say ``foodir''), so if you've accidentally extracted it some day
later, you only need to ``rm -rf foodir'' instead of looking round in
your current dir for which files have been created from the floppy,
and remove them.
-- 
cheers, J"org                      private:   joerg_wunsch@uriah.heep.sax.de
                                   http://www.sax.de/~joerg/

Never trust an operating system you don't have sources for. ;-)