2.1. SVM
Display status for metadevice or hot spare pool
metastat metastat -p
Affiche les erreurs et les LV des disques
metastat -a ou -c
Supprimer les lv des disques
metaclear
Il arrive qu'un LV soit en maintenance:
metastat | more d90: Mirror Submirror 0: d91 State: Needs maintenance Submirror 1: d92 State: Needs maintenance Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 143349312 blocks (68 GB)
#metastat -c (n'existe pas en solaris 8) d284 p 34GB d270 d283 p 4.0GB d270 d282 p 500MB d270 d281 p 10GB d270 d280 p 1.5GB d270 d270 m 50GB d271 d271 s 50GB c1t1d0s7 d84 p 34GB d70 d83 p 4.0GB d70 d82 p 500MB d70 d81 p 10GB d70 d80 p 1.5GB d70 d70 m 50GB d71 d71 s 50GB c1t0d0s7 d90 m 68GB d91 (maint) d92 (maint) d91 s 68GB c1t2d0s6 (last-erred) d92 s 68GB c1t3d0s6
Pour voir si le disque est HS faire un format --> analyze --> read on the c1t0d0 disk.
Sinon un metasync peut corriger le problème si le disque n'est pas HS
#metasync d90
Afficher la table des slices (table des partitions, slice 3)
#metadb
Mettre en miroir deux luns
Partitionner le 2eme disque à l'identique :
prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s /dev/rdsk/disque2
Création des metadb de sauvegarde (penser à créer la partition)
metadb -fac 3 c0t0d0s7 c0t1d0s7
Editer /etc/lvm/md.tab (fichier de configuration du raid logiciel) après modif :
metainit -af (initialise le miroir) metastat (stats du miroir) metaroot d0
editer le fichier /etc/vfstab pour configurer les autres partitions puis reboot
metattach d0 d2
Créer et mettre en mirroir des slices:
Create under c0t0d0s5 four different soft partitions:
d31, d32, d33, d34 as 6GB, 7GB, 4GB and 7GB: # metainit d31 -p c0t0d0s5 5g d31: Soft Partition is setup
# metainit d32 -p c0t0d0s5 7500m d32: Soft Partition is setup
# metainit d33 -p c0t0d0s5 4400m d33: Soft Partition is setup
# metainit d34 -p c0t0d0s5 7500m d34: Soft Partition is setup
To create a stripe you should create the exact four slices to the second disk, c0t2d0:
# metainit d41 -p c0t2d0s5 5g d41: Soft Partition is setup
# metainit d42 -p c0t2d0s5 7500m d42: Soft Partition is setup
# metainit d43 -p c0t2d0s5 4400m d43: Soft Partition is setup
# metainit d44 -p c0t2d0s5 7500m d44: Soft Partition is setup
Now we have four soft partitions, or we can consider them as four different slices, under first disk and another four equal size soft partitions, to the second disk. We could stripe them and create four mount points to install, Oracle software, for instance.
# metainit d51 1 2 d31 d41 d51: Concat/Stripe is setup
# metainit d52 1 2 d32 d42 d52: Concat/Stripe is setup
# metainit d53 1 2 d33 d43 d53: Concat/Stripe is setup
# metainit d54 1 2 d34 d44 d54: Concat/Stripe is setup
Our new volumes are: d51, d52, d53 and d54. These will be our mount points what we are looking for. We just have to format and add them to the vfstab.
# newfs -v /dev/md/rdsk/d51 # newfs -v /dev/md/rdsk/d52 # newfs -v /dev/md/rdsk/d53 # newfs -v /dev/md/rdsk/d54
Create the mount points: /u01 /u02 /u03 and /u04 and mount the previous volumes
# mkdir /u01 /u02 /u03 /u04 # mount -F ufs -o logging /dev/md/dsk/d51 /u01 # mount -F ufs -o logging /dev/md/dsk/d52 /u02 # mount -F ufs -o logging /dev/md/dsk/d53 /u03 # mount -F ufs -o logging /dev/md/dsk/d54 /u04
Afficher le cache ZFS
echo ::memstat | mdb -k
Page Summary Pages MB %Tot ------------ ---------------- ---------------- ---- Kernel 1319269 5153 2% ZFS File Data 993669 3881 1% Anon 39776 155 0% Exec and libs 4063 15 0% Page cache 38763 151 0% Free (cachelist) 44917 175 0% Free (freelist) 64662831 252589 96%
Total 67103288 262122 Physical 65223127 254777