home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp
- Path: sparky!uunet!ukma!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!news.th-darmstadt.de!misch
- From: misch@rbhp90.rbg.informatik.th-darmstadt.de (Clemens Misch)
- Subject: Re: Recovering from disk with bad blocks
- Sender: news@news.th-darmstadt.de (The Usenet-News System)
- Message-ID: <1992Aug19.133000.23308@news.th-darmstadt.de>
- Date: Wed, 19 Aug 1992 13:30:00 GMT
- Reply-To: misch@rbhp90.rbg.informatik.th-darmstadt.de
- References: <Bt6ryz.Iq2@knot.ccs.queensu.ca>
- Nntp-Posting-Host: rbhp90.rbg.informatik.th-darmstadt.de
- Organization: Rechnerbetriebsgruppe FB20; TH Darmstadt (Germany)
- Lines: 66
-
-
- In article <Bt6ryz.Iq2@knot.ccs.queensu.ca>, heisz@sparky.uucp (Jeff Heisz) writes:
- > "What to do when you get this error" the notes for fsck say that if
- > the error is
- >
- > CANNOT READ BLCK ##:
- >
- > the diagnositc is: this never happens. if it does consult a guru.
- >
- > The information on this disk is precious to the nth degree. It is not
- > backuped (of course, else why would I ask you this). Any ideas on
- > recovering the info? It is the SCSI disk for one of HPs and so the
- > OS is HP-UX.
-
- In general, you can't recover these block with *standard* HPUX tools.
- But if you ar willing to learn a bit about SCSI Commands, and with a
- little C-programming you might get some data.
- Almost every SCSI Disk supports the READ LONG command. This transfers
- a single Block with ECC Bytes.
-
- Under HPUX you can send arbitray SCSI Commands with a program like
- this. You have to be uid 0 to do this.
-
- #include <sys/scsi.h>
-
- ....
- int on = 1;
- int device;
-
- struct scsi_cmd_parms command_block;
- char buffer[2048]; /* or somet appropriate structure */
- union sense_data sense_buffer;
- ...
- device = open("/dev/rdsk/0s0",O_RDWR); /*
-
- ...
- ioctl(device,SIOC_CMD_MODE, &on);
- ...
- command_block.cmd_type = /* length of SCSI command 6,10,12 */
- command_block.cmd_mode = 1 or 0; /* With ATN or without */
- command_block.clock_ticks = /* timeout in 20 ms ticks */
- command_block.command[i] = /* Your SCSI Command goes here */
-
- ioctl(device,SIOC_SET_CMD, &command_block);
-
- if (read(device, buffer, /*Blocklength to transfer */) == -1 ) {
- ioctl(device, SIOC_XSENSE, sense_buffer);
- }
- /* if your SCSI command expects some additional data then use
- a write (instead of read) with this data */
-
- .....
-
- Something like this appeard sometime ago in this newsgroup. It works
- fine for me.
-
- I hope this will help you.
-
-
- --
- ===============================================================================
- Clemens Misch Rechnerbetriebsgruppe FB20
- Merckstrasse 25
- EMail: misch@rbhp90.rbg.informatik.th-darmstadt.de W6100 Darmstadt (Germany)
- Tel.: +49 6151 163514
- ===============================================================================
-