How to replace system disk with a larger disk?

Hello - I have an UltraAX-i2 running Solaris 9. My customer currently has two disks in a mirrored setup using SVM, configured as follows:

slice 0 - 11MB - state database replicas

slice 1 - 1GB - swap

slice 6 - 32GB - mounting / and all subdirs, no other physical mounts

They want to replace these disks, since they're running out of room, with two 300GB disks. How do I replicate the OS onto the new disks? I assumed I need to do something like the following:

1. Detach submirrors and database replicas from one old disk

2. Remove old disk, insert new disk

3. Create slices, database replicas (though slice 6 has *much* more space now)

4. Replicate root filesystem on slice 6 of new disk. (ufsdump?)

5. Prepare slice on new disk to become bootable, etc. (here's where I get hung up on how to do this?)

6. Boot new disk.

7. Remove remaining old disk, put in new disk.

8. Re-create mirror.

Does this seem like a sound process? Any thoughts on how I should do steps 4 and 5? Any help would be greatly appreciated!

[1097 byte] By [planetjeffa] at [2007-11-27 5:09:48]
# 1

> Hello - I have an UltraAX-i2 running Solaris 9. My

> customer currently has two disks in a mirrored setup

> using SVM, configured as follows:

> slice 0 - 11MB - state database replicas

> slice 1 - 1GB - swap

> slice 6 - 32GB - mounting / and all subdirs, no other

> physical mounts

>

> They want to replace these disks, since they're

> running out of room, with two 300GB disks. How do I

> replicate the OS onto the new disks? I assumed I

> need to do something like the following:

> 1. Detach submirrors and database replicas from one

> old disk

And metaclear any devices on that disk as well.

> 2. Remove old disk, insert new disk

> 3. Create slices, database replicas (though slice 6

> has *much* more space now)

> 4. Replicate root filesystem on slice 6 of new disk.

> (ufsdump?)

Actually, simply doing a metaattach of the new mirror will copy the data.

> . Prepare slice on new disk to become bootable, etc.

> (here's where I get hung up on how to do this?)

Not sure if it's necessary, but running an 'installboot' on the new slice 6 would be a good idea. Read the man page for the syntax.

> 6. Boot new disk.

remove replicas and metadevices on the other disk before removing it.

Once you're down to a one-way mirror on the new disk, you need to grow the top-level mirror. 'metastat' will show the size of the devices. If the mirror is the same as the old size, you should run 'metattach dX' (with dX being the device for the mirror). That should increase the size.

> 7. Remove remaining old disk, put in new disk.

At this point your disk is larger, your sub-mirror metadevice is larger, and your mirror metadevice is larger, but your filesystem is the same size. While it's possible to enlarge root online, it is not recommended or supported.

After verifying that the new mirror boots, you probably want to boot from alternate media (network or cdrom), then mount the new root filesystem and enlarge it ('growfs').

After that's complete, you can finish the mirroring process. It's much easier to grow the filesystem while it's still only a one-way mirror.

> 8. Re-create mirror.

Don't forget to add back any replicas.

>

> Does this seem like a sound process? Any thoughts on

> how I should do steps 4 and 5? Any help would be

> greatly appreciated!

--

Darren

Darren_Dunhama at 2007-7-12 10:29:43 > top of Java-index,General,Maintenance...
# 2

Have you considered looking into live upgrade to perform this operation? With live upgrade the only down time will be a reboot (and in your case a disk swap). I wrote up a document a while back that explains how to go from a large disk to a small disk:

Change from (150GB disk to a 50GB disk):

Current disk:

# df -kF ufs

Filesystemkbytesusedavail capacity Mounted on

/dev/dsk/c2t212100D0B202BD41d0s0

10085284 3607739 637669337%/

/dev/dsk/c2t212100D0B202BD41d0s1

10085284 1090872 889356011%/var

/dev/dsk/c2t212100D0B202BD41d0s4

130691941 5045996 1243390264%/opt

Format the new disk the way you want it:

# format

Create the new boot environment on the new disk (/ /var /opt and swap):

# lucreate -c "weaver_lg_disk" -m /:/dev/dsk/c2t212000D0B202BD41d0s0:ufs \

-m /var:/dev/dsk/c2t212000D0B202BD41d0s1:ufs -m /opt:/dev/dsk/c2t212000D0B202BD41d0s4:ufs \

-m -:/dev/dsk/c2t212000D0B202BD41d0s3:swap -n "weaver_sm_disk"

Verify the environment:

# lustatus

I would recommend grabbing the old boot up variable incase something goes wrong (it can't hurt anything):

# eeprom | grep boot-device

boot-device=/pci@7c0/pci@0/pci@1/pci@0,2/SUNW,emlxs@2/fp@0,0/disk@w212100d0b202 bd41,1:a

/pci@7c0/pci@0/pci@1/pci@0,2/SUNW,emlxs@2/fp@0,0/disk@w212100d0b202bd41,0:a

Activate the new boot environment

# luactivate weaver_sm_disk

Reboot

# init 6

Orig Doc Here: http://unixhosts.us/txt/live-upgrade-resize-disk.txt

In your case you would have to do steps 1, 2, 3, Live Upgrade, 6, 7, 8.

If you have not used Live Upgrade before you should look into anyways. It is great for patching, upgrades, etc. Another good site for info on live upgrade is http://blogs.sun.com/bobn/ or if you want all the gory details search for the Sun doc on Live Upgrade.

jemurraya at 2007-7-12 10:29:43 > top of Java-index,General,Maintenance...