Below is a summary of answers received. This was largely ignorance
on my part as to how disklabel works.
From: anthony.miller_at_vf.vodafone.co.uk
The easiest way is to do something like:
disklabel -z rznn
disklabel -wr rznn rznn
disklabel -r rznn
where rznn is the device special file. The '-z' one will erase any
existing label. Dont be surprised if this fails with an error message.
Just ignore it.
The 'wr' line will write a 'default' label to the device. The final
rznn tells disklabel to basically examine the device to see how many
blocks are available and to use this in the written label.
The 'r' will verify the label written. You might want to change
partition sizes after this. Particularly on raid sets etc. If you do,
do a:
disklabel -r rznn > /tmp/label.rznn
Edit the file label.rznn accordingly. The 'c' partition will have the
correct number of blocks available on the device by the way. Then write
it back by doing a:
disklabel -R rznn /tmp/label.rznn
Hope this helps.
Tony
>From Alan.Davis_at_digital.com Sun Dec 6 07:15:57 1998
Tom,
It would be better to disklabel the new drive, putting on the
appropriate boot blocks using the -t switch and then using
the command found in the example on the vrestore man page
to clone each partition or domain.
The srm console command to change the default boot device
is : set bootdef_dev dkXn[nn]
followed by an init command to write the new value to the EEPROM.
Alan Davis
Compaq Services
>From Alan.Davis_at_digital.com Sun Dec 6 07:15:58 1998
Tom,
You may use the rzXX as the device type. This forces disklabel
to use the GETDEVGEOM ioctl to query the disk/controller for
it's default label. This label may then be modified using
disklabel -e.
For example, to put a default label and advfs boot blocks on
rz5c (dka500 at the console) :
disklabel -t advfs -wr /dev/rrz5c rzXX
disklabel -e /dev/rrz5c
Alan Davis
Compaq Services
>From alan_at_nabeth.cxo.dec.com Sun Dec 6 07:16:10 1998
Certain parts of the boot process (the contents of /etc/fstab)
know what the device name of the system disk is. If the new
drive doesn't replace the old one, it will have a new device
name and those parts will be wrong. The other device name
link of note is /sbin/swapdefault.
If the new disk is larger you'll either be wasting space, or
will have an unused disk partition. Since the old disk's
partition table won't reflect the new disk's capacity you'll
have to adjust the partition table as necessary.
Any poor file system organization will be carried over with
a dd(1), where a dump/restore or vdump/vrestore can correct
some of that.
If a significant amount of some partition is free space, you'll
be copying more data than necessary.
If you use dd(1), the contents of /mdec are just disk blocks
to be copied. When the disk is labeled, the appropriate boot
block is written to the space for it in the label. /mdec is
merely the source of that data.
To change the name of the boot device, change the console
variable bootdef_dev. See Also; the first paragraph.
>From Joel_Gallun/US/DCI_at_discovery.com Mon Dec 7 06:39:01 1998
you don't need a disktab for SCSI drives. Just 'disklabel -rw rzN foo'
Disklabel queries the device for it's size.
Joel
> From: Thomas Leitner <tom_at_finwds01.tu-graz.ac.at>
> To: Tom Linden <tom_at_kednos.com>
> Subject: Re: Formatting disk on DU
>
>
> Tom
> # disklabel -rw rz6 rz6
> # newfs /dev/rz6c
> # mkdir /home1
> # mount /dev/rz6c /home1
>
> where the disk SCSI ID is 6.
>
> If you really *need* to format the SCSI disk, you could do it with "scu".
>
> # scu -f /dev/rrz6c
> scu> format defects all
>
> Tom
Received on Tue Dec 08 1998 - 13:07:14 NZDT