Anda di halaman 1dari 13

CLONING SOLARIS 10 SERVER WITH

ZFS MIRROR DISK


This document will show procedure of cloning a system running Solaris 10 that using ZFS as root
file system. The idea is to take out mirror disk from the master server (source) & use it to boot up
another server (target server). Then later we fix mirroring on both source & target server.

Cloning Solaris 10 Using Mirror Disk


Suppose we have 1 server named vws01 with Solaris 10 SPARC installed. There are 4 disks on
vws01 configured with ZFS file system.
slot#1 : c1t0d0s0 (part of rpool )
slot#2 : c1t1d0s0 (part of datapool )
slot#3 : c1t2t0d0 (part of rpool )
slot#4 : c1t3t0d0 (part of datapool )
Remember that the device name could be different on your system, just pay attention on the
concept and adapt it with your devices name.
We want to create 1 other server name which similar with the vws01 . We want to utilize ZFS

mirror disks to cloning this server to create cloned server. So we have some tasks to do to achive
that goal, I will split the steps into two big steps :
1. Procedure on the source machine (the existing server)
2. Procedure on the target machine (the clone server we want to create)

Procedure On The Source Machine


1. Make sure all ZFS pools ( rpool & datapool ) are in healthy state.
root@vws01:/#5zpool5status58x5rpool
pool5'rpool'5is5healthy
root@vws01:/#5zpool5status58x5datapool
pool5'datapool'5is5healthy
root@vws01:/#5zpool5status
55pool:5datapool
5state:5ONLINE
5scan:5resilvered532.6G5in50h10m5with505errors5on5Thu5Apr528501:14:4552011
config:
55555555NAME5555555555STATE55555READ5WRITE5CKSUM
55555555datapool555555ONLINE55555550555550555550
5555555555mirror805555ONLINE55555550555550555550
555555555555c1t1d0s055ONLINE55555550555550555550
555555555555c1t3d0s055ONLINE55555550555550555550
errors:5No5known5data5errors
55pool:5rpool
5state:5ONLINE
5scan:5resilvered532.6G5in50h10m5with505errors5on5Thu5Apr528501:14:4552011
config:
55555555NAME5555555555STATE55555READ5WRITE5CKSUM
55555555rpool555555555ONLINE55555550555550555550
5555555555mirror805555ONLINE55555550555550555550
555555555555c1t0d0s055ONLINE55555550555550555550
555555555555c1t2d0s055ONLINE55555550555550555550
errors:5No5known5data5errors
root@vws01:/#

2. Shutdown the source machine.


root@vws01:/#5shutdown5g05y5i5

