

Your OD has been trashed. You mount it and all you get is the system
claiming that this is a brand new disk and that it wants to initialize
it, now. You panic because You have not done any backups and all of
your past three months worth of work is on that bloddy OD.

What do you do?

Well, First, what has happened... You inserted your disk. It was either
dirty or the optics in the head assembly were dirty or something. Either 
case, the system could not read the label on your disk. Up pops the panel
asking if you want to initialize it. You push Cancel, of course, and 
out pops your disk, but not before the system marks this disk as having 
been seen before and it does that by updating the Label. Oops, there 
is no label. Well, that's ok, we'll just have to create a new label and 
we'll mark the accompanying bits maps as having not been written before.

This second act of clearing the bits maps is what trashes the disk. All 
of your data is still on the disk, it just that now the system thinks
that none of the sectors have been written before and must be initialized
before being used.

So, How to fix:
	1) Write a new correct label.
	2) Reset all of the bit maps to make the system think that
		every sector has been written to before.
	3) Fsck the disk.
	4) Eject
	5) Remount
	6) Copy your data off to someplace safe.
	7) Re-initialize the disk.


Run the new disk program with a labeling and set the now cleared bitmaps
to Written and write a new label. Below is a sample run to illustrate. You
will use the new bitmap command to set all of the bitmaps to written and you
will re-label the disk.


wallingford 504# ./disk.NEW -l omd-1 /dev/rod0a
disk name: Canon OMD-1
disk type: removable_rw_optical
Disk utility
disk> ?
commands are:
        init    initialize disk
        eject   eject disk
        read    read from disk
        write   write to disk
        verify  verify data on disk
        rw      read-after-write
        rwr     read-after-write random
        look    look at read/write buffer
        set     set read/write buffer
        label   edit label information
        host    change hostname on label
        name    change disk label name
        boot    write block 0 boot
        bad     edit bad block table
        bitmap  edit status bitmap		<<<< New Command
        stats   print drive statistics
        zero    zero drive statistics
        abort   toggle abort on error mode
        vers    toggle label version
        help    print this list
        ?       print this list
        quit    quit program

disk> label
label information: print, write? write
enter host name: wallingford
writing disk label

disk> bitmap
status bitmap: read, print, edit, change, write, stats? read	<<<< Read in existing bitmaps.

disk> bitmap
status bitmap: read, print, edit, change, write, stats? print	<<<< Having just written a new
first sector? 0							<<<< label, the first N sectors
# of sectors? 100						<<<< truely have been written.
#       status: (U=untested, B=bad, e=erased, w=written)

     0  wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
    64  wwwwwwwwwwwwwUUUUUUUUUUUUUUUUUUUUUUU			<<<< As can be seen here

disk> bitmap
status bitmap: read, print, edit, change, write, stats? stats	<<<< and the Stats command show
100.0% untested,  0.0% bad,  0.0% erased,  0.0% written		<<<< this to be true as well.

disk> bitmap
status bitmap: read, print, edit, change, write, stats? change	<<<< This changes a range of
change a range of bitmap entries				<<<< bitmaps.
first sector? 0
# of sectors? 999999						<<<< Since we do not know how
must be between 0 and 246960					<<<< sectors there are, insert
# of sectors? 246960						<<<< a very large number and
u=untested, b=bad, e=erased, w=written? w			<<<< have it tell us.

disk> bitmap
status bitmap: read, print, edit, change, write, stats? write	<<<< Write to disk.
writing bitmap

disk> bitmap
status bitmap: read, print, edit, change, write, stats? stats	<<<< Confirm. 100% of the 
 0.0% untested,  0.0% bad,  0.0% erased, 100.0% written		<<<< sectors have been written.
disk> q





wallingford 508# fsck /dev/rod0a				<<<< This fails since the first SuperBlock
** /dev/rod0a							<<<< has been trashed.

CANNOT READ: BLK 8
CONTINUE? y

THE FOLLOWING SECTORS COULD NOT BE READ: 8, 9, 10, 11, 12, 13, 14, 15,



wallingford 509# fsck -b 16 -y /dev/rod0a			<<<< So specify the second good 
Alternate super block location: 16				<<<< SuperBlock. Use -y to answer all
** /dev/rod0a							<<<< questions with a Yes.
** Last Mounted on 
** Phase 1 - Check Blocks and Sizes

CANNOT READ: BLK 215496						<<<< This will Happen a Lot and
CONTINUE? y							<<<< the console will have tons of
								<<<< messages. Like:
		od0a: read recover (ECC) block 243417 phys block 246137 (19532:0:9)
		od0a: read recover (ECC) block 243417 phys block 246137 (19532:0:9)
		od0a: read recover (ECC) block 243417 phys block 246137 (19532:0:9)
		od0a: read recover (ECC) block 243417 phys block 246137 (19532:0:9)
								<<<< So just answer all questions with
								<<<< a Yes.
THE FOLLOWING SECTORS COULD NOT BE READ: 215496,

CANNOT READ: BLK 216224
CONTINUE? y

THE FOLLOWING SECTORS COULD NOT BE READ: 216224,

CANNOT READ: BLK 218920
CONTINUE? y
THE FOLLOWING SECTORS COULD NOT BE READ: 218923,

THE FOLLOWING SECTORS COULD NOT BE READ: 221120,
CANNOT READ: BLK 239264
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 239264, 239266, 239267, 239269,

CANNOT READ: BLK 239272
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 239272,

CANNOT READ: BLK 240744
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 240744, 240747, 240751,

.
.
.
.

CANNOT READ: BLK 241952
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 241952, 241953, 241954, 241955, 241958,

CANNOT READ: BLK 241960
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 241960, 241967,

CANNOT READ: BLK 243424
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 243424, 243425, 243426, 243427, 243428, 243429, 243430, 243431,

CANNOT READ: BLK 243432
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 243432, 243433, 243435, 243437, 243438, 243439,
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
BLK(S) MISSING IN BIT MAPS
SALVAGE? 

CANNOT READ: BLK 228472
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 228472,
CG 317: BAD MAGIC NUMBER
WRITING ZERO'ED BLOCK 228472 TO DISK

CANNOT READ: BLK 231896
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 231896,
CG 322: BAD MAGIC NUMBER
WRITING ZERO'ED BLOCK 231896 TO DISK
.
.
.
.
CANNOT READ: BLK 242680
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 242680, 242681,
CG 337: BAD MAGIC NUMBER
WRITING ZERO'ED BLOCK 242680 TO DISK

CANNOT READ: BLK 243416
CONTINUE? 
THE FOLLOWING SECTORS COULD NOT BE READ: 243416, 243417,
CG 338: BAD MAGIC NUMBER
3029 files, 80134 used, 152932 free (1052 frags, 18985 blocks, 0.5% fragmentation)
WRITING ZERO'ED BLOCK 243416 TO DISK

***** FILE SYSTEM WAS MODIFIED *****



Now the disk can be ejected and re-mounted.

wallingford 513# disk -e /dev/rod0a
disk name: Canon OMD-1
disk type: removable_rw_optical
wallingford 514# 

Note: the mount point that you may have had has been changed to omd-1.
Now go and copy your files off, re-initialize the disk and copy them
back. The disk is still good and simply cleaning the disk before
re-initializing it will make the disk re-usable for a long time.

	Thanks
	Cal

p.s. This is fixed in 2.0, I've heard.





