[SunHELP] newdisk

steve price sunhelp at sunhelp.org
Wed Nov 21 14:19:51 CST 2001


I pulled this of this list a few months (March 2001)
ago.  Thanks to Don Varner....

<snip>
Here's what I use to copy to a new drive of the
same size and geometry.    Before using dd make
SURE you know which disk you're wanting to copy
or you'll end up with TWO fresh clean disks.   ;^)
This example assumes c0t0d0  is the source and
c0t1d0 is the target.

- prtvtoc /dev/rdsk/c0t0d0s2 > /drive0.vtoc
- fmthard -s /drive0.vtoc /dev/rdsk/c0t1d0s2
- dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2
bs=128b


That's the easy way.  If you don't have identical
disks,
follow these steps.

Let's say you have an existing three partition disk
with root, usr and var.  The drive is c0t0d0 with
root at s0,  usr at s3 and var at s5 and you want
the new disk to also have three partitions.  The new
disk is at c0t1d0.

-Partition and label the new disk using format.
    Don't forget a swap partition.

Create file systems
-  newfs /dev/rdsk/c0t1d0s0  (Also s3 & s5)

- mkdir /newroot /newusr /newvar
- mount /dev/dsk/c0t1d0s0 /newroot
- mount /dev/dsk/c0t1d0s3 /newusr
- mount /dev/dsk/c0t1d0s5 /newvar

  - cd /tmp
  - ufsdump 0f - / | (cd /newroot; ufsrestore -rf -)
  - ufsdump 0f - /usr | (cd /newusr; ufsrestore -rf -)
  - ufsdump 0f - /var | (cd /newvar; ufsrestore -rf -)

  - installboot  bootblk  /dev/rdsk/c0t1d0s0

No need to edit vfstab if you change the target
address
on the new disk before booting.
<snip>

--- Martn Marqus <martin at bugs.unl.edu.ar> wrote:
> We have a ULTRASPARC station with a modest 4Gig
> disk, and we are about to get 
> an 80Gig disk, but to use it, we need to free the
> one thats being used at the 
> moment.
> Is there a way to do it without having to reinstall
> everything? I thought 
> about using tar (tar and pipe the output to another
> tar), and dd, but what 
> would happen to the MBR?
> 
> Saludos... :-)
> 
> -- 
> Porqu usar una base de datos relacional cualquiera,
> si pods usar PostgreSQL?
>
-----------------------------------------------------------------
> Martn Marqus                  |       
> mmarques at unl.edu.ar
> Programador, Administrador, DBA |       Centro de
> Telematica
>                        Universidad Nacional
>                             del Litoral
>
-----------------------------------------------------------------
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp


__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1



More information about the SunHELP mailing list