DFT(8) DFT(8)
NAME
dft - transfer files from extfs to dos partition
partdisp - display partition table on a given drive
SYNOPSIS
dft
partdisp [drive]
DESCRIPTION
dft is used to transfer files from an ext2 hard disk
partition to the current dos partition. The program works
in a similar way to ftp.
NOTE: Neither of these programs will write to the ext2
partition. The only time either of these write at all is
when dft is used to transfer a file, and even then it only
writes to the DOS partition.
Starting up dft results in a small banner and a prompt:
dft v0.0.1j
(Numerous boot messages follow...)
dft:1:#
A partition has to be opened before it can be read. This
is achieved with the 'open' command:
dft:1:# open /dev/hda1
NOTE: the partition names do not necessarily correspond to
the partition names in Linux.
NOTE: if only one ext2 filesystem is found when dft is
started, it will automatically be opened.
NOTE: if the magic number is missing, the warnings can be
overridden with the open! command:
dft:1:# open! /dev/hda1
However, the magic number should always be present under
normal circumstances.
Some debugging information is displayed, and the partition
is declared as being read. Note that the prompt has
changed.
dft:/:2:#
Entering 'help' will produce a list of valid commands (and
their synonyms).
The 'ls' command displays the contents of the current
directory:
dft:/:2:# ls -al
drwxr-xr-x 18 2 1024 .
drwxr-xr-x 18 2 1024 ..
drwxr-xr-x 2 4E25 1024 bin
drwxr-xr-x 3 7535 1024 boot
drwxr-xr-x 2 CB4C 1024 cdrom
drwxr-xr-x 2 FA1 7168 dev
drwx------ 2 D572 1024 dos
drwxr-xr-x 8 5DC5 1024 etc
drwxr-xr-x 4 8CA5 1024 home
drwxr-xr-x 2 9475 1024 lib
drwxr-xr-x 2 B 12288 lost+found
drwxr-xr-x 2 6595 1024 mnt
drwxr-xr-x 2 CB4A 1024 proc
drwxr-x--x 9 7D05 1024 root
drwxr-xr-x 2 6D65 1024 sbin
-rw------- 1 29A 10240 tabs.tar
drwxrwxrwx 3 1771 1024 tmp
drwxr-xr-x 18 4E21 1024 usr
-rw------- 1 29B 20480 usr_bin.tar
drwxr-xr-x 13 1F41 1024 var
-r-------- 1 7D 469988 vmlinuz
-rw------- 1 273 273380 zImage
dft:/:3:#
NOTE: this will be in colour if dft is started up in a
colour text mode.
NOTE: the standard ls switches of -a and -l are
available. They can also be combined to -al.
To pause the display of the ls every screen, the switch -p
is no longer available. Full piping is now available, so
ls |more is possible, or ls |less or whatever pager you
use.
The command 'cd' can be used to change directories, such
as
dft:/:2:# cd usr/bin
dft:/usr/bin:3:#
The 'cdi' command is available for direct entry of an
inode number. For example:
dft:/:2:# cdi $a58e
dft:...:3:#
NOTE: the default format for inode entry is decimal, but
can be overriden to hexadecimal (as in the example) by
leading the entry with a '$'.
NOTE: it is the user's responsibility to ensure that a
valid inode is entered. If difficulties are encountered,
entering 'cd /' should still work.
NOTE: after using cdi, the display of the current path is
inactive. It is only restored when the cd / command is
used.
A file can be transferred using the 'get' command:
dft:/home/andrew:2:# get drive_my_car.crd
Getting drive_my_car.crd from inode 0x0000879D as
"drive_my.crd"
must read 2678 bytes
###
Transferred 2.62kb in 0.05 seconds
Transfer rate of 47.61kb/s
dft:/home/andrew:3:#
NOTE: if dft is run in a Windows 95 DOS box, the file
transferred will be given a long filename if neccesary.
The 'geti' command exists if a file name is difficult to
enter:
dft:/home/andrew:2:# geti $879D drive_my.crd
Getting drive_my_car.crd from inode 0x0000879D as
"drive_my.crd"
must read 2678 bytes
###
Transferred 2.62kb in 0.05 seconds
Transfer rate of 47.61kb/s
dft:/home/andrew:3:#
NOTE: the default format for inode entry is decimal, but
can be overriden to hexadecimal (as in the example) by
leading the entry with a '$'.
NOTE: it is the user's responsibility to ensure that a
valid inode is entered.
The screen can be cleared with the 'clear' command.
Normally dft can only be quit after using the 'close'
command, but the command 'x' gives a quick exit.
NOTE: Exiting with 'x' does not affect either the ext2 or
the DOS filesystem in any way. The ext2 partition is
never mounted (in the Linux sense), and by this time all
the DOS buffers have been flushed.
It is possible to run a DOS command without quitting dft,
using the " prefix, such as:
dft:/:2:# "cd \temp
dft:/:3:# "cd
C:\TEMP
dft:/:4:#
Entering the command " on its own starts a new copy of the
cli:
dft:/:2:# "
Microsoft(R) MS-DOS(R) Version 6.20
(C)Copyright Microsoft Corp 1981-1993.
C:\APPS\DFT>verify
VERIFY is off
C:\APPS\DFT>exit
dft:/:3:#
You can also press ^Z to get a DOS shell.
The df command gives a similar output to the linux df
command:
dft:/:2:# df
Filesystem 1024-blocks Used Available Capacity
/dev/hda1 256000 182986 73014 72%
C:\ 560288 465104 95184 84%
Command history is available with the up/down cursor keys,
or with the ! operator. !4 re-runs the 4th command
entered, !-2 runs the command before last, and !! runs the
previous command again.
Extra line editing keys are available. You can use the
left/right cursor keys, ^A and ^E to move to the start/end
of the line and ^U clears the line.
Filename completion is available. Press esc, tab or ^D to
expand the current filename.
There is a cat command. Use your imagination. I'm sick
of writing documentation. Abort display with esc or ^C.
partdisp gives similar output to the Linux fdisk command:
C:\APPS\DFT>partdisp
Disk /dev/hda: 32 heads, 63 sectors, 827 cylinders
Units = cylinders of 2016 * 512 bytes
Device Boot Begin Start End Blocks Id System
/dev/hda1 1 1 254 256000+ 83 Linux native
/dev/hda2 255 255 271 17136 82 Linux swap
/dev/hda3 * 272 272 827 560448 6 DOS 16-bit >=32
C:\APPS\DFT>
Information on a different drive can be displayed, such as
with the following example:
C:\DFT>partdisp /dev/hdb
This would display information on the second hard disk in
the system.
If an invalid parameter is given, it will be ignored.
An output of 'Error 7' means that the BIOS does not
recognise your hard disk.
NOTE: The comparison of partdisp and Linux fdisk is only
a cosmetic one. partdisp cannot be used to modify the
partition table, and in fact never writes to any drive.
BUGS
No indirect blocks for a directory yet. This should not be
a major problem.
No support for symbolic links. Not a problem for me.
Neither dft nor partdisp work under dosemu via emufs.
This is not really a bug; dosemu does not allow emufs to
access the 'real' hard drive via the bios. Anybody care
to test it with whole drive access, or lredir? I would
imagine (hope!) that if dft works, it will only work if
run as root, since only root has direct access to the
device (if indeed anybody has direct access).
No security. Is this a bug? This program is defined as
a Sys. Administration tool, so only root should use it
anyway. NOTE: there is no password checking, and the
user of this program has access to any file or directory,
despite its owner/privileges.
No triple indirect for files. This means that files
transferred are limited to just over 64Mb, so is not a
real problem. Anybody transferring 65Mb files using this
method deserves all they get ;-)
The filename conversion is very limited. I would ideally
like to convert to UMSDOS names, and add a --linux-.---
file.
Files will be overwritten if they translate to the same
DOS name, i.e., transferring a file called abcdefghij,
then transferring abcdefghijk would result in both being
translated to ABCDEFGH. in DOS, so the first would be
overwritten. Since a DOS shell command is available, this
should not be a major problem.
It is possible to have the command "dft in the ini file.
This would repeatedly spawn copies of dft in memory.
There is no reasonable way I can prevent this without
severely affecting functionality. Just don't do it.
dft is just far too fast. It makes Linux itself look
quite silly. Damn, I'm bragging now.
AUTHOR
Andrew J Wales (andrew.wales@virgin.net)
1st November 1998