Skip site navigation (1)Skip section navigation (2)
Date:      28 Sep 1998 14:49:17 +0200
From:      dag-erli@ifi.uio.no (Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?= )
To:        scsi@FreeBSD.ORG
Subject:   mt fsf 1 times out
Message-ID:  <xzphfxs767m.fsf@bergelmir.ifi.uio.no>

next in thread | raw e-mail | index | archive | help
I had a CAM+softupdates crash yesterday (no panic message, no core
dump, no nothing; I suspect the kernel dropped into the debugger,
which doesn't work too well if X is running. When I rebooted, I found
my /usr totally hosed (looks like the root directory entry had been
blown away) and fsck failed miserably ("no space in lost+found,
sorry"), so I thought what the heck, I have a week-old level 0 dump
and there's nothing in /usr except the "usual" (bin, sbin, libexec,
share, and X) since I have /usr/local, /usr/src and /usr/obj on
separate file systems, and my ports tree is in /usr/local (which
allows me to mount /usr ro - unfortunately, it wasn't ro when the
crash happened for some reason I can't remember). So I newfs'ed /usr,
copied back what I needed (make, mtree, a couple of libs) from
/usr/obj/elf/usr/src/tmp/usr/*, recreated the /usr hierarchy with
'mtree -eU' and ran make install. So far so good.

But now I want to restore my X tree (/usr/X11R6) from tape. The
problem is that there are several dumps on the tape, and I can't seek
to the right one. Here's what the tape looks like (from memory):

 1) level 0 dump of /
 2) level 0 dump of /home          <--- this is a biggie
 3) level 0 dump of /usr           <--- this is the one I want
 4) level 0 dump of /var
 5) level 0 dump of /home/cvs
 6) level 0 dump of /home/ncvs

The reason why /home is so big is that I have two complete FreeBSD
distributions laid out under /home/ftp (for network installs). I agree
it's kinda dumb to dump it to tape when I have them on CD-ROM, but I
just stuffed in the tape and ran the script (which extracts the list
of file systems to dump from /etc/fstab, which is the reason for the
boneheaded layout - /home should have been last)

The problem is that 'mt fsf 2' from the beginning of the tape (or 'mt
fsf 1' after 'mt rewind; mt fsf 1' to seek past /) takes more than an
hour, and I get a timeout after precisely one hour (give or take five
seconds). What I get is the usual "timed out while idle", followed by
a "Power on, reset, or bus device reset occurred", followed by the
tape rewinding (much faster than it can wind forward)... This seems
consistent with the code (saspace() in sys/cam/scsi/scsi_sa.c calls
scsi_space with a timeout of 60*60*1000 ms)

I thought of winding the tape forward "manually" bit by bit (by doing
'mt fsr xxx') but I can't seem to find the right count. If I rewind
the tape and do 'mt fsr 1000' followed by 'mt fsf 1', I get to /home
as expected. I have a log of the dump, so I know the size of each
section, but how many blocks are in a record? What count should I use
to wind the tape forward ~2100000 blocks? (of course I intended to do
it in several smaller steps so that none of the individual steps took
more than an hour).

Of course, I can hack my kernel to use a longer timeout, but I'd like
to know the answer to those questions all the same...

OBTW, I browsed through some of the CAM code while researching this
and I have to hand it to you guys, it's such *beautiful* code... :)

DES
-- 
Dag-Erling Smørgrav - dag-erli@ifi.uio.no

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzphfxs767m.fsf>