Q how do you patch a 4.2 filesystem, to make it smaller

Bill Vaughn bill at ur-cvsvax.UUCP
Tue Feb 19 02:17:12 AEST 1985


> We just finished upgrading from 4.1 BSD to 4.2
> and I just noticed a problem with our users filesystem.
> We have all our users on a ra81, and i made the file
> system using "newfs ra0f ra81". That caused a file system
> of size 478582 blocks to be created starting some where in
> the middle of the disk, and going to the end.
> 
> After making the filesystem I did a "restore r" to read in the
> old data from the 4.1 dump tapes. The did a "fsck /dev/ra0f" and
> fsck complains about being "unable to read block 478580".
> 
> Futher investagation shows that blocks 478580, 478581 cannot be read.
> 
> I have tried changing the value of "fs_size" in the super block, and then
> running fsck, but the 4.2 fsck is smarter than the 4.1 fsck, and it changed
> the value back to the original. I also tried changed both "fs_size" and
> "fs_dsize", but then fsck really complains.
> 
> So my question is how can get 4.2 to not look at those 2 blocks.
> 
> Any advice would be welcome, since the only alternative i can see is
> writting out to tape, rebuilding the partition, and reading back again.
> Since with tu80 drives this would take about 9-10 hours, (on a weekend too)
> I would like to avoid doing that.
> 

Take a look at the badsect(8) command.  Once you've pinned down the sector
numbers, badsect(8) allows you to communicate the facts to fsck(8).
You can't fix bad blocks which occur in the swap area or the i-list of a
file system.  In that case you'll just have to rearange your file systems.

Also be aware that HARD bad block errors occur spontaneously on RA's, ( and
sometimes recover too).  It's good to have a program that every week or so
reads all the blocks of a file system and reports blocks it can't read.
This should be done for all file systems and the swap area too. Sometimes
the system will do this before you can get to it.  Just record the block,
dismount the filesystem, run badsect(8) and fsck(8) and remount the system.
(Of course, the system has to be shutdown and rebooted if this happens on
the root filesystem or any active filesystem).

	Bill Vaughn
	UNIV. OF ROCHESTER
	Center for Visual Science
	{allegra,seismo,decvax}!rochester!ur-cvsvax!bill



More information about the Comp.unix.wizards mailing list