[To the index]

In this lesson you will need a formatted, empty, not write protected floppy disk.

File transfer from/to Windows with floppy disks using mtools

mtools is a collection of commands to manage data on floppies (comparable with the MS-DOS commands: COPY, DEL, DIR, etc.)
Insert a formatted, empty and not write protected floppy in the floppy disk drive.

Open a root shell:

k_in_gear Click at the Knoppix-KDE-Desktop at the bottom left with the left mouse button on the symbol with character "K" in a gear (this is comparable with the <Start> icon in Windows 98/NT/XP...).

k_knoppix Click in the menu that opened with the left mouse button at the entry "KNOPPIX".

k_rootshell Click in the sub menu that opened at the entry "Root Shell". A "Root" window opens.

In the root shell window you can give mtool  commands with your keyboard.

Some examples:


Explanation of the examples:

mformat a: Format the floppy that is in drive A:
All data at the floppy is lost!
mcopy /bin/date a: Copy the file date from directory /bin onto the floppy in drive A: 
mdir a: Show the files that are on the floppy in drive A: 
mcopy a:\excursion.jpg /home/knoppix Copy the file excursion.jpg from the floppy in drive A: to the directory  /home/knoppix.
mdel a:\excursion.jpg Delete the file excursion.jpg from the floppy in drive A:
mcopy -t a:\readme.txt /tmp/README Copy the file readme.txt from the floppy in drive A: to the file with new name README in the directory /tmp.
Because of the -t option, all CRLF (carriage return / line feed) character pairs that are used in MS-DOS files are transformed into a single LF character as used in Unix (see also the Excursion below).
mcopy -t /etc/motd a:\motd.txt Copies the file motd (message of the day) from the directory /etc onto the floppy in drive A: under the new name motd.txt
Because of the -t option, all single LF character as used in Unix files are transformed into CRLF (carriage return / line feed) character pairs that are used in MS-DOS (see also the Excursion below).

Rules of thumb:

Further information can be found in the manual pages of mtools, that you can call using the commands "man mtools", "man mcopy", "man mdel" in a command window, (e.g.  k_in_gear_little --> k_knoppix --> k_rootshell). (Where you can use the space bar to turn a page and the "q" key to quit reading the manual page.)

[Back to the beginning of the page]

Excursion: Files under windows and UNIX: Two worlds collide!

Are you so old that you remember and used the mechanical typewriter? Maybe you still have one on your attic somewhere...
With such a mechanical typewriter, when you are at the end of the line, you had to pull a lever. Two things happened then mechanically. In two to three rattles the paper was transported up one or more lines (the line feed or LF) and then you pulled the lever through from the far right to the left and returned the carriage with the paper (the carriage return or CR).

In your PC and on your hard disk the characters of a text line are stored in ASCI encoded characters in successive bytes. To indicate the end of the line it is necessary to mark this in some way or another.

The first computer "screens" were no more than electromechanical controlled typewriters or TELEX terminals, so they had something like the carriage return / linefeed mechanism of the old typewriters in them. These mechanisms were controlled by the ASCI characters CR and LF. The MS_DOS and later on Windows developers simply used these ASCI characters to indicate the end of text lines in their text files. For instance if you type in Notepad under Windows the string abc <enter> def, then internally in the file the ASCI characters "abcCRLFdef" are stored. And when Notepad reads this it displays:


The editor interprets the CRLF characters as indication that it has to start on the beginning of a new line. That 's the way it should be.

The UNIX developers (at the university of Berkeley) decided that actually only one character would do, as they always come in pairs, and moreover the electronics of the computer screens can handle this command perfectly on their own. So in Unix/Linux only the LF character is used. When vi / gvim reads the ASCI string "abcLFdef" then this shows correctly as:


The big fuzz starts when you directly want to edit Linux text files under Windows or vice versa.  When Notepad under Windows read the ASCI string: "abcLFdefLFghi" then it shows as:

It still only does the linefeed and not the carriage return, so the next line does not start at the beginning of the line.

When vi / gvim reads a Windows file with the string: "abcCRLFdefCRLFghi" then it shows this as:


It replaces the (invisible) ASCI control character CR by a pair of visible ASCI characters (^M) and starts due to the LF at the beginning of a new line.
So that's why you need this cumbersome translation between windows text files and unix text files, swapping CRLFs by LFs and vice versa.

[Back to the beginning of the page]

[To the index]

This Document describes the Knoppix Version 3.4 CeBit 2004 Edition.
Copyright (c) 2004-04-19 Karl Schock. (Thanks to all that have contributed to this document - special thanks to Pieter Jonker for translation into english.)
You have permission to copy, distribute or change this document under the conditions of the GNU Free Documentation License.
THE USE OF THIS DOCUMENT IS AT YOUR OWN RISK. The author cannot be held responsible in any way for direct or indirect damage that may come forward from using this document.