From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kdea@alpine-la.com Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: cannot remove corrupt file Date: Thu, 03 Apr 2003 11:58:54 -0800 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1049399940 5960 80.91.224.249 (3 Apr 2003 19:59:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2003 19:59:00 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Thu Apr 03 21:58:57 2003 Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.22.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 191ArQ-0001XT-00 for ; Thu, 03 Apr 2003 21:58:56 +0200 Original-Received: (qmail 25523 invoked by uid 5); 3 Apr 2003 19:59:04 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 25514 invoked by uid 49493); 3 Apr 2003 19:59:04 -0000 Original-Received: from kdea@alpine-la.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(-0.1/5.0):. Processed in 0.49832 secs); 03 Apr 2003 19:59:04 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 3 Apr 2003 19:59:03 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HCS009YIA6DF0@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 03 Apr 2003 14:59:02 -0500 (EST) Original-Received: from dodo.prod.itd.earthlink.net (dodo.mail.pas.earthlink.net [207.217.120.99]) by emroute1.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HCS00H9DA67GA@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 03 Apr 2003 14:58:56 -0500 (EST) Original-Received: from sneezy.alpine-la.com (user-119bt68.biz.mindspring.com [66.149.244.200]) by dodo.prod.itd.earthlink.net (8.9.3/8.9.3) with ESMTP id LAA19112 for ; Thu, 03 Apr 2003 11:58:55 -0800 (PST) Original-Received: from it-laptop.alpine-la.com ([172.21.6.100]) by sneezy.alpine-la.com (Lotus Domino Release 5.0.11) with ESMTP id 2003040311570146:2428 ; Thu, 03 Apr 2003 11:57:01 -0800 Original-To: tru64-unix-managers@ornl.gov X-Mailer: Lotus Notes Build V60_M14_08012002NP Release Candidate August 01, 2002 X-MIMETrack: Serialize by Notes Client on Kevin F Dea/Alpine-La(Build V60_M14_08012002NP Release Candidate|August 01, 2002) at 04/03/2003 11:58:54 AM, Serialize complete at 04/03/2003 11:58:54 AM, Itemize by SMTP Server on sneezy/Alpine-La(Release 5.0.11 |July 24, 2002) at 04/03/2003 11:57:01 AM, Serialize by Router on sneezy/Alpine-La(Release 5.0.11 |July 24, 2002) at 04/03/2003 11:57:02 AM, Serialize complete at 04/03/2003 11:57:02 AM Xref: main.gmane.org gmane.os.tru64.managers:3886 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:3886 Hi Managers, Let me first thank Alan Rollow and Michael Polnick for their help. They both suggested using the scm utility to reassign the inodes and fsck afterwards. I have posted both suggestions as they may help future readers. I however did cop out on the problem, the data on the disk was scrach space and not critical, and we did have a maintainance agreement, so we simply swapped it out the bad disk with a brand new one. ---begin Alan's comments--- You may have more than one bad sector. I would: o Scan the disk to find all the blocks that can't be read and note them. scu(8) has access to a SCSI command that tells the disk to get its data, but transfer the data, allowing it to run at internal disk transfer speeds. I don't recall with the interface to the command is verify or scan. One just reads, but the others writes and then reads. BE VERY CAREFUL... Alternatively, use dd(1) to read the raw partition. o Having noted the blocks that are bad, use icheck and ncheck to see what files and file system data structures they belong to. The failure of clri(8) almost certainly meant that there was a bad block in the relevant inode space. That's going to affect a bunch of files. o Once you essay the damage, line up your backups, so you can restore anything that is about to disappear. For sufficiently wide spread damage, sometimes it is easier just to restore the whole file system. o Use scu(8) to reassign the bad blocks to better blocks. This probably won't be able to recover a good copy of data, which will guarantee the data is now corrupt, but they'll be readable. o Run fsck(8) and let it repair the damage. o Restore and/or rename missing or lost files. Whether the crash caused the corruption, the corruption caused the crash or both were cause by some 3rd problem is hard to tell. ---end Alan's comments--- ---begin Michael's comments--- you can manually reassign defective blocks with scu. The partition must be umounted. scu -f /dev/rrz5c scu> verify media options dpo # if you would check the whole partition takes some time scu> reassign lba after that you should check with fsck. ---end Michael's comments--- ---original message--- We had a crash recently while a user was editing a file, resulting in a corrupt file that cannot be viewed, "ls -la", or delete. I've already unmounted it and ran fsck on it, and it shows some unreadable blocks: CANNOT READ: BLK 65923744 CONTINUE? [yn] y THE FOLLOWING DISK SECTORS COULD NOT BE READ: 65923746, 65923749, When I ran: # icheck -b 65923746 /dev/rrz5c /dev/rrz5c: 65923746 arg; frag 1 of 8, inode=7776704, class=inodes 7776704-7776768 files 303551 (r=302724,d=719,b=0,c=0,sl=108,sock=0,fifo=0) used 22918478 (i=7362,ii=969,b=2795861,f=484942) free 11855350 (b=1480423,f=11966) missing 37 I tried to remove the offending inode using clri, but I get an i/o error. # clri /dev/rrz5c 7776704 clearing 7776704 clri: /dev/rrz5c: I/O error Is there anything I can do next to delete the file, and mark the bad sector? The machine is an DS20 running 4.0f pk 7. The filesystem is ufs. -- Kevin Dea UNIX System Administrator Alpine Electronics Research of America