Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: Help me before I die again. (bad sector stuff) Message-ID: <10815@mimsy.UUCP> Date: 26 Mar 88 21:37:33 GMT References: <2390@mandrill.CWRU.Edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 91 Keywords: HELP bad144 In article <2390@mandrill.CWRU.Edu> edguer@mandrill (Apostle of Zeus) writes: > up2c: hard error sn38696 cn=241 tn=4 sn=9 >I decided to mark the sector as bad using bad144(8). > bad144 rm03 up2 >returned a two page list - 126 entries. The entries were not in >order, and of course there is only room for 126 entries in the bad >sector list. Two strikes. >From speaking with Keith Bostick, it would appear that something >overwrote the bad sector table. So I decided to simply create a new >one. (Bostic: no `k'.) Most likely, your file system uses the whole area in up2c. Since the C partition in the `up' driver includes the bad sector table, this is a bad thing. If you have not changed the size of your file system, you may lose that area again. You can check the size of your file system with `dumpfs' (multiply `blocks' times `fsize/512' to get number of sectors). Your best bet is not to use the last cylinder of such a device. (The same goes for `hp' and `rk' disks. `ra' disks are generally safe; the bad sector area is beyond the reported end of media. The distributed RA60 or RA80 tables are, however, wrong. I forget which it is; probably RA60.) >According to bad144(8) > "The -f option may be used to mark the new bad sectors as 'bad'" ... but only if the device driver supports it ... >So I tried > bad144 -f rm03 up2 1752457552 38696 >It didn't work. Instead I received the error message: > ioctl: no such device ... and apparently the up driver does not. >... I double checked the table and 38696 was still in the table. >SO, HOW DO I MARK A SECTOR BAD ?????? Rewrite the sector header. If the driver will not let you do it, you will have to reformat (or change the driver). Some disks do not allow rewriting individual sector headers, making this particularly hard. >Since bad144 wasn't helping me I thought I would try using badsect so... > mount up2c /usr2 > mkdir /usr2/BAD > cd /usr2 > badsect /usr2/BAD 38696 >Instead of solving my problem I got back an error message > block 38696 in non-data area: cannot attach >Any ideas on what that means? That means block 38696 is in one of the inode or cylinder group areas, and cannot be allocated as a file block. >My eventual solution was to reformat the disk. Probably the easiest fix. Just make sure your file system does not overlap the bad sector table! It is generally best not to use the `c' partitions for file systems; when we redid the partitioning on our two large Vaxen, I made `h' partitions for `all but the bad sector table' file systems: brillig% disklabel hp4 # (this is a 4.3BSD-tahoe command) # /dev/rhp4c: type: SMD disk: eagle label: flags: badsect bytes/sector: 512 sectors/track: 48 tracks/cylinder: 20 sectors/cylinder: 960 cylinders: 842 rpm: 3961 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds [these are not used yet anyway -Chris] drivedata: 0 3 8 15 8 partitions: # size offset fstype [fsize bsize cpg] a: 63360 0 unused 512 4096 # (Cyl. 0 - 65) b: 63360 63360 swap # (Cyl. 66 - 131) c: 808320 0 unused 512 4096 # (Cyl. 0 - 841) d: 680640 126720 unused 512 4096 # (Cyl. 132 - 840) h: 807360 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 840) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris