Subject: dump for MS-DOS partitions.
To: None <hackers@freebsd.org, port-i386@NetBSD.ORG>
From: Darren Reed <darrenr@cyber.com.au>
List: port-i386
Date: 03/24/1997 23:37:26
Well, after a days work, it's done.  well, I think it works :)

Some weirdness I found along the way included strange directory entries
created by Windows NT (and I suspect 95 will do the same) which have the
read only, hidden, system and volume flags set (i.e value of 0x0f).

dump won't dump those because I don't know what to do with them.

Unfortunately, restore doesn't work with the dump file created, but I'm
not sure yet whether it is because it isn't a UFS dump or I've not done
something right.

What I do believe is that restore will need to be modified too, as the
standard restore probably won't translate file permissions correctly, etc.

It's reasonable efficient, Pass I and Pass II had to be combined due to
the lack of a meaningful inode table type setup and is quicker than a
recursive ls (as you'd hope!) of a disk.

If you want to grab it and play, it is at:

ftp://ftp.cyber.com.au/pub/unix/msdump.tgz

If you look too closely, you'll notice that I copied and hacked on dump's
.c and .h files, as well as copying .h files from /sys/msdosfs.  This is
pretty much just a reflection of the desire to "make it work" rather than
"get it right", however I don't believe you can combine this with dump for
ufs due to the nature of the code (global variables everywhere).

If anyone has some comments (or bugs :), please send them.  Ideally, if the
code was cleaned up (along with .h use), it might be a candidate for
including in a release.

To make life a bit easier, I treated clusters as inodes (for creating the
maps, etc).  Oh, a few points on how I populated dinode:

date + time -> atime, ctime, mtime
user running dump -> uid, gid
attributes -> mode
size / sectors_per_cluster -> blocks

Darren

Sample output:
% time ./msdump 0f - /dev/rwd2s1 > wd2s1.dump
  DUMP: Date of this level 0 dump: Mon Mar 24 22:27:25 1997
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rwd2s1 (/dos/d) to standard output
  DUMP: mapping (Pass I) [regular files, directories]
  DUMP: estimated 17359 tape blocks.
  DUMP: dumping (Pass II) [directories]
  DUMP: dumping (Pass III) [regular files]
  DUMP: DUMP: 17142 tape blocks
  DUMP: DUMP IS DONE
0.910u 2.355s 0:32.88 9.9% 341+4643k 7+290io 0pf+0w

% restore ivf wd2s1.dump
Verify tape and initialize maps
Tape block size is 32
Dump   date: Mon Mar 24 22:27:25 1997
Dumped from: the epoch
Level 0 dump of /dos/d on freebsd:/dev/wd2s1
Label: none
Extract directories from tape
. is not on the tape
Root directory is not on tape
abort? [yn] n
Initialize symbol table.
restore > ls
restore > 
%

p.s. this is like real alpha stuff, version 0.0 if you like ;)
p.p.s I used freebsd 2.1.6.1 src as a starting point for hacking.