Re: fmthard and misallignment issues



Thanks Darren that makes sense.

I also came up with something a little more "Monkey with a hammer"
like:

do you think this will work?

first

SRC=c0t0d0
DEST=c0t1d0
dd if=/dev/rdsk/${SRC}s2 of=/dev/rdsk/${DEST}s2 bs=2048

this seemed to match up the partitions for me then at this point I can
fmthard and installboot then worry about ufsrestoreing the partitions
unfortunatlay this means keeping around a dd image as well as ufsdump
partition images.

do you have a better way that Is there a better way to script Solaris
format command
to do the same thing
-give me the exact same partitions on a bigger disk and loose out on
the rest of the disk.
-or using your advice scale up the partitions making use of the whole
disk still automating the partition creation


my goal is to be able to hook up this external 9gig scsi to any sunbox
run this script and image the backup ufsdump image from the failed
sparcbox withnthe only manual intervention being vfstab editing after
the imaging script finishes



Darren Dunham wrote:
merrittr <merrittr@xxxxxxxxx> wrote:
Hi

I am trying to script a solution to allow build a replacement boot disk
for 4 different machines anyway where its coming off the tracks is:

t0 t1 are different sized disks (t0=2.1gig t1=9gig)

Then you probably won't be able to have identical layouts for them.

prtvtoc /dev/rdsk/c0t0d0s2 > /tmp/vtoc #get partiotion from rootdisk
fmthard -s /tmp/vtoc /dev/rdsk/c0t1d0s2 # format the spare external
scsi to be like t0
.
.
.
here I get
Partition 0 not aligned on cylinder boundary: " 0 2 00
0 1638560 1638559 /"

so how do I fdisk t1 so the partitions look the same

Don't fdisk, that has nothing to do with the VTOC label. (and you
wouldn't use it on SPARC anyway).

You'd need to massage the data so that your slices are on cylinder
boundaries. The bits at the top give you that information...

* 512 bytes/sector
* 80 sectors/track
* 19 tracks/cylinder
* 1520 sectors/cylinder
* 3500 cylinders
* 2733 accessible cylinders

Notice that all the slices on this disk are multiples of 1520 sectors in
size (the number of sectors in a cylinder).

You'll need to read the vtoc from your target disk, get the cylinder
size, then make the slices you need muliples of that size. Presumably
you'd want to round up where necessary.

You don't need to specify slice 2, just let it remain.

fdisk -F /tmp/vtoc /dev/rdsk/c0t1d0s2
doesn't work

No. 'fdisk' is used for x86 partition tables, not for Solaris VTOC
management.

--
Darren Dunham ddunham@xxxxxxxx
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >

.



Relevant Pages

  • Re: grub error 18
    ... because I thought the EXTEND partition would be the second partition in ... Selected cylinder exceeds maximum supported by BIOS." ... the disk using CHS addressing (that is: telling the BIOS a head number, ... sectors per track gave 32k bytes per track, ...
    (uk.comp.homebuilt)
  • Re: When does `write return?
    ... the write could return as soon as the data get to a memory buffer. ... > But the hardware controller for the disk drives allowed you to read any ... > per cylinder and 20 sectors per track. ... > the whole cylinder and do an automatic seek with no intervention from the OS ...
    (comp.os.linux.misc)
  • Re: XP Partition size
    ... >> The very first sector of a disk is reserved for its Master Boot Record ... As Partitions are made to be aligned on Cylinder ... With some Un*x OS's you can use sectors, ...
    (microsoft.public.windowsxp.general)
  • Re: Disk geometry from /sys
    ... Many compact flash cards will report 16 heads, and 16 or 32 sectors ... Simplest way to find out what geometry a disk pretents to have is to ask ... Why do you want to know what cylinder size the hard disk pretents to ...
    (Linux-Kernel)
  • disktab for VPC Disk
    ... I'm trying to optimize the disk access of NEXTSTEP on Virtual PC 5.0.4. ... Maximum size of NeXT file system is 2GB. ... programs in the initial 8 sectors of the device. ... The number of cylinders per cylinder group in a file system. ...
    (microsoft.public.mac.virtualpc)