Many thanks for all the excellent suggestions!!
To summarize, there were three general solutions which worked, and
a fourth which I did not try:
1) Zero out label, rewrite, then edit
a. disklabel -z "disk partition"
b. disklabel -wr "disk" "disk_type"
b. disklabel -e "disk partition"
2) Two-step process
a. change fs type to unused via 'disklabel -s unused "partition to
edit" '
b. edit disklabel via 'disklabel -e "partition to edit"'
3) Save copy of label as ASCII file, zero label, write default label,
modify ASCII saved file, then restore
a. disklabel "disk root partition" > "filename"
b. disklabel -z "disk"
c. disklabel -wr "disk" "disk_type"
d. Now edit "filename" from step 1 above for new label info
e. disklabel -R "disk" "filename"
4) Use V3.2C or V3.2G Cversion of disklabel, which I did not try.
All three methods work, but I personally liked #3. I like the idea of
having an ASCII version of the original label info which you can edit
using your preferred editor. This gives you a chance to edit the label
information "offline", so to speak, before applying changes to your real
disk label. I even made a backup copy of the original ASCII file, so that
I could "revert" back to the original label info in case of errors. This
method is especially useful if you are not fluent with the native
navigation keys of your chosen editor, "vi" in my case (which I am
terrible at using, but prefer over "ed").
For the benefit of all the other "non-gurus" like myself, here are the
specific commands which I used (excuse the redundancy):
1. disklabel -r /dev/rrz1a > /tmp/rzlbl.txt
2. disklabel -z /dev/rrz1a
3. disklabel -wr rz1 ST34371N
4. Backup original ASCII file then make changes;
a. cp /tmp/rzlbl.txt /tmp/rzlbl_sav.txt
b. vi /tmp/rzlbl.txt
5. disklabel -R rz1 /tmp/rzlbl.txt
CREDITS:
A very special thanks to the following contributors (grouped by suggested
method):
1) ZERO OUT LABEL, REWRITE, THEN EDIT
>From: Joe Spanicek <joe_at_resptk.bhp.com.au> >
>
>Hi,
>
>Try first using the '-z' option of disklabel - that clears the disklabel
>info on the disk. You may then have to change the '/etc/disktab' file for
>the type of disk you have, changing the partition sizes. Then let
>disklabel write this info to the hard disk. **
**
>From: Kimble Britten Webb <kimble_at_maths.unsw.edu.au>
>
>i think i had something like this - too many other bits under the bridge
>try zero ing it and then rewritting - i think that works
**
>From: Stephen Cooper <stephen.cooper_at_alphawest.com.au>
>
>Yes this is a killer, I had many ours of fun with this one. You cannot
>do waht you are trying to do. I have tried it myself.
>
>The tricks is
>disklabel -z /dev/rrz1a <<<<<<< Zero the disk label
>(blanks it out)
>disklabel -rw /dev/rrz1a rz28m <<<<<<< Writes the default label
>for your disk type
>Then recreate your filesystems or domains.
**
>From: Mitch Bertone <mbertone_at_gtech.com>
>
>Joe,
>try a disklabel -z /dev/rrz1c to first zero the entire label
**
2) TWO-STEP PROCESS; A. CHANGE FS TYPE TO UNUSED, THEN B. RUN DISKLABEL
AGAIN TO CHANGE SIZES
>From: "Alan Rollow - Dr. File System's Home for Wayward Inodes."
> <alan_at_nabeth.cxo.dec.com>
>
>Try it as a two step process:
>
>1. Change the type field for each partition you want to change
> to "unused" and write that version of the label.
>2. Run disklabel again to change the sizes.
>
**
>From: Judith Reed <jreed_at_AppliedTheory.com>
>
>I ran into this, and as I recall I had to use the disklabel *command line
>option* that sets the fstype to unused, rather than change it while
>editing the disklabel and then saving.
>
3) SAVE COPY OF LABEL AS ASCII FILE, ZERO LABEL, WRITE DEFAULT, MODIFY
ASCII SAVED FILE, THEN RESTORE
>From: Julian Rodriguez <RodrigJUL_at_mail.dec.com>
>
>You may try this:
>
> - Be sure you are in single user
> - Be sure you are not using the "b" partition as a swap device
> - Save a copy of your disk labeling: "disklabel -r rz... >
>/tmp/label"
> - Zero your disk labeling: "disklabel -z rz... "
> - Write a default label: "disklabel -wr rz... rz_type"
> - Modify the "/tmp/label"
> - Restore the modified label: "disklabel -t [advfs|ufs] -R -r
>rz.../tmp/label"
>
4) USE DIFFERENT VERSION OF DISKLABEL BY BOOTING FROM PREVIOUS OR NEWER
VERSION OF DU 4.0A
>From: "Dr. Tom Blinn, 603-881-0646" <tpb_at_zk3.dec.com>
>
>I haven't yet tried to reproduce the problem you report, but I would not
>rule out the possibility that there is some subtle bug in disklabel in
>the V4.0A release that's causing what you're seeing.
>
>You might be able to work around this by using the V3.2C or V3.2G media
>to boot your stand-alone environment and edit the disklabel. The format
>of the label hasn't changed; the utility got "enhanced" to make it do
>checks thatmay be failing in your situation (although from what you
>describe,editing the label using "disklabel -e /dev/rrz1c" should work).
**
Thanks Again,
-Joseph
Received on Fri Aug 01 1997 - 12:25:58 NZST