Can someone please tell me how to format a new disk to ZFS format?

I have a Sun v240 with Solaris 10 update 8 installed on a single 73GB harddisk. Everything is working fine. I just purchased a another identical harddisk online. I plugged the disk into my v240 and ran 'devfsadm' and solaris found the new disk. I want to add this disk to my existing ZFS pool as a mirror. However, this disk was originally formatted with a UFS file system. So when I run:
zpool attach rpool c1t0d0 c1t1d0I get:
/dev/dsk/c1t1d0s0 contains a ufs filesystem.I understand the error message but I don't know how to format the disk to have a ZFS file system instead. Note that I am extremely new to Solaris, ZFS, and pretty much everything Sun - I bought this server on eBay so that I could learn more about it. It's been pretty fun so far but need some help here and there.
For some reason I can't find a single hit on Google telling me how to just simply format a disk to ZFS. Can I use the 'format' command? Maybe you don't "format" disks for ZFS? I have no idea. I might not have the right terminology. If so, apologies. Can anyone help me on this?
Thanks a lot! =D
Jonathon

Yes, you were right. The partitions were totally different. Here is what I saw:
For c1t0d0:
# format
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
  1 unassigned    wm       0                0         (0/0/0)             0
  2     backup    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0For c1t1d0:
# format
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 - 12865       62.43GB    (12866/0/0) 130924416
  1       swap    wu   12866 - 14079        5.89GB    (1214/0/0)   12353664
  2     backup    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
  3 unassigned    wm   14080 - 14086       34.78MB    (7/0/0)         71232
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0So then I ran the following:
# prtvtoc /dev/rdsk/c1t0d0s0 | fmthard -s - /dev/rdsk/c1t1d0s0
fmthard:  New volume table of contents now in place.Then I rechecked the partition table for c1t1d0:
# format
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
  1 unassigned    wu       0                0         (0/0/0)             0
  2     backup    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
  3 unassigned    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)             0Woo-hoo!! It matches the first disk now! :)
Then I tried to attach the new disk to the pool again:
# zpool attach -f rpool c1t0d0s0 c1t1d0s0
Please be sure to invoke installboot(1M) to make 'c1t1d0s0' bootable.
Make sure to wait until resilver is done before rebooting.
bash-3.00# zpool status
  pool: rpool
state: ONLINE
status: 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.
scrub: resilver in progress for 0h0m, 0.40% done, 0h58m to go
config:
        NAME          STATE     READ WRITE CKSUM
        rpool         ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c1t0d0s0  ONLINE       0     0     0
            c1t1d0s0  ONLINE       0     0     0  30.3M resilvered
errors: No known data errorsBoo-yah!!! ++Does little dance++
Then, after resilvering completed I ran:
# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0I think I'm starting to understand this now. I also shutdown the server to the OpenBoot prompt and booted off of the new disk and it worked! Also, my bootup time to login has drastically decreased - I would say it's about half the time it was before I added the mirror disk. So I believe the server is properly reading from both disks simultaneously in order to get better bandwidth. Cool! :)
Thanks for the help!
Jonathon

Similar Messages

Maybe you are looking for