Mirroring Setup Step

Hi gurus

I had 2 hdd, each had 146GB, i want do the mirror for it,
and will mount on /u01

/dev/dsk/c0t1d0s6
/dev/dsk/c1t1d0s6

Can you all help me check or advice if i do the step wrongly,
coz this is my first time for this:

#metainit d11 1 1 c0t1d0s6
#metainit d12 1 1 c1t1d0s6
#metainit d10 -m d11
#metastat
#metaattach d10 d12
#metastat

Am i need to update in my vfstab?
am i need to restart?

kindly advise

If you are using Solaris 10 or newer, you can forget old style volume management and use zfs instead.

zpool create d10 mirror c0t1d0s6 c1t1d0s6

and that's it.
No vfstab, no newfs, no growfs, no fsck, no nothing ...

after i run it, it come out an error

# zpool create d10 mirror c0t1d0s6 c1t1d0s6
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c0t1d0s6 contains a ufs filesystem.

---------- Post updated at 06:30 PM ---------- Previous update was at 06:11 PM ----------

zpool create -f d10 mirror c0t1d0s6 c1t1d0s6

i had success use above command to create a mirror disk

---------- Post updated at 07:11 PM ---------- Previous update was at 06:30 PM ----------

#metainit d11 1 1 c0t1d0s6
#metainit d12 1 1 c1t1d0s6
#metainit d10 -m d11
#metastat

edit the vfstab

#metattach d10 d12
#metastat

but may i know the above step is it correct?
after that is it need to update in vfstab?

If you use ufs you'll need to update vfstab.
If you mirror simple filesystem (not root-filesystem) you do not need to reboot. Create mirror and mount it to mountpoint.

mount -F ufs /dev/md/dsk/d10 /u01

Is it the ZFS have better IO rate compare with UFS ?
This is because, this file storage in my project is using for heavy IO.

It might. That depends on the IO profile and ZFS tuning/settings. Enabling ZFS compression often improve IO figures.

if i want to switch from ZFS to UFS
is it need to format the disk first before switch to UFS?

You need to backup any data you want to save, destroy the pool and newfs the slice(s).

I found something weird

# metastat d4
d4: Mirror
    Submirror 0: d41
      State: Okay
    Submirror 1: d42
      State: Resyncing
    Resync in progress: 3 % done
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 166937472 blocks (79 GB)

d41: Submirror of d4
    State: Okay
    Size: 166937472 blocks (79 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c0t0d0s4          0     No            Okay   Yes


d42: Submirror of d4
    State: Resyncing
    Size: 166937472 blocks (79 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s4          0     No            Okay   Yes

when i mount it

mount -F ufs /dev/md/dsk/d4 /u02

it show me

/dev/md/dsk/d4          39G    40M    39G     1%    /u02

it should be 79 GB.

any idea on it?

This suggests that the filesystem was built to 39G. Try growing the fs,

See - Expanding a File System Using the growfs Command (Solaris Volume Manager Administration Guide) - Sun Microsystems

Thanks guru, You are right. =)

There is no possibility how to change from ZFS to UFS.
If you prefere to use UFS / but I am not sure why??? / you must backup data from ZFS pool, destroy ZFS pool / zfs destroy / , create new partitions on cleared devices / fdisk /, then create new filesystem / newfs /, mount new devices / mount / and restore data back.
Just one advice.... ZFS is much more advanced filesystem then UFS, if you learn how to use it is much better.

Probably not ideal in term of overhead but you might create an UFS filesystem on top of a ZFS volume and benefit from several ZFS features like snapshots and clones.