Wednesday, June 29, 2005

Query for an existing bootblk

Subject: SUMMARY: Query for an existing bootblk

Hi *,

Many thanks to Hutin Bertrand, Kalyan Manchikanti, Brad Morrison, Joe
Fletcher & Siva Santhakumar.

My question was:

"I have to query several sun5.8 sparc boxes to see if the secondary
mirror has a bootblk installed.

If not I will need to call the following:

installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk

Someone suggested:

dd if=/dev/rdsk/c1t1d0s0 of=mirror.vtoc bs=512 count=1

Which returns

1+0 records in
1+0 records out"

************* SUNMANAGERS -

Hutin suggested:

I need to use std.vtoc to have something to compare to:

dd if=/dev/rdsk/c1t0d0s0 of=std.vtoc bs=512 count=1
dd if=/dev/rdsk/c1t1d0s0 of=mirror.vtoc bs=512 count=1

"cmp std.vtoc mirror.vtoc " and compare the outcome's, any difference
would suggest a different bootblk."

- I carried out this and sure enough found that a machine without the
platform specific bootblk returned a different result.

Siva explained:

"dd command taking the input from /dev/rdsk/c1t1d0s0 and write (single)
of 512 block size. In your case if your current boot disk is c0t0d0s0
and alternate boot disk is c1t1d0s0 then type:

dd if=/dev/rdsk/c0t0d0s0 of=/dev/rdsk/c1t1d0s0 bs=512 count=1 make sure
disks names are correct.

Brad suggested and explained:

"When dd says:
1+0 records in
1+0 records out
it means that it has successfully read and written 1 record of the size
you specified (__, in this case). That is, "it worked". :-)

Anything else could be an error, unless your record size doesn't
correspond to what dd found. Try creating a file with 1025 bytes and

dd if=1025-byte-file of=/dev/null bs=1024

dd should answer with
1+1 records in
1+1 records out

to indicate one complete 1024-byte record, plus one partial record.

There's one more step after dd'ing the area where the bootblock should
be: compare it to the bootblock you'd install if you found it missing.
After dd'ing what's on a given system to some temp file, use cmp to
compare it to /usr/platform/`uname -i`/lib/fs/ufs/bootblk "

- This proved to be the case, and helped me to verify further.

Joe Suggested:

"Any reason why you don't just run the boot block installs on all the
disks and forget the rest? If it's already there it just gets
overwritten, if it's not there then the install is done."


So it seems the dd command was not crucial to commiting an installboot
(not cause any damage), as I could simply overwrite any existing bootblk
with the correct architecture - But I learnt a lot more in the process,
which is always a good thing :)

Thanks All!!!



Post a Comment

<< Home