Solaris zfs Replace the Root Pool Disk (Replace a Disk in the ZFS Root Pool)

Source: Internet
Author: User

Solaris zfs Replace the Root Pool Disk (Replace a Disk in the ZFS Root Pool) in some cases, due to insufficient space or hardware faults, we need to Replace the boot Disk. The redundancy pool (mirrored pool) is relatively simpler than the hard disk in an image pool. You only need to use the replace command to directly replace the hard disk. # Zpool offline rpool upgrade # export ADM-c unconfigure c1: dsk/c1t0d0 <Physically remove failed disk c1t0d0> <Physically insert replacement disk c1t0d0> # export ADM-c configure c1 :: dsk/c1t0d0 # zpool replace rpool c1t0d0s0 # zpool online rpool ready # zpool status rpool <Let disk resilver before installing the boot blocks> iSCSI # installboot-F zfs/usr/platform/'uname -I '/lib/fs/zfs/bootblk/dev/rdsk/c1t0 D0s0x86 # installgrub/boot/grub/stage1/boot/grub/stage2/dev/rdsk/c1t9d0s0 non-redundant pool if the root pool is not mirrored, You need to partition the new disk first, add the root pool to form a mirrored type pool. Add new disk and check # devfsadm partition and tag # format-e c8t1d0 format> partitionSELECT one of the following: 1. create a partition... partition> printCurrent partition table (original): Total disk cylinders available: 30398 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 1-30396 232.85 GB (30396/0/0) 488311740 1 unassigned wu 0 0 (0/0/0) 0 2 backup wu 0-30396 232.85 GB (30397/0/0) 488327805 3 u Nassigned wu 0 0 (0/0/0) 0 4 unassigned wu 0 0 (0/0/0) 0 5 unassigned wu 0 0 (0/0/0) 0 6 unassigned wu 0 0 (0/0/0) 0 7 unassigned wu 0 0 0 (0/0/0) 0 8 boot wu 0-0 7.84 MB (1/0/0) 16065 9 unassigned wu 0 0 (0/0/0) 0 partition> quit format> label [0] SMI Label [1] EFI LabelSpecify Label type [0]: 0 Ready to label disk, continue? Y: Add new disk partitions to the root pool to form an image pool, data Synchronization in this step may take a long time # zpool attach rpool c0d0s0 c0d2s0Make sure to wait until resilver is done before rebooting. # zpool status pool: rpool state: ONLINEstatus: One or more devices is currently being resilvered. the pool will continue to function, possibly in a degraded state. action: Wait for the resilver to complete. scan: resilver in progress since Wed Jul 24 15:39:51 2 013 302 M scanned out of 7.47G at 11.2 M/s, 0h10m to go 269 M resilvered, 3.95% doneconfig: name state read write cksum rpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c0d0s0 0 0 0 c0d2s0 ONLINE 0 0 0 (resilvering) errors: no known data errors installation start block On a iSCSI based system: # installboot-F zfs/usr/platform/'uname-I '/lib/fs/zfs/bootblk/dev/rdsk/c1t9d0s0On an x86 based system: # installgrub/boot/grub/ Stage1/boot/grub/stage2/dev/rdsk/c1t9d0s0 verify boot first view boot path # prtconf-vp | grep-I bootpath: '/virtual-devices @ 100/channel-devices @ 200/disk @ 0: a' it can be inferred that the end of the path for the new disk is disk @ 2:, then start {0} OK setenv boot-device/virtual-devices @ 100/channel-devices @ 200/disk @ 2: couldn t-device =/virtual-devices @ 100/channel-devices @ 200/disk @ 2: a {0} OK printenv boot-deviceboot-device =/virtual-devices @ 100/channel-devices @ 2 00/disk @ 2: a OK boot/virtual-devices @ 100/channel-devices @ 200/disk @ 2: a remove old disk # zpool detach rpool c0d0s0 expansion pool space because the previous disk space is smaller than the new disk space, so the current space is the same as before, you need to expand it. # Zpool set autoexpand = on rpool so far, success.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.