Solved

Upgrade internal disks to higher size

Posted on 2007-03-19
5
1,380 Views
Last Modified: 2013-12-27
# uname -a
SunOS xxxxx 5.9 Generic_118558-27 sun4u sparc SUNW,Sun-Fire-V210
#format
AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@1c,600000/scsi@2/sd@0,0
       1. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@1c,600000/scsi@2/sd@1,0

We are trying to perform a disk upgrade on this box running Solaris 9. Currently there are two 36GB internal disks which are mirrored and host the root partition.

We are planning to upgrade these two disks to 146Gb, so we intend to break the existing mirrors, pull out one 36GB disk and swap it with a new 146GB disk. We want to create a partition 0 that is similar to the one on the 36GB disk and mirror it to host root. Though we are unable to achieve the same cylinder/block size, we are planning to create the 0 partition of same size as on the 36GB disk and mirror both the slices (36GB disk slice 0 and 146Gb disk slice 0).

If the mirroring works and the data from 36Gb slice 0 is syncs to 146GB slice 0, we will copy the boot block from the boot disk to the slice 0 on 146Gb using install boot and then test the system if it boots fine. If the system boots up with the 146GB slice 0 mirror, then we will swap out the other 36GB disk with 146GB disk and perform a similar plan on the new 146GB disk.

We are concerned cylindwhether we can mirror two slices with different er/block sizes, but same size (in this case slice 0 of 36gb disk which is 26.03GB and slice 0 of 146Gb disk which is 26.04GB).

Is there any other easier way of performing the root disk upgrade?
0
Comment
Question by:sriniajay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 38

Accepted Solution

by:
yuzh earned 500 total points
ID: 18753155
The easier way to do this job, is to break the mirror first (remember
to modify your /etc/vfstab file), add the new hard disk in, partion the
new harddisk the way you wanted, then use ufsdump/ufsrestore to
transfer your data accross to the new hard disk, run installboot to make the new harddisk bootable (if your disk layout is differ from the
original one, you need to adjust /etc/vfstab in  the new harddisk).

shutdown the system, make the new HD as the primary disk, and put
the other new harddisk in. boot up the system, setup the disk mirror for the new HDs.

If the number of partions are the same for the new hard disk (same disk layout, differ in size, you need to make sure the partion is big enough for the exsiting data), you can use the following script to clone the disk (feel free to modify the script):

#!/bin/ksh
#
# this script will clone the primary disk to the target disk
# usage: clonedisk t-disk
#
# Written by: Greg Yu
# Version 1.0
 
#set -x
 
if [ "$#" != 1 ] ; then
    echo "usage: $0 t-disk"
    echo "where: t-disk is the target disk (e.g. c0t1d0)"
    echo "Note:  Please ignore the slice numbers!"
    exit 1
fi
 
format</dev/null | grep "\.[      ]$1" >/dev/null 2>&1 && T=$1
 
if [ -z "$T" ] ; then
   echo "ERROR: Target disk $1 does not exist -- exit!" ; exit 2
fi
 
clear ; echo "
  ATTENTION: This script will copy the whole prinmary disk to $T
             If this is NOT what you intended to do, abort
             by pressing Ctrl-C now!
                      Are you ready now [N] ? \c"
                      read ans
                      if [ "$ans" != "Y" -a "$ans" != "y" ] ; then
                         exit 1
                      fi
 
# copy VTOC:
# You manually partion your new HD, since they are differ in size
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/${T}s2
 
#Now copy the filesystem slice by slice
 
df -Fufs | grep c0t0d0 | tr -d "()" | awk '{print $1," ", $2 }' >/tmp/myfstab
 
exec 0</tmp/myfstab
 
while read  fs  sl ; do
    SD=`basename $sl | cut -c7-`
    echo "the current filesystem is $fs, target disk slice is /dev/rdsk/${T}${SD
}"
    newfs /dev/rdsk/${T}${SD}
    cd /
    mount /dev/dsk/${T}${SD} /mnt

    # check if the slice is mounted
    if [[ "$?" -ne 0 ]] ; then
       echo " failed to mount /dev/dsk/${T}${SD} on /mnt !!!"
       exit 3
    fi
 
    cd /mnt
    echo "copying data to /dev/dsk/${T}${SD} ..."
    ufsdump 0f - $fs | ufsrestore rvf -
    rm restoresymtable
    cd /
    umount /mnt
    sleep 1
done
 
rm /tmp/myfstab
 
# make the target disk bootable:
  /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk \
   /dev/rdsk/${T}s0
 
  echo "clone disk c0t0d0 to $T completed, thank you!"
 
exit
#End of Script

# I assume you know how to break/setup disk mirroring.


0
 
LVL 27

Expert Comment

by:Nopius
ID: 18754484
>  The easier way to do this job, is to break the mirror first (remember
> to modify your /etc/vfstab file), add the new hard disk in, partion the
> new harddisk the way you wanted, then use ufsdump/ufsrestore to
> transfer your data accross to the new hard disk, run installboot to make the new harddisk bootable (if your disk layout is differ from the
> original one, you need to adjust /etc/vfstab in  the new harddisk).

yuzh: I dont' think it's easier it's almost the same :-). But ufsdump/ufsrestore takes longer then attaching second half of the mirror and synchronizing it.

 sriniajay: I guess your way is the best. If you are running Solaris Volume Manager
1) don't forget to remove metadb replica from drive being detached
2) don't forget to create metadb on a new drive
3) create partition 0 slightly bigger (say 37Gb) then on original drive, but it's OK to mix drives with different c/h/s geometry.
4) wait until entire partition will by in sync before rebooting
0
 
LVL 38

Expert Comment

by:yuzh
ID: 18754529
>>yuzh: I dont' think it's easier it's almost the same :-). But ufsdump/ufsrestore takes longer then attaching second half of the mirror and synchronizing it.

You need to break/setup the disk mirror twice (I know tey all work).
0
 
LVL 27

Expert Comment

by:Nopius
ID: 18754542
> You need to break/setup the disk mirror twice (I know tey all work).
With your method, I need to ufsdump/ufsrestore once and setup/attach a mirror once (synchronize). It's almost the same as break mirror twice :-)
0
 
LVL 27

Expert Comment

by:Nopius
ID: 18754551
In mean in V210 there are only 2 disk slots (which are already busy) and we must break mirror anyway...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question