From owner-freebsd-hackers Sun Mar 30 06:54:35 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id GAA27145 for hackers-outgoing; Sun, 30 Mar 1997 06:54:35 -0800 (PST) Received: from plum.cyber.com.au (plum.cyber.com.au [203.7.155.24]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id GAA27134 for ; Sun, 30 Mar 1997 06:54:27 -0800 (PST) Received: (from darrenr@localhost) by plum.cyber.com.au (8.6.12/8.6.6) id AAA28455 for hackers@freebsd.org; Mon, 31 Mar 1997 00:54:11 +1000 From: Darren Reed Message-Id: <199703301454.AAA28455@plum.cyber.com.au> Subject: dump & restore for MS-DOS filesystems. To: hackers@freebsd.org Date: Mon, 31 Mar 1997 00:54:11 +1000 (EST) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Well, a seemingly hard task has been completed...how "complete" it is, I won't venture to say, except that I've hacked on dump & restore enough to make them both work on MS-DOS format file systems. I'm pretty confident that dump is working correctly: for each file, it dumps the entire cluster of sectors that are allocated to it and directories are the same. restore works...but is very naive about long names, etc. I'm not quite sure where any translation between modes should be done, as well as the extra info. that gets stored in the directory blocks. For now, those entries are just ignored (even though they are on the backup `tape'). When restoring, it uses the mode bits as they are for the MS-DOS file. I'd really like to hear back if anyone has any useful ideas on what to do with file permission bits. I've been working, compiling and testing on FreeBSD-2.1.6. The source is available at: ftp://ftp.cyber.com.au/pub/unix/dump_msdos.tgz ftp://ftp.cyber.com.au/pub/unix/restore_msdos.tgz (and retains the BSD copyrights...) Oh, one last question, is it ok to add these to the -current tree, under usr.sbin for FreeBSD ? (At this point they've really just been hacked until they work in an `expected' manner). Darren sample output: % ll /dos/d/SDD total 1208 -rwxrwxr-x 1 root wheel 334 Dec 10 11:14 file_id.diz* -rwxrwxr-x 1 root wheel 561132 Jan 25 00:52 install.dat* -rwxrwxr-x 1 root wheel 62122 Jan 24 22:07 install.exe* -rwxrwxr-x 1 root wheel 5211 Dec 12 17:01 readme.txt* -rwxrwxr-x 1 root wheel 595133 Mar 17 00:53 sdd53a-d.zip* % ./dump_msdos 0f - /dos/d > wd1s0.dump DUMP: Date of this level 0 dump: Sun Mar 30 23:37:19 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: 17408 tape blocks DUMP: DUMP IS DONE % ./restore_msdos ivf ../dump_msdos/wd1s0.dump Verify tape and initialize maps Tape block size is 32 Dump date: Sun Mar 30 23:37:19 1997 Dumped from: the epoch Level 0 dump of /dos/d on freebsd:/dev/wd2s1 Label: NO NAME FAT16 Extract directories from tape Volume: [MS-DOS_6 ] Initialize symbol table. restore > ls .: 2 *./ 3 NETSCAPE/ 2629 S16DW3UP/ 489 SBBASIC/ 2810 WIN32S/ 2811 CTCM31BB/ 1283 RECYCLED 1671 S2/ 1672 SDD/ restore > add SDD Make node ./SDD restore > restore > extract Extract requested files You have not read any tapes yet. Unless you know which volume your file(s) are on you should start with the last volume and work towards towards the first. Specify next volume #: 1 extract file ./SDD/FILE_ID.DIZ extract file ./SDD/INSTALL.EXE extract file ./SDD/README.TXT extract file ./SDD/INSTALL.DAT extract file ./SDD/SDD53A-D.ZIP Add links Set directory mode, owner, and times. set owner/mode for '.'? [yn] n restore > % ll -d SDD d----w---- 2 darrenr cyber 512 Oct 17 1972 SDD/ % chmod 755 SDD % ll SDD total 1220 ----r----- 1 darrenr cyber 334 Sep 21 1972 FILE_ID.DIZ ----r----- 1 darrenr cyber 561132 Oct 11 1972 INSTALL.DAT ----r----- 1 darrenr cyber 62122 Oct 11 1972 INSTALL.EXE ----r----- 1 darrenr cyber 5211 Sep 21 1972 README.TXT ----r----- 1 darrenr cyber 595133 Oct 18 1972 SDD53A-D.ZIP % chmod u+r SDD/* % cd SDD % foreach i (*) foreach? cmp $i /dos/d/sdd/$i foreach? end %