3. Take out 1 disk from rpool ( slot#3 / c1t2d0 ) and 1 data disk from datapool
( slot#4 / c1t3d0 ). Give the label with clear information on it, for example :
SOURCE_rpool_slot#3_c1t2d0
SOURCE_datapool_slot#4_c1t3d0

4. Boot the server using only 1 mirror leg for rpool ( c1t0d0 ) & datapool ( c1t1d0 ).
During boot process its normal when we get error message like there :

SUNW8MSG8ID:5ZFS880008D3,5TYPE:5Fault,5VER:51,5SEVERITY:5Major
EVENT8TIME:5Thu5Apr528501:04:175GMT52011
PLATFORM:5SUNW,Netra8T5220,5CSN:58,5HOSTNAME:5vws01
SOURCE:5zfs8diagnosis,5REV:51.0
EVENT8ID:5be9eeb00866ab86cf08e27a8acab436e849d
DESC:5A5ZFS5device5failed.55Refer5to5http://sun.com/msg/ZFS880008D35for5more5information.
AUTO8RESPONSE:5No5automated5response5will5occur.
IMPACT:5Fault5tolerance5of5the5pool5may5be5compromised.
REC8ACTION:5Run5'zpool5status58x'5and5replace5the5bad5device.
SUNW8MSG8ID:5ZFS880008D3,5TYPE:5Fault,5VER:51,5SEVERITY:5Major
EVENT8TIME:5Thu5Apr528501:04:175GMT52011
PLATFORM:5SUNW,Netra8T5220,5CSN:58,5HOSTNAME:5vws01
SOURCE:5zfs8diagnosis,5REV:51.0
EVENT8ID:5fc0231b28d6a88608e8de118afe0ebde7508
DESC:5A5ZFS5device5failed.55Refer5to5http://sun.com/msg/ZFS880008D35for5more5information.
AUTO8RESPONSE:5No5automated5response5will5occur.
IMPACT:5Fault5tolerance5of5the5pool5may5be5compromised.
REC8ACTION:5Run5'zpool5status58x'5and5replace5the5bad5device.

Those error come from ZFS inform that even that there are some fault on the ZFS pool. We
can ignore those error for a while, since both pools still accessible & we intend to fix that
broken mirror soon.
5. After OS ready check the disk availability and the status of all pools. Solaris will only see 2
disks installed right now. You will see that both of rpool and datapool are in DEGRADED
state.
root@vws01:/#5format5<5/dev/null
Searching5for5disks...done
AVAILABLE5DISK5SELECTIONS:
55555550.5c1t0d05<SUN146G5cyl5140875alt525hd5245sec5848>
5555555555/pci@0/pci@0/pci@2/scsi@0/sd@0,0
55555551.5c1t1d05<SEAGATE8ST930003SSUN300G808688279.40GB>
5555555555/pci@0/pci@0/pci@2/scsi@0/sd@1,0
Specify5disk5(enter5its5number):
root@vws01:/#
root@vws01:/#5zfs5status
55pool:5datapool
5state:5DEGRADED
status:5One5or5more5devices5could5not5be5opened.55Sufficient5replicas5exist5for
55555555the5pool5to5continue5functioning5in5a5degraded5state.
action:5Attach5the5missing5device5and5online5it5using5'zpool5online'.
555see:5http://www.sun.com/msg/ZFS8800082Q
5scrub:5none5requested
config:
55555555NAME5555555555STATE55555READ5WRITE5CKSUM
55555555datapool555555DEGRADED555550555550555550
5555555555mirror805555DEGRADED555550555550555550
555555555555c1t1d0s055ONLINE55555550555550555550
555555555555c1t3d0s055UNAVAIL555555055555055555055cannot5open
errors:5No5known5data5errors
55pool:5rpool
5state:5DEGRADED
status:5One5or5more5devices5could5not5be5opened.55Sufficient5replicas5exist5for
55555555the5pool5to5continue5functioning5in5a5degraded5state.

action:5Attach5the5missing5device5and5online5it5using5'zpool5online'.
555see:5http://www.sun.com/msg/ZFS8800082Q
5scrub:5none5requested
config:
55555555NAME5555555555STATE55555READ5WRITE5CKSUM
55555555rpool555555555DEGRADED555550555550555550
5555555555mirror805555DEGRADED555550555550555550
555555555555c1t0d0s055ONLINE55555550555550555550
555555555555c1t2d0s055UNAVAIL555555055555055555055cannot5open
errors:5No5known5data5errors
root@vws01:/#

6. Plug in replacement disks (the disks must be same size with the previous one), one disk
goes to slot#3 (as c1t2d0 ) and the other goes to slot#4 (as c1t3d0 ) slot. You can
plug in the disk when server running if your server support hot plug disk controller. If dont,
then please shutdown the server before insert the replacement disks.
7. Assume your system support hot plug disks, the next step is detach the broken mirror leg.
First we need to detach the broken disk from the rpool .
root@vws01:/#5zpool5detach5rpool5c1t2d0s0

After detach the missing root mirror, rpool now on ONLINE status again.
root@vws01:/#5zpool5status
55pool:5rpool
5state:5ONLINE
5scrub:5none5requested
config:
55555555NAME55555555STATE55555READ5WRITE5CKSUM
55555555rpool5555555ONLINE55555550555550555550
5555555555c1t0d0s055ONLINE55555550555550555550
errors:5No5known5data5errors
root@vws01:/#5

8. Repeat the detach process for datapool .


root@vws01:/#5zpool5detach5datapool5c1t3d0s0

After detach the missing data mirror, datapool now on ONLINE status again.
root@vws01:/#5zpool5status5datapool
55pool:5datapool
5state:5ONLINE
5scrub:5none5requested
config:
55555555NAME55555555STATE55555READ5WRITE5CKSUM
55555555datapool5555ONLINE55555550555550555550
5555555555c1t1d0s055ONLINE55555550555550555550
errors:5No5known5data5errors

root@vws01:/#5

9. Before attach replacement disk to rpool , we need to prepare the replacement disk
( c1t2d0 ) first. We need to label the disk first (this step verified on the SPARC system, but
should be applicable on x86 system too).
root@vws01#5format58e5c1t2d0
selecting5c1t2d0
[disk5formatted]
FORMAT5MENU:
55555555disk555555585select5a5disk
55555555type555555585select5(define)5a5disk5type
55555555partition5585select5(define)5a5partition5table
55555555current555585describe5the5current5disk
55555555format5555585format5and5analyze5the5disk
55555555repair5555585repair5a5defective5sector
55555555label55555585write5label5to5the5disk
55555555analyze555585surface5analysis
55555555defect5555585defect5list5management
55555555backup5555585search5for5backup5labels
55555555verify5555585read5and5display5labels
55555555save555555585save5new5disk/partition5definitions
55555555inquiry555585show5vendor,5product5and5revision
55555555scsi555555585independent5SCSI5mode5selects
55555555cache55555585enable,5disable5or5query5SCSI5disk5cache
55555555volname555585set588character5volume5name
55555555!<cmd>5555585execute5<cmd>,5then5return
55555555quit
format>5label
[0]5SMI5Label
[1]5EFI5Label
Specify5Label5type[0]:50
Ready5to5label5disk,5continue?5yes
format>5quit
root@vws01#5

10. Then we need to copy the partition table from the ONLINE root disk ( c1t0d0 ) to the
replacement disk ( c1t2d0 ) :
root@vws01:/#5prtvtoc5/dev/rdsk/c1t0d0s25|5fmthard58s585/dev/rdsk/c1t2d0s2
fmthard:55New5volume5table5of5contents5now5in5place.
root@vws01:/#

11. Attach the replacement disk ( c1t2d0 ) to the rpool .


root@vws01:/#5zpool5attach5rpool5c1t0d0s05c1t2d0s0
Please5be5sure5to5invoke5installboot(1M)5to5make5'c1t2d0s0'5bootable.
Make5sure5to5wait5until5resilver5is5done5before5rebooting.
root@vws01:/#

Pay attention on the format of zfs5attach command :


zpool5attach5<pool_name>5<online_disk>5<new_disk>

12. After attached the replacement disk to rpool then we can see rpool is in the resilver
(resynchronization) status.
root@vws01:/#5zfs5status5rpool
55pool:5rpool
5state:5ONLINE
status:5One5or5more5devices5is5currently5being5resilvered.55The5pool5will
55555555continue5to5function,5possibly5in5a5degraded5state.
action:5Wait5for5the5resilver5to5complete.
5scrub:5resilver5in5progress5for50h0m,51.90%5done,50h47m5to5go
config:
55555555NAME5555555555STATE55555READ5WRITE5CKSUM
55555555rpool555555555ONLINE55555550555550555550
5555555555mirror805555ONLINE55555550555550555550
555555555555c1t0d0s055ONLINE55555550555550555550
555555555555c1t2d0s055ONLINE55555550555550555550551010M5resilvered
errors:5No5known5data5errors
root@vws01:/#5

13. Same as the step #9, we also need to prepare the replacement disk ( c1t3d0 ) before
attaching it to the datapool . We need to label the disk first (this step verified on the
SPARC system, but should be applicable on x86 system too).
root@vws01#5format58e5c1t3d0
selecting5c1t3d0
[disk5formatted]
FORMAT5MENU:
55555555disk555555585select5a5disk
55555555type555555585select5(define)5a5disk5type
55555555partition5585select5(define)5a5partition5table
55555555current555585describe5the5current5disk
55555555format5555585format5and5analyze5the5disk
55555555repair5555585repair5a5defective5sector
55555555label55555585write5label5to5the5disk
55555555analyze555585surface5analysis
55555555defect5555585defect5list5management
55555555backup5555585search5for5backup5labels
55555555verify5555585read5and5display5labels
55555555save555555585save5new5disk/partition5definitions
55555555inquiry555585show5vendor,5product5and5revision
55555555scsi555555585independent5SCSI5mode5selects
55555555cache55555585enable,5disable5or5query5SCSI5disk5cache
55555555volname555585set588character5volume5name
55555555!<cmd>5555585execute5<cmd>,5then5return
55555555quit
format>5label
[0]5SMI5Label
[1]5EFI5Label
Specify5Label5type[0]:50
Ready5to5label5disk,5continue?5yes
format>5quit
root@vws01#5

14. Then we need to copy the partition table from the ONLINE data disk ( c1t1d0 ) to the
replacement disk ( c1t3d0 ) :

root@vws01:/#5prtvtoc5/dev/rdsk/c1t1d0s25|5fmthard58s585/dev/rdsk/c1t3d0s2
55555555fmthard:55New5volume5table5of5contents5now5in5place.
55555555root@vws01:/#

15. Attach the replacement disk ( c1t3d0 ) to the datapool .


root@vws01:/#5zpool5attach5datapool5c1t1d0s05c1t3d0s0

16. After attached the replacement disk to datapool , we can see datapool is in the resilver
(resynchronization) status.
root@vws01:/#5zpool5status
55pool:5datapool
5state:5ONLINE
status:5One5or5more5devices5is5currently5being5resilvered.55The5pool5will
55555555continue5to5function,5possibly5in5a5degraded5state.
action:5Wait5for5the5resilver5to5complete.
5scrub:5resilver5in5progress5for50h0m,52.52%5done,50h9m5to5go
config:
55555555NAME5555555555STATE55555READ5WRITE5CKSUM
55555555datapool555555ONLINE55555550555550555550
5555555555mirror805555ONLINE55555550555550555550
555555555555c1t1d0s055ONLINE55555550555550555550
555555555555c1t3d0s055ONLINE5555555055555055555055760M5resilvered
errors:5No5known5data5errors
root@vws01:/#

17. After resilver process on the rpool completed, we need to reinstall boot block on the new
disk ( c1t2d0 ). This is crucial step otherwise we cant use c1t2d0 as boot media even if it
contains Solaris OS installation files. For SPARC system, we reinstall boot block on the new
root mirror using installboot command like this :
root@vws01:/#5installboot58F5zfs5/usr/platform/`uname58i`/lib/fs/zfs/bootblk5
/dev/rdsk/c1t2d0s0

In x86 system we do it using installgrub command like shown below :


/#5installgrub5/boot/grub/stage15/boot/grub/stage25/dev/rdsk/c1d0s0
stage15written5to5partition505sector505(abs516065)
stage25written5to5partition50,52735sectors5starting5at5505(abs516115)
/#

Procedure On The Target Machine


This procedure executed on the new server (the clone target). We will boot this new server using
2 disk we take from the source machine vws01 .
1. Assume that target machine is on powered off state (if doesnt please shut it down first).

2. Remove all attached disks from the target machine.


3. Unplug all network cables attached to target machine. This step is important if target
machine located in the same network segment. Because we use the disk from vws01 then
when it boot up the server will try to use the same IP address as original vws01 .
4. Plug in the disk we got from the source machine (as explained on step #3 in the last
section).
SOURCE_rpool_slot#3_c1t2d0
SOURCE_datapool_slot#4_c1t3d0

5. With only 2 disk attached, boot the server. Remember to set the system to boot from slot #3.
Otherwise system will failed to boot since it look at default disk on slot #1.
6. When OS ready check disk availability & status of all ZFS pools.
root@vws01:/#5format
Searching5for5disks...done
AVAILABLE5DISK5SELECTIONS:
55555550.5c1t2d05<SUN146G5cyl5140875alt525hd5245sec5848>
5555555555/pci@0/pci@0/pci@2/scsi@0/sd@2,0
55555551.5c1t3d05<SEAGATE8ST930003SSUN300G808688279.40GB>
5555555555/pci@0/pci@0/pci@2/scsi@0/sd@3,0
Specify5disk5(enter5its5number):5^D
root@vws01:/#5
root@vws01:/#5zpool5status
55pool:5rpool
5state:5DEGRADED
status:5One5or5more5devices5could5not5be5opened.55Sufficient5replicas5exist5for
55555555the5pool5to5continue5functioning5in5a5degraded5state.
action:5Attach5the5missing5device5and5online5it5using5'zpool5online'.
555see:5http://www.sun.com/msg/ZFS8800082Q
5scrub:5none5requested
config:
55555555NAME5555555555STATE55555READ5WRITE5CKSUM
55555555rpool555555555DEGRADED555550555550555550
5555555555mirror805555DEGRADED555550555550555550
555555555555c1t0d0s055UNAVAIL555555055555055555055cannot5open
555555555555c1t2d0s055ONLINE55555550555550555550
errors:5No5known5data5errors
root@vws01:/#5

In case we only see rpool then we must import the other pool before proceed to the next
steps.
root@vws01:/#5zpool5import
55pool:5datapool
5555id:51782173212883254850
5state:5DEGRADED
status:5The5pool5was5last5accessed5by5another5system.
action:5The5pool5can5be5imported5despite5missing5or5damaged5devices.55The
55555555fault5tolerance5of5the5pool5may5be5compromised5if5imported.

555see:5http://www.sun.com/msg/ZFS880008EY
config:
55555555datapool555555DEGRADED
5555555555mirror805555DEGRADED
555555555555c1t1d0s055UNAVAIL55cannot5open
555555555555c1t3d0s055ONLINE
root@vws01:/#
root@vws01:/#5zpool5import58f5datapool
root@vws01:/#
root@vws01:/#5zpool5status5datapool
55pool:5datapool
5state:5DEGRADED
status:5One5or5more5devices5could5not5be5opened.55Sufficient5replicas5exist5for
55555555the5pool5to5continue5functioning5in5a5degraded5state.
action:5Attach5the5missing5device5and5online5it5using5'zpool5online'.
555see:5http://www.sun.com/msg/ZFS8800082Q
5scrub:5none5requested
config:
55555555NAME5555555555555555555555STATE55555READ5WRITE5CKSUM
55555555datapool555555555555555555DEGRADED555550555550555550
5555555555mirror805555555555555555DEGRADED555550555550555550
5555555555551098725994374999834455UNAVAIL555555055555055555055was5/dev/dsk/c1t1d0s0
555555555555c1t3d0s055555555555555ONLINE55555550555550555550
errors:5No5known5data5errors
root@vws01:/#

7. The next step is we need to detach unavailable disk from the rpool .
root@vws01:/#5zpool5detach5rpool5c1t0d0s0

After detach the missing root mirror, rpool now on ONLINE status again.
root@vws01:/#5zpool5status58x5rpool
pool5'rpool'5is5healthy
root@vws01:/#5zpool5status5rpool
55pool:5rpool
5state:5ONLINE
5scrub:5none5requested
config:
55555555NAME55555555STATE55555READ5WRITE5CKSUM
55555555rpool5555555ONLINE55555550555550555550
5555555555c1t2d0s055ONLINE55555550555550555550
errors:5No5known5data5errors
root@vws01:/#

8. Repeat the detach process for unavailable disk on datapool .


root@vws01:/#5zpool5detach5datapool5/dev/dsk/c1t1d0s0

After detach the missing data mirror, datapool now on ONLINE status again.
root@vws01:/#5zpool5status58x5datapool
pool5'datapool'5is5healthy

root@vws01:/#5zpool5status5datapool
55pool:5datapool
5state:5ONLINE
5scrub:5none5requested
config:
55555555NAME55555555STATE55555READ5WRITE5CKSUM
55555555datapool5555ONLINE55555550555550555550
5555555555c1t3d0s055ONLINE55555550555550555550
errors:5No5known5data5errors
root@vws01:/#5

9. At this stage we probably want to change the hostname & modify IP address for this new
machine before continue fix the mirroring. In this example the new machine will use
hostname vws02 . To change the hostname & IP address we need to edit several files :
/etc/hosts
/etc/hostname.*
/etc/nodename
/etc/netmasks
/etc/defaultrouter
We can use the following command to change the hostname :
root@vws01:/#5find5/etc58name5"hosts"58exec5perl58pi58e5's/vws01/vws02/g'5{}5\;
root@vws01:/#5find5/etc58name5"nodename"58exec5perl58pi58e5's/vws01/vws02/g'5{}5\;
root@vws01:/#5find5/etc58name5"hostname*"58exec5perl58pi58e5's/vws01/vws02/g'5{}5\;

Reboot the server so it can pick up the new hostname.


root@vws01:/#5shutdown58g058y58i6

10. Once the server reboot successfully, insert the replacement disks on slot#1 and slot#2.
Invoke devfsadm command to let Solaris detect the new disks.
root@vws02:/#5devfsadm
root@vws02:/#5format5<5/dev/null
Searching5for5disks...done
AVAILABLE5DISK5SELECTIONS:
55555550.5c1t0d05<SUN146G5cyl5140875alt525hd5245sec5848>
5555555555/pci@0/pci@0/pci@2/scsi@0/sd@0,0
55555551.5c1t1d05<SUN300G5cyl5468735alt525hd5205sec5625>
5555555555/pci@0/pci@0/pci@2/scsi@0/sd@1,0
55555552.5c1t2d05<SUN146G5cyl5140875alt525hd5245sec5848>
5555555555/pci@0/pci@0/pci@2/scsi@0/sd@2,0
55555553.5c1t3d05<SEAGATE8ST930003SSUN300G808688279.40GB>
5555555555/pci@0/pci@0/pci@2/scsi@0/sd@3,0
Specify5disk5(enter5its5number):
root@vws02:/#

See that the new disks ( c1t0d0 & c1t1d0 ) already recognized by Solaris.

11. Before fixing mirroring on rpool we need to prepare the disk first (this step verified on the
SPARC system, but should be applicable on x86 system too).
root@vws02#5format58e5c1t0d0
selecting5c1t0d0
[disk5formatted]
FORMAT5MENU:
55555555disk555555585select5a5disk
55555555type555555585select5(define)5a5disk5type
55555555partition5585select5(define)5a5partition5table
55555555current555585describe5the5current5disk
55555555format5555585format5and5analyze5the5disk
55555555repair5555585repair5a5defective5sector
55555555label55555585write5label5to5the5disk
55555555analyze555585surface5analysis
55555555defect5555585defect5list5management
55555555backup5555585search5for5backup5labels
55555555verify5555585read5and5display5labels
55555555save555555585save5new5disk/partition5definitions
55555555inquiry555585show5vendor,5product5and5revision
55555555scsi555555585independent5SCSI5mode5selects
55555555cache55555585enable,5disable5or5query5SCSI5disk5cache
55555555volname555585set588character5volume5name
55555555!<cmd>5555585execute5<cmd>,5then5return
55555555quit
format>5label
[0]5SMI5Label
[1]5EFI5Label
Specify5Label5type[0]:50
Ready5to5label5disk,5continue?5yes
format>5quit
root@vws02#

Then we need to copy the partition table from the ONLINE root disk ( c1t2d0 ) to the
replacement disk ( c1t0d0 ) :
root@vws02:/#5prtvtoc5/dev/rdsk/c1t2d0s25|5fmthard58s585/dev/rdsk/c1t0d0s2
fmthard:55New5volume5table5of5contents5now5in5place.
root@vws02:/#5

12. Now we can attach replacement disk to rpool .


root@vws02:/#5zpool5attach5rpool5c1t2d0s05c1t0d0s0
Please5be5sure5to5invoke5installboot(1M)5to5make5'c1t0d0s0'5bootable.
Make5sure5to5wait5until5resilver5is5done5before5rebooting.
root@vws02:/#5

13. After attached replacement disk to rpool , check that rpool now on resilver process.
root@vws02:/#5zpool5status5rpool
55pool:5rpool
5state:5ONLINE
status:5One5or5more5devices5is5currently5being5resilvered.55The5pool5will
55555555continue5to5function,5possibly5in5a5degraded5state.
action:5Wait5for5the5resilver5to5complete.
5scrub:5resilver5in5progress5for50h0m,56.60%5done,50h12m5to5go

config:
55555555NAME5555555555STATE55555READ5WRITE5CKSUM
55555555rpool555555555ONLINE55555550555550555550
5555555555mirror805555ONLINE55555550555550555550
555555555555c1t2d0s055ONLINE55555550555550555550
555555555555c1t0d0s055ONLINE55555550555550555550553.43G5resilvered
errors:5No5known5data5errors
root@vws02:/#5

14. Then we can continue to fix mirroring on datapool . But before that we need to prepare the
replacement disk first ( c1t1d0 ).
55555555root@vws02#5format58e5c1t1d0
55555555selecting5c1t0d0
55555555[disk5formatted]
55555555FORMAT5MENU:
5555555555555555disk555555585select5a5disk
5555555555555555type555555585select5(define)5a5disk5type
5555555555555555partition5585select5(define)5a5partition5table
5555555555555555current555585describe5the5current5disk
5555555555555555format5555585format5and5analyze5the5disk
5555555555555555repair5555585repair5a5defective5sector
5555555555555555label55555585write5label5to5the5disk
5555555555555555analyze555585surface5analysis
5555555555555555defect5555585defect5list5management
5555555555555555backup5555585search5for5backup5labels
5555555555555555verify5555585read5and5display5labels
5555555555555555save555555585save5new5disk/partition5definitions
5555555555555555inquiry555585show5vendor,5product5and5revision
5555555555555555scsi555555585independent5SCSI5mode5selects
5555555555555555cache55555585enable,5disable5or5query5SCSI5disk5cache
5555555555555555volname555585set588character5volume5name
5555555555555555!<cmd>5555585execute5<cmd>,5then5return
5555555555555555quit
55555555format>5label
55555555[0]5SMI5Label
55555555[1]5EFI5Label
55555555Specify5Label5type[0]:50
55555555Ready5to5label5disk,5continue?5yes
55555555format>5quit
55555555root@vws02#

Then we need to copy the partition table from the ONLINE data disk ( c1t3d0 ) to the
replacement disk ( c1t1d0 ) :
55555555root@vws02:/#5prtvtoc5/dev/rdsk/c1t3d0s25|5fmthard58s585/dev/rdsk/c1t1d0s2
55555555fmthard:55New5volume5table5of5contents5now5in5place.
55555555root@vws02:/#5

15. Now we can attach replacement disk to datapool .


root@vws02:/#5zpool5attach5datapool5c1t3d0s05c1t1d0s0

16. After attached replacement disk to datapool , check that datapool now on resilver
process.
root@vws02:/#5zpool5status5datapool
55pool:5datapool
5state:5ONLINE
status:5One5or5more5devices5is5currently5being5resilvered.55The5pool5will
55555555continue5to5function,5possibly5in5a5degraded5state.
action:5Wait5for5the5resilver5to5complete.
5scrub:5resilver5in5progress5for50h0m,55.28%5done,50h6m5to5go
config:
55555555NAME5555555555STATE55555READ5WRITE5CKSUM
55555555datapool555555ONLINE55555550555550555550
5555555555mirror805555ONLINE55555550555550555550
555555555555c1t3d0s055ONLINE55555550555550555550
555555555555c1t1d0s055ONLINE55555550555550555550551.56G5resilvered
errors:5No5known5data5errors
root@vws02:/#

17. After resilver process on the rpool finished, we need to reinstall boot block on the new
disk ( c1t0d0s0 ). This is crucial step otherwise we cant use c1t0d0 as boot media even if
it contains Solaris OS installation files. For SPARC system, we reinstall boot block on the
new root mirror using installboot command like this :
root@vws02:/#5installboot58F5zfs5/usr/platform/`uname58i`/lib/fs/zfs/bootblk5
/dev/rdsk/c1t0d0s0

In x86 system we do it using installgrub command like shown below :


#5installgrub5/boot/grub/stage15/boot/grub/stage25/dev/rdsk/c1t0d0s0
stage15written5to5partition505sector505(abs516065)
stage25written5to5partition50,52735sectors5starting5at5505(abs516115)
#

18. Reboot the target machine once more to wrap everything completely.
root@vws02:/#5shutdown58g058y58i6

19. Plug in all network cables and check the network connectivity.

Anda mungkin juga menyukai