Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!ukma!mailrus!cornell!parmelee From: parmelee@wayback.cs.cornell.edu (Larry Parmelee) Newsgroups: comp.bugs.4bsd Subject: Re: 4.3 Tahoe dump bug Keywords: dump bug Message-ID: <23642@cornell.UUCP> Date: 19 Dec 88 13:06:27 GMT References: <23685@pprg.unm.edu> Sender: nobody@cornell.UUCP Reply-To: parmelee@wayback.cs.cornell.edu (Larry Parmelee) Organization: Cornell Univ. CS Dept, Ithaca NY Lines: 63 In article <23685@pprg.unm.edu> cyrus@pprg.unm.edu (Tait Cyrus) writes: > > In the process of trying to get the 4.3 Tahoe dump running on a Sun 3 > running SunOS 3.X, I, along with others, have run into the following > bug (feature) (shown below). > > DUMP: mapping (Pass II) [directories] > > DUMP: (This should not happen)bread from /dev/rxy1g [block 58766]: count=24, got=512 > > DUMP: (This should not happen)bread from /dev/rxy1g [block 60802]: count=536, got=1024 [ Lots of "bread" errors on pass 2. ] Under 4.2 (on which Sun 3.x is based) directories were allowed to be any old size, whatever was convienient. Under 4.3, as an efficiency hack, directories were forced to be multiples of 512 bytes. The 4.3 dump expects this, and will generate errors like you're seeing when confronted with an old 4.2 filesystem containing random length directories. (4.3 fsck will extend any short directories it finds, and thereafter the kernal will maintain the convention). Below is my fix, in file dumptraverse.c, routine dsrch(). I think this was all I had to change to get the 4.3 dump to work under sun3.5. But there is one other slight problem- If you do your dumps on 9-track 6250 bpi tape, the 4.3 dump likes to block the tape records at 32k/block. The sun restore program is only expecting 10K blocks. (other than that, the sun restore seems to work fine with a 4.3 dump dumptape.) The solution is to change the definition of HIGHDENSITYTREC in /usr/include/dumprestore.h to be 10, OR resign yourself to doing restores with "dd if=/dev/rmt8 ibs=32k obs=10k | restore f -", OR fix restore. NOTE: I don't have 4.3-Tahoe, so there's a little uncertainty here. Also, I don't know if this is needed with SunOS 4.X, or if maybe sun 4.X is now following the same directory size conventions. -Larry Parmelee parmelee@cs.cornell.edu *** /tmp/,RCSt1a02738 Mon Dec 19 07:46:46 1988 --- dumptraverse.c Tue Sep 1 09:38:18 1987 *************** *** 261,267 **** --- 261,279 ---- return; if (filesize > size) filesize = size; + #ifndef sun bread(fsbtodb(sblock, d), dblk, filesize); + #else /* sun */ + /* Round up filesize to be a multiple of DEV_BSIZE. */ + #if (DEV_BSIZE != 0) && ((DEV_BSIZE & (DEV_BSIZE - 1)) == 0) + /* If DEV_BSIZE is a power of two: */ + bread(fsbtodb(sblock, d), dblk, + ((filesize+DEV_BSIZE-1) & ~(DEV_BSIZE-1))); + #else + bread(fsbtodb(sblock, d), dblk, + ((filesize+DEV_BSIZE-1)/DEV_BSIZE)*DEV_BSIZE); + #endif + #endif /* sun */ for (loc = 0; loc < filesize; ) { dp = (struct direct *)(dblk + loc); if (dp->d_reclen == 0) {