Summary: Trashed disk label with Sybase install - am I hosed?

From: Dan Jiracek (djiracek@jupiter.fnbc.com)
Date: Fri Sep 03 1993 - 14:15:21 CDT


Well here's how it went.

The drive that was hosed was an ANDATACO 240P5 Micropolis 1924 (sd3) , sd1 is the same type of drive but the raw sybase
partition came after a different partition and therfore was still good. When I went into format it did not know what type of
drive it was but gave me a list of choices, 1 of which was ANDATACO 240P5 Micropolis 1924. After selecting that it came up
with the partition table of sd1 !!!! (Explain that batman).

Many people suggested using the backup utility in format, which I did but it kept on coming up with sd1's partition table. Well
an astute person did a dkinfo on sd3 before it was hosed, so we had the partition table. We were using sd3b and sd3d as raw
Sybase partitions and sd3g as a regular UNIX partition (/usr/sybase). All I had to do was start sd3b at 1 and shorten it by 1.
sd3d and sd3g were the same. I labeled the disk and bingo it was OK (except of course sd3b). /usr/sybase mounted fine. Our
sybase person said it wouldn't be too hard to reconstruct sd3b which was the log raw device.

Thanks to :
cxh@ohm.EECS.Berkeley.EDU
egendre@meteo.fr (Gerard Legendre)
"Rick Wightman" <wightman@jupiter.csd.unb.ca.>
canuck@masc38.rice.edu (Mike Pearlman)
 shandelm@jpmorgan.com (Joel Shandelman FIMS Information Systems - 212-648-4480)
 colemr@nwtss1.eq.gs.com (Regan Coleman)
tyvand@fnbc.com (Ty Van Duong)
dougj@iplab.health.ufl.edu (Doug Jones)
 larry@ma.pdc.com (Larry Freeman)
Mike Raffety <miker@il.us.swissbank.com>
--------------------------------------------------------------------------------------------------------------------
Some responses:
>From: cxh@ohm.EECS.Berkeley.EDU

BTW - same thing happens with Ingres.

It turns out that if your logfile partition starts at block 0, then
you hosed the lable. Ingres installation checks to see if you are
trying to put the log file in partition a or c, however, we had
partition d starting at block 0. :-(

*If you have not modified the partition sizes away from what is in
/etc/format.dat, then you should be able to use format to relabel the
disk. Start up format and go to partition, select a partition and
label the disk.

*If you know the partition sizes and start blocks, then you
can use format to edit the partition sizes.

The thing I do is run a nightly script that does a dkinfo on the disks
of all of my machines. dkinfo provides enough info to rebuild the
label, even if you modified the partitions sizes away from the
predefined layouts in /etc/format.dat.

You might be able to guess the partition sizes (don't laugh, I've done
it). Usually partitions start on an integer cylinder like 50/0/0, and
not 50/0/1. Try different cylinder counts. (I may have my terminology
wrong here)
--------------------------------------------------------------------------------------------------
I remember I trashed a disk label in another way and I used "backup" choice
of the format command.
------------------------------------------------------------------------------------------------
Try looking in your boot messages (/var/adm/messages ?). When your system does
a cold boot it lists all the SCSI things it finds, and for disks this includes

labels. You should be able to recontruct the information and relabel the disk

with 'format'. Things should be on a roll then.
-------------------------------------------------------------------------------------------------
Do the following
        1) run format
        2) select the appropriate disk when format comes up
        3) enter the format command
                backup
        4) I always relabel as well although it should be unnecessary
                label
----------------------------------------------------------------------------------------------------------------------
The way to write the label is to use the format command.
As a rule, when installing SQL Server, we always reserve
the first two cylinders of a disk for its own partition
so later administrators don't make the same mistake.

        The other common mistakes:
        1) Using a partition already in use, or one that
        overlaps with another partition in use.

        2) Not documenting the Sybase partitions in
        the /etc/fstab with the 'ignore' option, or
        commented out. Though forgetting to document
        the partition does not cause any immediate
        problems, the next guy down the road might
        inadvertently assume the partition is not
        in use, use it, and write over Sybase data.

        3) Forgetting to make sure the shared memory,
         lightweight process, and asynchio options
        are enabled in your kernel.
-------------------------------------------------------------------------------
try running format and looking for backup labels
There is a backup command under format.
Sybase should really fix this *problem*. Informix fixed it
before they released their Turbo product 5 years ago.
-------------------------------------------------------------------------------------
You can rewrite the label on the disk by simply using the 'label' command
in 'format'. Hopefully you have a record somewhere of what the partition
tables were for that drive. By rewriting the label, you won't write to any
other portion of the disk. Of course, this assumes that Sybase ONLY trashed
the label and didn't touch data, inodes, superblocks.....
----------------------------------------------------------------------------------------------------------------------
-Original message:

Sender: sun-managers-relay@ra.mcs.anl.gov
Precedence: bulk
>From: djiracek@jupiter.fnbc.com (Dan Jiracek)
Reply-To: djiracek@jupiter.fnbc.com (Dan Jiracek)
Followup-To: junk
Date: Thu, 2 Sep 93 22:42:45 -0500
To: sun-managers@eecs.nwu.edu
Subject: Trashed disk label with Sybase install - am I hosed?

OK Big mistake. When installing Sybase you should NOT start with partition 0.

Otherwise you will trash the disk label. Well the damage is done. Now the

6 million dollar question (6 hour installation) is: Is there a way to recover/rewrite the disk label?

Hopefully I am not the 1st to do this. Hopefully you won't ever do this.

Humbly yours,

Dan Jiracek
Systems Officer/Network Specialist
First Chicago Bank



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:09 CDT