Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:solaris:11:junior:l124 [2019/11/30 08:34] adminelearning:workbooks:solaris:11:junior:l124 [2020/01/30 03:28] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
-~~PDF:LANDSCAPE~~+====== SO303 - Storage Administration ======
  
-Dernière mise-à-jour : ~~LASTMOD~~+=====Preparing your Solaris 11 VM=====
  
-Version : 1.11.01+Before continuing further, shutdown your Solaris 11 VMUsing the **Storage** section of the **Oracle VM VirtualBox Manager**, add the following **.vmdk** disks to the **existing** SATA controller of your Solaris 11 VM:
  
-======SO210 - Gestion du Démarrage et de l'Arrêt======+^ Disk ^ Size ^ Name ^ 
 +| c7t2d0 | 200 Mb | Disk1.vmdk |  
 +| c7t3d0 | 200 Mb | Disk2.vmdk |  
 +| c7t4d0 | 200 Mb | Disk3.vmdk |  
 +| c7t5d0 | 200 Mb | Disk4.vmdk |  
 +| c7t6d0 | 200 Mb | Disk5.vmdk |  
 +| c7t7d0 | 20 Gb | Mirror.vmdk | 
  
 +Using the **System** section of the **Oracle VM VirtualBox Manager**, add a second processor to your Solaris 11 VM.
  
-=====Plateforme SPARC=====+Finally, boot your Solaris 11 VM.
  
-La séquence de boot d'une station SPARC est la suivante :+=====Introduction=====
  
-  - La PROM charge le bootblock +All previous versions of Solaris, including Solaris 10 use the **Unix File System** ( [[wp>Unix_File_System|UFS]] ) as their default file system. Solaris 11 uses the **Zettabyte File System** ( [[wp>Zfs|ZFS]] ), introduced with Solaris 10, as its default file system.
-  - Le bootblock charge le fichier ufsboot +
-  - ufsboot charge le noyau +
-  - Le fichier /etc/system est lu +
-  - Le noyau charge les modules +
-  - Le noyau lance /sbin/init +
-  - init lit le fichier /etc/inittab+
  
-La liste des commandes de la PROM sont :+====Solaris 11 and ZFS====
  
-^ Commande ^ Description ^ +The Solaris 11 implementation of ZFS includes the following capabilities:
-| help | Affiche les commandes | +
-| boot | Démarrage du système | +
-| boot -s | Démarrage en mode mono-utilisateur | +
-| boot -a | Démarrage interactif | +
-| boot -r | Démarrage avec création des fichiers périphériques après l'ajout des pilotes | +
-| banner | Affiche des informations sur le système | +
-| probe-scsi-all | Liste des périphériques SCSI | +
-| probe-scsi | Liste des périphériques SCSI | +
-| printenv | Affiche le périphérique de démarrage | +
-| setenv | Modifie le périphérique de démarrage |+
  
-La commande **eeprom** permet de modifier les paramètres de la mémoire PROM et d'y associer un mot de passe+  128-bit addressing, 
 +  data integrity assurance, 
 +  automated data corruption detection and repair, 
 +  * encryption, 
 +  * compression, 
 +  * de-duplication, 
 +  * quotas, 
 +  * file system migration between pools, 
 +  * snapshots.
  
-=====Plateforme PC=====+====ZFS Vocabulary====
  
-====BIOS====+The introduction of ZFS was obviously accompanied by a new vocabulary:
  
-Au démarrage de la machine, le premier programme exécuté est le BIOS. Le BIOS pour fonction de :+^ Term ^ Description ^ 
 +| pool | A storage element regrouping one or more disk partitions containing one or more file systems | 
 +| file system | A dataset containing directories and files | 
 +| clone | A copy of file system | 
 +| snapshot | A read-only copy of the state of a file system | 
 +| compression | The reduction of storage space achieved by the removal of duplicate data blocks | 
 +de-duplication | The reduction of storage space achieved by the removal of redundant data patterns | 
 +| checksum | A 256-bit number used to validate data when read or written | 
 +| encryption | The protection of data using a password | 
 +| quota | The maximum amount of disk space used by a group or user | 
 +| reservation | A preallocated amount of disk space assigned to a user or file system | 
 +| mirror | An exact duplicate of a disk or partition | 
 +| RAID-Z | ZFS implementation of [[wp>Raid_5#RAID_5|RAID-5]] | 
 +| RAID-Z2 | ZFS implementation of [[wp>Raid_6#RAID_6|RAID-6]] | 
 +| RAID-Z3 | ZFS implementation of Triple Parity RAID |
  
-  * Tester les composants et les circuits, +====ZFS Commands===
-  * Faire appel au BIOS de la carte graphique pour initialiser le système d'affichage, +
-  * Détecter les périphériques de stockage, +
-  * Lancer le **gestionnaire d'amorçage** du système d'exploitation.+
  
-====Gestionnaire d'amorçage====+The ZFS commands are as follows:
  
-Le gestionnaire d'amorçage est en règle générale placé dans le MBR du disque. Le format du MBR est le suivant :+^ Command ^ Description ^ 
 +| zpool | Used to manage ZFS pools | 
 +| zfs | Used to manage ZFS file systems |
  
-  * 446 octets pour le gestionnaire d'amorçage, +===The zpool Command===
-  * 64 octet pour la table de partitions, soit 16 octets par partition décrite, +
-  * 2 octets ayant une valeur fixe en hexadécimale de **AA55**.+
  
-Le gestionnaire d'amorçage sous Solaris est GRUB (Grand Unified Boot Loader).+The **zpool** command uses a set of subcommands:
  
-====Grub====+^ Command ^ Description ^ 
 +| create | Creates a storage pool and configures its mount point | 
 +| destroy | Destroys a storage pool | 
 +| list | Displays the health and storage usage of a pool | 
 +| get | Displays a list of pool properties | 
 +| set | Sets a property for a pool | 
 +| status | Displays the health of a pool | 
 +| history | Displays the commands issued for a pool since its creation | 
 +| add | Adds a disk to an existing pool | 
 +| remove | Removes a disk from an existing pool | 
 +| replace | Replaces a disk in a pool by another disk | 
 +| scrub | Verifies the checksums of a pool and repairs any damaged data blocks |
  
-**grub** se configure grâce au fichier **/boot/grub/menu.lst** selon la distribution utiliséePour visualiser ce fichier, il convient de saisir la commande suivante :+===The zfs Command=== 
 + 
 +The **zfs** command use a set of subcommands: 
 + 
 +^ Command ^ Description ^ 
 +| create | Creates a ZFS file system, sets its properties and automatically mounts it | 
 +| destroy | Destroys a ZFS file system or snapshot | 
 +| list | Displays the properties and storage usage of a ZFS file system 
 +| get | Displays a list of ZFS file system properties | 
 +| set | Sets a property for a ZFS file system | 
 +| snapshot | Creates a read-only copy of the state of a ZFS file system | 
 +| rollback | Returns the file system to the state of the **last** snapshot | 
 +| send | Creates a file from a snapshot in order to migrate it to another pool | 
 +| receive | Retrieves a file created by the subcommand **send** | 
 +| clone | Creates a copy of a snapshot | 
 +| promote | Transforms a clone into a ZFS file system | 
 +| diff | Displays the file differences between two snapshots or a snapshot and its parent file system | 
 +| mount | Mounts a ZFS file system at a specific mount point | 
 +| unmount | Unmounts a ZFS file system | 
 + 
 +====Solaris Slices==== 
 + 
 +Those familiar with UFS on Solaris will remember having to manipulate Solaris **slices**. Those slices still exist:
  
 <code> <code>
-cat /boot/grub/menu.lst +root@solaris:~format 
-#pragma ident   "@(#)menu.lst   1.2     10/06/11 SMI" +Searching for disks...done 
-# + 
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + 
-# +AVAILABLE DISK SELECTIONS: 
-# With zfs root the active menu.lst file is /<pool>/boot/grub/menu.lst +       0c7t0d0 <ATA-VBOX HARDDISK-1.0-20.00GB> 
-# This reference copy of the file is not used. +          /pci@0,0/pci8086,2829@d/disk@0,0 
-+       1. c7t2d0 <ATA-VBOX HARDDISK-1.0-200.00MB> 
-# default menu entry to boot +          /pci@0,0/pci8086,2829@d/disk@2,0 
-default 0 +       2c7t3d0 <ATA-VBOX HARDDISK-1.0-200.00MB> 
-+          /pci@0,0/pci8086,2829@d/disk@3,0 
-# menu timeout in second before default OS is booted +       3. c7t4d0 <ATA-VBOX HARDDISK-1.0-200.00MB> 
-# set to -1 to wait for user input +          /pci@0,0/pci8086,2829@d/disk@4,0 
-timeout 10 +       4. c7t5d0 <ATA-VBOX HARDDISK-1.0-200.00MB
-+          /pci@0,0/pci8086,2829@d/disk@5,
-# To enable grub serial console to ttya uncomment the following lines +       5. c7t6d0 <ATA-VBOX HARDDISK-1.0-200.00MB> 
-# and comment out the splashimage line below +          /pci@0,0/pci8086,2829@d/disk@6,0 
-# WARNING: do not enable grub serial console when BIOS console serial +       6. c7t7d0 <ATA-VBOX HARDDISK-1.0 cyl 2608 alt 2 hd 255 sec 63> 
-      redirection is active. +          /pci@0,0/pci8086,2829@d/disk@7,0 
-#   serial --unit=0 --speed=9600 +Specify disk (enter its number): 0 
-#   terminal serial +selecting c7t0d0 
-+[disk formatted] 
-# Uncomment the following line to enable GRUB splashimage on console +/dev/dsk/c7t0d0s1 is part of active ZFS pool rpoolPlease see zpool(1M)
-splashimage /boot/grub/splash.xpm.gz + 
-+ 
-# To chainload another OS +FORMAT MENU: 
-+        disk       select a disk 
-# title Another OS +        type       select (define) a disk type 
-#       root (hd<disk no>,<partition no>) +        partition  select (define) a partition table 
-      chainloader ++        current    describe the current disk 
-+        format     format and analyze the disk 
-# To chainload a Solaris release not based on grub +        fdisk      run the fdisk program 
-+        repair     repair a defective sector 
-# title Solaris 9 +        label      write label to the disk 
-#       root (hd<disk no>,<partition no>) +        analyze    surface analysis 
-      chainloader +1 +        defect     defect list management 
-#       makeactive +        backup     search for backup labels 
-+        verify     read and display labels 
-# To load a Solaris instance based on grub +        inquiry    show disk ID 
-+        volname    set 8-character volume name 
-# title Solaris <version+        !<cmd>     execute <cmd>, then return 
-#       root (hd<disk no>,<partition no>,x)     --x = Solaris root slice +        quit 
-#       kernel /platform/i86pc/multiboot +format> part 
-      module /platform/i86pc/boot_archive + 
-+ 
-# To override Solaris boot args (see kernel(1M))console device and +PARTITION MENU: 
-# properties set via eeprom(1Medit the "kernel" line to+        0      change `0' partition 
-# +        1      change `1' partition 
-#   kernel /platform/i86pc/multiboot <boot-args> -B prop1=val1,prop2=val2,... +        2      change `2' partition 
-# +        3      change `3' partition 
-#---------- ADDED BY BOOTADM - DO NOT EDIT ---------- +        4      change `4' partition 
-title Oracle Solaris 10 1/13 s10x_u11wos_24a X86 +        5      change `5' partition 
-findroot (rootfs0,0,a) +        6      change `6' partition 
-kernel /platform/i86pc/multiboot +        select select a predefined table 
-module /platform/i86pc/boot_archive +        modify modify a predefined partition table 
-#---------------------END BOOTADM-------------------- +        name   name the current table 
-#---------- ADDED BY BOOTADM - DO NOT EDIT ---------+        print  display the current table 
-title Solaris failsafe +        label  write partition map and label to the disk 
-findroot (rootfs0,0,a+        !<cmd> execute <cmd>, then return 
-kernel /boot/multiboot -s +        quit 
-module /boot/amd64/x86.miniroot-safe +partition> pri 
-#---------------------END BOOTADM--------------------+Current partition table (original): 
 +Total disk sectors available: 41926589 + 16384 (reserved sectors) 
 + 
 +Part      Tag    Flag     First Sector        Size        Last Sector 
 +  0  BIOS_boot    wm               256     255.88MB         524287     
 +         usr    wm            524288      19.74GB         41913087     
 +  2 unassigned    wm                          0              0     
 +  3 unassigned    wm                          0              0     
 +  4 unassigned    wm                          0              0     
 +  5 unassigned    wm                          0              0     
 +  6 unassigned    wm                          0              0     
 +  8   reserved    wm          41913088       8.00MB         41929471     
 + 
 +partition> 
 </code> </code>
  
-Pour désinstaller grub du MBR, utilisez une disquette DOS pour démarrer la machine puis taper la commande suivante au prompt :+<WRAP center round important 60%> 
 +Note the following line in the above output:
  
-  A> fdisk /mbr [Entrée]+**/dev/dsk/c7t0d0s1 is part of active ZFS pool rpool. Please see zpool(1M).**
  
-ou utilisez la commande dd.+Since you are using ZFS for storage management, you no longer need to bother about slices ! 
 +</WRAP>
  
-Le fichier **/boot/grub/menu.lst** ne doit jamais être modifié manuellementGrub doit est administré par la commande **bootadm** :+====iSCSI Storage==== 
 + 
 +In Solaris 10 the configuration of iSCSI LUNs was accomplished using the **iscsitadm** command and the ZFS **shareiscsi** propertyIn Solaris 11 these have been replaced by by the use of **Common Multiprotocol SCSI Target** ( COMSTAR )COMSTAR is a **framework** that turns a Solaris host into a SCSI target. 
 + 
 +COMSTAR includes the following features: 
 + 
 +  * scalability, 
 +  * compatibility with generic host adapters, 
 +  * multipathing, 
 +  * LUN masking and mapping functions. 
 + 
 +An iSCSI target is an **endpoint** waiting for connections from clients called **initiators**. A target can provide multiple **Logical Units** which provides classic read and write data operations. 
 + 
 +Each logical unit is backed by a **storage device**. You can create a logical unit backed by any one of the following: 
 + 
 +  * a file, 
 +  * a thin-provisioned file, 
 +  * a disk partition, 
 +  * a ZFS volume. 
 + 
 +=====LAB #1 - Managing ZFS Storage===== 
 + 
 +====Displaying Online Help==== 
 + 
 +Both the **zpool**and **zfs** commands have built-in online help:
  
 <code> <code>
-bootadm +root@solaris:~zpool help 
-bootadmcommand option must be specified +The following commands are supported: 
-USAGE+add      attach   clear    create   destroy  detach   export   get       
-        bootadm update-archive [-vn] [-R altroot [-p platform>]] +help     history  import   iostat   list     offline  online   remove    
-        bootadm list-archive [-R altroot [-p platform>]] +replace  scrub    set      split    status   upgrade   
-        bootadm set-menu [-R altroot] key=value +For more info, run: zpool help <command> 
-        bootadm list-menu [-R altroot]+root@solaris:~# zfs help 
 +The following commands are supported
 +allow       clone       create      destroy     diff        get          
 +groupspace  help        hold        holds       inherit     key          
 +list        mount       promote     receive     release     rename       
 +rollback    send        set         share       snapshot    unallow      
 +unmount     unshare     upgrade     userspace    
 +For more info, run: zfs help <command>
 </code> </code>
  
-Il est donc possible de visualiser le menu de démarrage actuel ainsi que les options de Grub :+<WRAP center round important 60%> 
 +Note that you can get help on subcommands by either using **zpool help <subcommand>** or **zfs help <subcommand>**. 
 +</WRAP> 
 + 
 +====Checking Pool Status==== 
 + 
 +Use the **zpool** command with the **list** subcommand to display the details of your pool:
  
 <code> <code>
-bootadm list-menu +root@solaris:~zpool list 
-The location for the active GRUB menu is: /boot/grub/menu.lst +NAME    SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT 
-default 0 +rpool  19.6G  6.96G  12.7G  35%  1.00x  ONLINE  -
-timeout 10 +
-0 Oracle Solaris 10 1/13 s10x_u11wos_24a X86 +
-1 Solaris failsafe+
 </code> </code>
  
-=====Processus Init=====+Now use the **status** subcommand:
  
-Le premier processus lancé par le noyau est **Init**. L'exécutable lancé est **/sbin/init**. Son rôle est de d'initialiser le système et de lancer certains autres services. +<code> 
 +root@solaris:~# zpool status 
 +  pool: rpool 
 + state: ONLINE 
 +  scan: none requested 
 +config:
  
-=====Niveaux d'exécution=====+ NAME        STATE     READ WRITE CKSUM 
 + rpool       ONLINE               0 
 +   c7t0d0s1  ONLINE               0
  
-Il existe 11 niveaux d'exécution ou **RUNLEVELS** sous Solaris. Dix des 11 sont réservés :+errorsNo known data errors 
 +</code>
  
-^ RUNLEVEL ^ Description ^ +====Creating a Mirrored Pool==== 
-| 0 | Arrêt de la machine pour un système SPARC | + 
-| S ou s | Mode mono-utilisateur avec seul la partition racine montée | +Create a ZFS mirrored pool called **mypool** using the first two of the five disks you recently created:
-| 1 | Mode mono-utilisateur pour la maintenance | +
-| 2 | Mode multi-utilisateur sans NFS | +
-| 3 | Mode multi-utilisateur avec NFS | +
-| 4 | Non-utilisé | +
-| 5 | Arrêt de la machine et coupure du courant | +
-| 6 | Redémarrage de la machine | +
-  +
-Pour connaître le niveau d'exécution actuel de la machine, saisissez la commande suivante :+
  
 <code> <code>
-# who -r +root@solaris:~# zpool create mypool mirror c7t2d0 c7t3d0
-         run-level 3  Nov 30 06:44          0  S+
 </code> </code>
  
-Pour modifier le niveau d'exécution courant, il convient d'utiliser la commande **init** ou **telinit** suivie du numéro du nouveau niveau d'exécution et éventuellement l'option suivante :+Check that your pool has been created:
  
-^ Option ^ Description ^ +<code> 
-| Q ou q | Demande à Init de relire le fichier /etc/inittab |+root@solaris:~# zpool list 
 +NAME     SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT 
 +mypool   187M   346K   187M   0%  1.00x  ONLINE 
 +rpool   19.6G  6.97G  12.7G  35%  1.00x  ONLINE 
 +</code>
  
-Pour modifier le niveau d'exécution par défaut, il convient d'utiliser la commande **svcadm -d**.+Display the file systems using the **zfs** command and the **list** subcommand:
  
-=====Inittab=====+<code> 
 +root@solaris:~# zfs list 
 +NAME                              USED  AVAIL  REFER  MOUNTPOINT 
 +mypool                            272K   155M    31K  /mypool 
 +rpool                            7.02G  12.3G  4.58M  /rpool 
 +rpool/ROOT                       4.87G  12.3G    31K  legacy 
 +rpool/ROOT/solaris               4.86G  12.3G  3.92G  / 
 +rpool/ROOT/solaris-backup-1      2.47M  12.3G  1.98G  / 
 +rpool/ROOT/solaris-backup-1/var    46K  12.3G   758M  /var 
 +rpool/ROOT/solaris/var            865M  12.3G   207M  /var 
 +rpool/VARSHARE                    100K  12.3G   100K  /var/share 
 +rpool/dump                       1.03G  12.3G  1.00G  - 
 +rpool/export                     87.6M  12.3G    32K  /export 
 +rpool/export/home                87.5M  12.3G    32K  /export/home 
 +rpool/export/home/trainee        87.5M  12.3G  87.5M  /export/home/trainee 
 +rpool/swap                       1.03G  12.3G  1.00G  - 
 +</code>
  
-Le fichier **/etc/inittab** permet de définir les services à démarrer en fonction du RUNLEVEL :+<WRAP center round important 60%> 
 +Note that the zpool command automatically creates a file system on **mypool** and mounts it at **/mypool**. 
 +</WRAP> 
 + 
 +====Adding File Systems to an Existing Pool==== 
 + 
 +Now create two file systems in your pool called **/home** and **/home/user1** and then display the results :
  
 <code> <code>
-cat /etc/inittab +root@solaris:~zfs create mypool/home 
-Copyright 2004 Sun Microsystems, Inc.  All rights reserved. +root@solaris:~# zfs create mypool/home/user1 
-# Use is subject to license terms. +root@solaris:~zfs list 
-# +NAME                              USED  AVAIL  REFER  MOUNTPOINT 
-# The /etc/inittab file controls the configuration of init(1M); for more +mypool                            184K   155M    32K  /mypool 
-# information refer to init(1M) and inittab(4).  It is no longer +mypool/home                        63K   155M    32K  /mypool/home 
-# necessary to edit inittab(4) directly; administrators should use the +mypool/home/user1                  31K   155M    31K  /mypool/home/user1 
-# Solaris Service Management Facility (SMF) to define services instead. +rpool                            7.02G  12.3G  4.58M  /rpool 
-# Refer to smf(5) and the System Administration Guide for more +rpool/ROOT                       4.87G  12.3G    31K  legacy 
-# information on SMF+rpool/ROOT/solaris               4.86G  12.3G  3.92G  
-+rpool/ROOT/solaris-backup-1      2.47M  12.3G  1.98G  
-# For modifying parameters passed to ttymon, use svccfg(1m) to modify +rpool/ROOT/solaris-backup-1/var    46K  12.3G   758M  /var 
-# the SMF repositoryFor example: +rpool/ROOT/solaris/var            865M  12.3G   207M  /var 
-+rpool/VARSHARE                    100K  12.3G   100K  /var/share 
-#       # svccfg +rpool/dump                       1.03G  12.3G  1.00G  - 
-#       svc:> select system/console-login +rpool/export                     87.6M  12.3G    32K  /export 
-#       svc:/system/console-login> setprop ttymon/terminal_type = "xterm" +rpool/export/home                87.5M  12.3G    32K  /export/home 
-#       svc:/system/console-login> exit +rpool/export/home/trainee        87.5M  12.3G  87.5M  /export/home/trainee 
-+rpool/swap                       1.03G  12.3G  1.00G  -
-#ident  "@(#)inittab    1.41    04/12/14 SMI" +
-ap::sysinit:/sbin/autopush -f /etc/iu.ap +
-sp::sysinit:/sbin/soconfig -f /etc/sock2path +
-smf::sysinit:/lib/svc/bin/svc.startd    >/dev/msglog 2<>/dev/msglog </dev/console +
-p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog+
 </code> </code>
  
-Dans l'exemple ci-dessus, chaque ligne non-commentée est composée de quatre champs, séparés par le caractère **:** :+<WRAP center round important 60%> 
 +Note that the two file systems **share** the same disk space as the parent pool. 
 +</WRAP>
  
-^ Champ ^ Nom ^ Description ^ +====Changing the Pool Mount Point====
-| 1 | Identifiant | Identifiant unique de la ligne composé de 1 à 4 caractères | +
-| 2 | RUNLEVELS | Liste des niveaux d'exécution concernés par la ligne | +
-| 3 | Action | Méthode utilisé pour lancer la commande se trouvant dans le champ 4 | +
-| 4 | Commande | Commande à lancer |+
  
-L'analyse de notre fichier d'exemple indique que le champ **action** prend une des directives suivantes :+Suppose that you want the /home file system mounted elsewhere rather than under the /mypool mount point. With ZFS, this is very simple:
  
-^ Directive ^ Description ^ +<code> 
-| sysinit | La commande est exécutée au démarrage da la machine avant les lignes boot et bootwait | +root@solaris:~# mkdir /users 
-| powerfail | La commande est exécutée quand init reçoit un signal SIGPWR d'un onduleur |+root@solaris:~# zfs set mountpoint=/users mypool/home 
 +root@solaris:~# zfs list 
 +NAME                              USED  AVAIL  REFER  MOUNTPOINT 
 +mypool                            196K   155M    31K  /mypool 
 +mypool/home                        63K   155M    32K  /users 
 +mypool/home/user1                  31K   155M    31K  /users/user1 
 +rpool                            7.02G  12.3G  4.58M  /rpool 
 +rpool/ROOT                       4.87G  12.3G    31K  legacy 
 +rpool/ROOT/solaris               4.86G  12.3G  3.92G  / 
 +rpool/ROOT/solaris-backup-1      2.47M  12.3G  1.98G  / 
 +rpool/ROOT/solaris-backup-1/var    46K  12.3G   758M  /var 
 +rpool/ROOT/solaris/var            865M  12.3G   207M  /var 
 +rpool/VARSHARE                    100K  12.3G   100K  /var/share 
 +rpool/dump                       1.03G  12.3G  1.00G  - 
 +rpool/export                     87.6M  12.3G    32K  /export 
 +rpool/export/home                87.5M  12.3G    32K  /export/home 
 +rpool/export/home/trainee        87.5M  12.3G  87.5M  /export/home/trainee 
 +rpool/swap                       1.03G  12.3G  1.00G  - 
 +</code>
  
 +<WRAP center round important 60%>
 +Note that ZFS has automatically and transparently unmounted **/mypool/home** and re-mounted it at **/users**.
 +</WRAP>
  
-=====Service Management Facility=====+====Adding a Hot Spare====
  
-Le SMF remplace le système de démarrage Unix System V basé sur des répertoires rcx.d.+To display all of the properties associated with **mypool**, use the **zpool** command and the **get** subcommand:
  
-Un service SMF est caractérisé par des entités :+<code> 
 +root@solaris:~# zpool get all mypool 
 +NAME    PROPERTY       VALUE                SOURCE 
 +mypool  allocated      673K                 - 
 +mypool  altroot        -                    default 
 +mypool  autoexpand     off                  default 
 +mypool  autoreplace    off                  default 
 +mypool  bootfs                            default 
 +mypool  cachefile      -                    default 
 +mypool  capacity       0%                   - 
 +mypool  dedupditto                        default 
 +mypool  dedupratio     1.00x                - 
 +mypool  delegation     on                   default 
 +mypool  failmode       wait                 default 
 +mypool  free           186M                 - 
 +mypool  guid           6502877439742337134 
 +mypool  health         ONLINE               - 
 +mypool  listshares     off                  default 
 +mypool  listsnapshots  off                  default 
 +mypool  readonly       off                  - 
 +mypool  size           187M                 - 
 +mypool  version        34                   default 
 +</code>
  
-  - un **SMF Manifest** +<WRAP center round important 60%> 
-    - Propriétés par défaut du service  +Note that the **autoreplace** property is set to **off**. In order to use a hot spare, this property needs to be set to **on**. 
-  - une ou plusieurs **méthodes** +</WRAP>
-    - un script permettant l'interaction avec le service +
-  - un ou plusieurs **exécutables** +
-  - un fichier **journal** +
-  - un FMRI  +
-    - Fault Management Resource Identifier+
  
-Le fichier méthode de cron est /lib/svc/method/svc-cron:+Set the autoreplace property to on:
  
 <code> <code>
-cat /lib/svc/method/svc-cron +root@solaris:~zpool set autoreplace=on mypool 
-#!/sbin/sh +root@solaris:~zpool get autoreplace mypool 
-# +NAME    PROPERTY     VALUE  SOURCE 
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved. +mypool  autoreplace  on     local 
-# Use is subject to license terms. +</code>
-+
-# ident "@(#)svc-cron   1.2     04/11/05 SMI" +
-+
-# Start method script for the cron service. +
-#+
  
-. /lib/svc/share/smf_include.sh+Add the fourth 200 Mb disk that you have created to **mypool** as a spare:
  
-if [ -p /etc/cron.d/FIFO ]; then +<code> 
-        if /usr/bin/pgrep -x -u 0 -z `/sbin/zonename` cron >/dev/null 2>&1; then +root@solaris:~# zpool add mypool spare c7t5d0  
-                echo "$0: cron is already running" +root@solaris:~# zpool status mypool 
-                exit $SMF_EXIT_ERR_NOSMF +  pool: mypool 
-        fi + state: ONLINE 
-fi+  scan: none requested 
 +config: 
 + 
 + NAME        STATE     READ WRITE CKSUM 
 + mypool      ONLINE           0     0 
 +   mirror-0  ONLINE               0 
 +     c7t2d0  ONLINE               
 +     c7t3d0  ONLINE               0 
 + spares 
 +   c7t5d0    AVAIL   
  
-if [ -x /usr/sbin/cron ]; then +errors: No known data errors
-        /usr/bin/rm -f /etc/cron.d/FIFO +
-        /usr/sbin/cron & +
-else +
-        exit 1 +
-fi +
-exit $SMF_EXIT_OK+
 </code> </code>
  
-Une **instance de service** peut prendre plusieurs états :+====Observing Pool Activity====
  
-  UNINITIALIZED +Create a random data file in **/users/user1**:
-    Ceci est le statut initial de tout service, avant qu'il soit traité (et démarré) par svc.startd(1M). +
-  OFFLINE +
-    Cela signifie que le service est activé, mais qu'il n'est pas en cours de fonctionnement ou indisponible. +
-  * ONLINE +
-    * Ce statut indique que le service fonctionne. Ce statut est celui attendu lors du fonctionnement normal d'un service. +
-  * DEGRADED +
-    * Le service fonctionne, mais de manière limitée. Une restauration de la part de l'administrateur provoquera son passage en mode ONLINE. +
-  * MAINTENANCE +
-    * Le service est indisponible mais activé, et requiert une opération de l'administrateur afin d'être réparé et relancé. +
-  * DISABLED +
-    * Le service est désactivé et ne fonctionne pas. Il n'est pas lancé au démarrage de la machine. +
-  * LEGACY-RUN +
-    * Ce statut est utilisé pour des pseudo-services qui ne sont pas directement gérés par SMF. Il ne garantit pas que le service soit en fonctionnement.+
  
-Pour voir les service il convient d'utiliser la commande **svcs -a** :+<code> 
 +root@solaris:~# cat /dev/urandom > /users/user1/randomfile & 
 +[1] 2617 
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +Write down the PID, you will need it in 2 minutes to kill the process you have just started. 
 +</WRAP> 
 + 
 +Now display the writes to the pool using the **iostat** subcommand of the **zpool** command:
  
 <code> <code>
-svcs -a +root@solaris:~zpool iostat -v 3 
-STATE          STIME    FMRI +               capacity     operations    bandwidth 
-legacy_run      6:44:47 lrc:/etc/rcS_d/S50sk98sol +pool        alloc   free   read  write   read  write 
-legacy_run      6:44:50 lrc:/etc/rc2_d/S10lu +----------  -----  -----  -----  -----  -----  ----- 
-legacy_run      6:44:50 lrc:/etc/rc2_d/S20sysetup +mypool      29.6M   157M           5    184  50.6K 
-legacy_run      6:44:50 lrc:/etc/rc2_d/S40llc2 +  mirror    29.6M   157M           5    184  50.6K 
-legacy_run      6:44:50 lrc:/etc/rc2_d/S42ncakmod +    c7t2d0                     5  1.46K  59.8K 
-legacy_run      6:44:50 lrc:/etc/rc2_d/S47pppd +    c7t3d0                     5  1.33K  56.9K 
-legacy_run      6:44:50 lrc:/etc/rc2_d/S70uucp +----------  -----  -----  -----  -----  -----  ----- 
-legacy_run      6:44:50 lrc:/etc/rc2_d/S72autoinstall +rpool       6.96G  12.7G      0     14  27.3K   124K 
-legacy_run      6:44:50 lrc:/etc/rc2_d/S73cachefs_daemon +  c7t0d0s1  6.96G  12.7G      0     14  27.3K   124K 
-legacy_run      6:44:51 lrc:/etc/rc2_d/S81dodatadm_udaplt +----------  -----  -----  -----  -----  -----  ----
-legacy_run      6:44:51 lrc:/etc/rc2_d/S89PRESERVE + 
-legacy_run      6:44:51 lrc:/etc/rc2_d/S94ncalogd +               capacity     operations    bandwidth 
-legacy_run      6:44:51 lrc:/etc/rc2_d/S98deallocate +pool        alloc   free   read  write   read  write 
-legacy_run      6:44:51 lrc:/etc/rc3_d/S16boot_server +----------  -----  -----  -----  -----  -----  ----- 
-legacy_run      6:44:51 lrc:/etc/rc3_d/S50apache +mypool      39.9M   147M      0    127      0  2.89M 
-legacy_run      6:44:51 lrc:/etc/rc3_d/S80mipagent +  mirror    39.9M   147M      0    127      0  2.89M 
-disabled        6:44:39 svc:/system/metainit:default +    c7t2d0      -      -      0    113      0  2.78M 
-disabled        6:44:39 svc:/system/device/mpxio-upgrade:default +    c7t3d0      -      -      0    110      0  2.89M 
-disabled        6:44:39 svc:/network/ipsec/ike:default +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:39 svc:/network/ipsec/manual-key:default +rpool       6.96G  12.7G      0     13      0  29.5K 
-disabled        6:44:39 svc:/network/ipfilter:default +  c7t0d0s1  6.96G  12.7G      0     13      0  29.5K 
-disabled        6:44:39 svc:/network/rpc/keyserv:default +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:39 svc:/network/rpc/nisplus:default + 
-disabled        6:44:39 svc:/network/nis/server:default +               capacity     operations    bandwidth 
-disabled        6:44:39 svc:/network/nis/client:default +pool        alloc   free   read  write   read  write 
-disabled        6:44:39 svc:/network/dns/client:default +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:39 svc:/network/ldap/client:default +mypool      53.3M   134M      0    128      0  2.78M 
-disabled        6:44:39 svc:/network/winbind:default +  mirror    53.3M   134M      0    128      0  2.78M 
-disabled        6:44:39 svc:/network/inetd-upgrade:default +    c7t2d0                0    112      0  2.44M 
-disabled        6:44:40 svc:/system/mdmonitor:default +    c7t3d0      -      -      0    113      0  2.78M 
-disabled        6:44:40 svc:/application/print/server:default +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:40 svc:/network/ntp:default +rpool       6.96G  12.7G      0     77      0   500K 
-disabled        6:44:40 svc:/system/auditd:default +  c7t0d0s1  6.96G  12.7G      0     77      0   500K 
-disabled        6:44:40 svc:/system/patch-finish:delete +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:40 svc:/system/pools:default + 
-disabled        6:44:40 svc:/system/rcap:default +               capacity     operations    bandwidth 
-disabled        6:44:40 svc:/network/rpc/bootparams:default +pool        alloc   free   read  write   read  write 
-disabled        6:44:40 svc:/network/samba:default +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:40 svc:/network/wins:default +mypool      65.5M   121M      0    171      0  3.08M 
-disabled        6:44:40 svc:/network/dhcp-server:default +  mirror    65.5M   121M      0    171      0  3.08M 
-disabled        6:44:40 svc:/network/nfs/server:default +    c7t2d0      -              153      0  3.08M 
-disabled        6:44:40 svc:/network/rarp:default +    c7t3d0      -      -      0    153      0  3.08M 
-disabled        6:44:40 svc:/application/gdm2-login:default +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:40 svc:/system/pools/dynamic:default +rpool       6.96G  12.7G      0     21      0  45.1K 
-disabled        6:44:40 svc:/application/management/webmin:default +  c7t0d0s1  6.96G  12.7G      0     21      0  45.1K 
-disabled        6:44:40 svc:/application/database/postgresql_83:default_32bit +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:40 svc:/application/database/postgresql_83:default_64bit + 
-disabled        6:44:40 svc:/application/database/postgresql:version_81 +               capacity     operations    bandwidth 
-disabled        6:44:40 svc:/application/database/postgresql:version_82 +pool        alloc   free   read  write   read  write 
-disabled        6:44:40 svc:/application/database/postgresql:version_82_64bit +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:40 svc:/system/prepatch:default +mypool      75.8M   111M      0    172      0  2.88M 
-disabled        6:44:40 svc:/milestone/patching:default +  mirror    75.8M   111M      0    172      0  2.88M 
-disabled        6:44:40 svc:/network/dns/server:default +    c7t2d0                0    149      0  2.85M 
-disabled        6:44:40 svc:/network/routing/legacy-routing:ipv4 +    c7t3d0      -      -      0    149      0  2.88M 
-disabled        6:44:40 svc:/network/routing/legacy-routing:ipv6 +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:40 svc:/network/routing/ndp:default +rpool       6.96G  12.7G      0      0      0    882 
-disabled        6:44:40 svc:/network/routing/rdisc:default +  c7t0d0s1  6.96G  12.7G      0      0      0    882 
-disabled        6:44:40 svc:/network/ipv6-forwarding:default +----------  -----  -----  -----  -----  -----  ----- 
-disabled        6:44:40 svc:/network/routing/ripng:default + 
-disabled        6:44:40 svc:/network/routing/zebra:quagga +^C
-disabled        6:44:40 svc:/network/routing/ripng:quagga +
-disabled        6:44:40 svc:/network/routing/route:default +
-disabled        6:44:40 svc:/network/ipv4-forwarding:default +
-disabled        6:44:40 svc:/network/routing/rip:quagga +
-disabled        6:44:40 svc:/network/routing/ospf:quagga +
-disabled        6:44:40 svc:/network/routing/ospf6:quagga +
-disabled        6:44:40 svc:/network/routing/bgp:quagga +
-disabled        6:44:40 svc:/network/security/kadmin:default +
-disabled        6:44:40 svc:/network/security/krb5kdc:default +
-disabled        6:44:40 svc:/network/tnd:default +
-disabled        6:44:40 svc:/network/http:apache2 +
-disabled        6:44:40 svc:/network/apocd/udp:default +
-disabled        6:44:40 svc:/network/nis/passwd:default +
-disabled        6:44:40 svc:/network/nis/update:default +
-disabled        6:44:40 svc:/network/nis/xfr:default +
-disabled        6:44:40 svc:/network/ipmievd:default +
-disabled        6:44:40 svc:/network/ntp4:default +
-disabled        6:44:40 svc:/network/slp:default +
-disabled        6:44:40 svc:/system/consadm:default +
-disabled        6:44:40 svc:/system/hotplug:default +
-disabled        6:44:40 svc:/system/labeld:default +
-disabled        6:44:40 svc:/system/tsol-zones:default +
-disabled        6:44:40 svc:/system/iscsitgt:default +
-disabled        6:44:40 svc:/system/sar:default +
-disabled        6:44:49 svc:/application/x11/xvnc-inetd:default +
-disabled        6:44:49 svc:/network/rpc/spray:default +
-disabled        6:44:49 svc:/network/rpc/wall:default +
-disabled        6:44:49 svc:/network/rpc/ocfserv:default +
-disabled        6:44:49 svc:/network/rpc/rex:default +
-disabled        6:44:49 svc:/network/security/krb5_prop:default +
-disabled        6:44:49 svc:/network/comsat:default +
-disabled        6:44:49 svc:/network/login:eklogin +
-disabled        6:44:49 svc:/network/login:klogin +
-disabled        6:44:49 svc:/network/rexec:default +
-disabled        6:44:49 svc:/network/shell:kshell +
-disabled        6:44:49 svc:/network/talk:default +
-disabled        6:44:49 svc:/network/swat:default +
-disabled        6:44:49 svc:/network/chargen:dgram +
-disabled        6:44:49 svc:/network/chargen:stream +
-disabled        6:44:49 svc:/network/daytime:dgram +
-disabled        6:44:49 svc:/network/daytime:stream +
-disabled        6:44:49 svc:/network/discard:dgram +
-disabled        6:44:49 svc:/network/discard:stream +
-disabled        6:44:49 svc:/network/echo:dgram +
-disabled        6:44:49 svc:/network/echo:stream +
-disabled        6:44:49 svc:/network/time:dgram +
-disabled        6:44:49 svc:/network/time:stream +
-disabled        6:44:49 svc:/network/tname:default +
-disabled        6:44:50 svc:/network/uucp:default +
-online          6:44:39 svc:/system/svc/restarter:default +
-online          6:44:40 svc:/system/installupdates:default +
-online          6:44:40 svc:/milestone/name-services:default +
-online          6:44:40 svc:/network/pfil:default +
-online          6:44:40 svc:/network/tnctl:default +
-online          6:44:40 svc:/network/loopback:default +
-online          6:44:40 svc:/system/filesystem/root:default +
-online          6:44:40 svc:/system/scheduler:default +
-online          6:44:41 svc:/system/boot-archive:default +
-online          6:44:41 svc:/system/filesystem/usr:default +
-online          6:44:41 svc:/platform/i86pc/eeprom:default +
-online          6:44:42 svc:/system/keymap:default +
-online          6:44:42 svc:/system/device/local:default +
-online          6:44:42 svc:/system/filesystem/minimal:default +
-online          6:44:42 svc:/network/ilomconfig-interconnect:default +
-online          6:44:42 svc:/system/rmtmpfiles:default +
-online          6:44:42 svc:/system/coreadm:default +
-online          6:44:42 svc:/system/name-service-cache:default +
-online          6:44:42 svc:/system/resource-mgmt:default +
-online          6:44:42 svc:/system/power:default +
-online          6:44:42 svc:/system/sysevent:default +
-online          6:44:42 svc:/system/device/fc-fabric:default +
-online          6:44:42 svc:/milestone/devices:default +
-online          6:44:42 svc:/system/cryptosvc:default +
-online          6:44:42 svc:/network/ipsec/ipsecalgs:default +
-online          6:44:42 svc:/network/ipsec/policy:default +
-online          6:44:42 svc:/system/pkgserv:default +
-online          6:44:42 svc:/system/manifest-import:default +
-online          6:44:42 svc:/system/patchchk:default +
-online          6:44:43 svc:/application/print/ppd-cache-update:default +
-online          6:44:47 svc:/network/physical:default +
-online          6:44:47 svc:/milestone/network:default +
-online          6:44:47 svc:/system/identity:domain +
-online          6:44:47 svc:/system/identity:node +
-online          6:44:47 svc:/system/picl:default +
-online          6:44:47 svc:/milestone/single-user:default +
-online          6:44:48 svc:/network/initial:default +
-online          6:44:48 svc:/network/routing-setup:default +
-online          6:44:48 svc:/system/filesystem/local:default +
-online          6:44:48 svc:/network/shares/group:default +
-online          6:44:48 svc:/system/sysidtool:net +
-online          6:44:48 svc:/system/cron:default +
-online          6:44:48 svc:/system/boot-archive-update:default +
-online          6:44:49 svc:/network/rpc/bind:default +
-online          6:44:49 svc:/system/sysidtool:system +
-online          6:44:49 svc:/network/nfs/mapid:default +
-online          6:44:49 svc:/network/nfs/cbd:default +
-online          6:44:49 svc:/network/service:default +
-online          6:44:49 svc:/platform/i86pc/kdmconfig:default +
-online          6:44:49 svc:/network/nfs/status:default +
-online          6:44:49 svc:/system/postrun:default +
-online          6:44:49 svc:/milestone/sysconfig:default +
-online          6:44:49 svc:/system/sac:default +
-online          6:44:49 svc:/network/iscsi/initiator:default +
-online          6:44:49 svc:/network/nfs/nlockmgr:default +
-online          6:44:49 svc:/system/utmp:default +
-online          6:44:49 svc:/system/console-login:default +
-online          6:44:49 svc:/network/inetd:default +
-online          6:44:49 svc:/application/management/wbem:default +
-online          6:44:49 svc:/application/opengl/ogl-select:default +
-online          6:44:50 svc:/network/rpc/gss:default +
-online          6:44:50 svc:/network/nfs/client:default +
-online          6:44:50 svc:/network/rpc/meta:default +
-online          6:44:50 svc:/application/x11/xfs:default +
-online          6:44:50 svc:/application/font/stfsloader:default +
-online          6:44:50 svc:/network/rpc/rstat:default +
-online          6:44:50 svc:/network/rpc/cde-calendar-manager:default +
-online          6:44:50 svc:/network/rpc/cde-ttdbserver:tcp +
-online          6:44:50 svc:/network/rpc/rusers:default +
-online          6:44:50 svc:/network/rpc/mdcomm:default +
-online          6:44:50 svc:/network/rpc/metamed:default +
-online          6:44:50 svc:/network/rpc/metamh:default +
-online          6:44:50 svc:/network/rpc/smserver:default +
-online          6:44:50 svc:/network/cde-spc:default +
-online          6:44:50 svc:/network/security/ktkt_warn:default +
-online          6:44:50 svc:/network/finger:default +
-online          6:44:50 svc:/network/login:rlogin +
-online          6:44:50 svc:/network/shell:default +
-online          6:44:50 svc:/system/filesystem/autofs:default +
-online          6:44:50 svc:/network/nfs/rquota:default +
-online          6:44:50 svc:/network/ftp:default +
-online          6:44:50 svc:/network/stdiscover:default +
-online          6:44:50 svc:/network/stlisten:default +
-online          6:44:50 svc:/network/telnet:default +
-online          6:44:50 svc:/system/dumpadm:default +
-online          6:44:50 svc:/network/rpc-100235_1/rpc_ticotsord:default +
-online          6:44:50 svc:/system/system-log:default +
-online          6:44:50 svc:/system/filesystem/volfs:default +
-online          6:44:50 svc:/network/ssh:default +
-online          6:44:50 svc:/network/sendmail-client:default +
-online          6:44:50 svc:/network/smtp:sendmail +
-online          6:44:50 svc:/application/management/seaport:default +
-online          6:44:50 svc:/application/management/snmpdx:default +
-online          6:44:51 svc:/milestone/multi-user:default +
-online          6:44:51 svc:/system/boot-config:default +
-online          6:44:51 svc:/application/management/sma:default +
-online          6:44:51 svc:/system/fmd:default +
-online          6:44:51 svc:/application/management/dmi:default +
-online          6:44:51 svc:/application/font/fc-cache:default +
-online          6:44:51 svc:/application/stosreg:default +
-online          6:44:51 svc:/milestone/multi-user-server:default +
-online          6:44:51 svc:/system/zones:default +
-online          6:44:51 svc:/application/cde-printinfo:default +
-online          6:44:52 svc:/application/graphical-login/cde-login:default +
-online          6:44:59 svc:/system/webconsole:console +
-offline         6:44:40 svc:/application/management/ocm:default +
-offline         6:44:40 svc:/application/print/ipp-listener:default +
-offline         6:44:49 svc:/application/print/rfc1179:default+
 </code> </code>
  
-Pour lister les processus associés à un service, il convient d'utiliser la commande **svcs -p <FMRI>**:+<WRAP center round todo 60%> 
 +Is your mirror functioning ? 
 +</WRAP> 
 + 
 +Now kill the process creating the file **randomfile** : 
 + 
 +  # kill -9 PID [Entrée] 
 + 
 +Delete the file **/users/user1/randomfile**:
  
 <code> <code>
-svcs -p svc:/system/sac:default +root@solaris:~rm -rf /users/user1/randomfile 
-STATE          STIME    FMRI +[1]+  Killed                  cat /dev/urandom > /users/user1/randomfile
-online          6:44:49 svc:/system/sac:default +
-                6:44:49      412 sac +
-                6:44:49      417 ttymon+
 </code> </code>
  
-Pour consulter les détails d'un service il convient d'utiliser la commande **svcs -l <FMRI>** :+====Setting a User Quota==== 
 + 
 +To set a user quota, you need to use the **set** subcommand of **zpool**:
  
 <code> <code>
-svcs -l svc:/system/sac:default +root@solaris:~zfs set quota=50M mypool/home/user1 
-fmri         svc:/system/sac:default +root@solaris:~# zfs get quota mypool 
-name         SAF service access controller +NAME    PROPERTY  VALUE  SOURCE 
-enabled      true +mypool  quota     none   default 
-state        online +root@solaris:~# zfs list 
-next_state   none +NAME                              USED  AVAIL  REFER  MOUNTPOINT 
-state_time   Sat Nov 30 06:44:49 2019 +mypool                            380K   155M    31K  /mypool 
-logfile      /var/svc/log/system-sac:default.log +mypool/home                        63K   155M    32K  /users 
-restarter    svc:/system/svc/restarter:default +mypool/home/user1                  31K  50.0M    31K  /users/user1 
-contract_id  58  +rpool                            7.03G  12.3G  4.58M  /rpool 
-dependency   require_all/none svc:/system/filesystem/local (online) +rpool/ROOT                       4.87G  12.3G    31K  legacy 
-dependency   require_all/none svc:/milestone/sysconfig (online)+rpool/ROOT/solaris               4.86G  12.3G  3.92G  
 +rpool/ROOT/solaris-backup-1      2.47M  12.3G  1.98G  / 
 +rpool/ROOT/solaris-backup-1/var    46K  12.3G   758M  /var 
 +rpool/ROOT/solaris/var            865M  12.3G   207M  /var 
 +rpool/VARSHARE                    101K  12.3G   101K  /var/share 
 +rpool/dump                       1.03G  12.3G  1.00G  - 
 +rpool/export                     89.3M  12.3G    32K  /export 
 +rpool/export/home                89.3M  12.3G    32K  /export/home 
 +rpool/export/home/trainee        89.3M  12.3G  89.3M  /export/home/trainee 
 +rpool/swap                       1.03G  12.3G  1.00G  -
 </code> </code>
  
-Pour désactiver un service il convient d'utiliser la commande **svcadm disable [-t] <FMRI>**L'option **-t** indique que le service est arrêté d'une manière temporaire et sera re-démarré au prochain re-boot du système :+<WRAP center round important 60%> 
 +Note that the quota of 50 Mb has been set on /mypool/home/user1. 
 +</WRAP> 
 + 
 +Now create a random data file in /users/user1:
  
 <code> <code>
-svcadm disable cron +root@solaris:~cat /dev/urandom > /users/user1/testfile 
-# svcs -l cron +catoutput error (0/131072 characters written
-fmri         svc:/system/cron:default +Disc quota exceeded
-name         clock daemon (cron) +
-enabled      false +
-state        disabled +
-next_state   none +
-state_time   Sat Nov 30 08:18:52 2019 +
-logfile      /var/svc/log/system-cron:default.log +
-restarter    svc:/system/svc/restarter:default +
-contract_id   +
-dependency   require_all/none svc:/system/filesystem/local (online+
-dependency   require_all/none svc:/milestone/name-services (online)+
 </code> </code>
  
-La commande **svcadm** est aussi utiliser pour :+<WRAP center round important 60%> 
 +After a few minutes, you will see the **Disc quota exceeded** message. 
 +</WRAP>
  
-  * Démarrer un service. L'option **-r** précise que le démarrage des dépendances doit aussi être effectué :+Looking at the available disk space on /users/user1 you will notice that the value is now 0:
  
-  svcadm enable [-r] <FMRI[Entrée]+<code> 
 +root@solaris:~zfs list mypool/home/user1 
 +NAME                USED  AVAIL  REFER  MOUNTPOINT 
 +mypool/home/user1  50.1M      0  50.1M  /users/user1 
 +</code>
  
-  Relancer un service :+Delete the **testfile** file:
  
-  svcadm restart <FMRI[Entrée]+<code> 
 +root@solaris:~rm -f /users/user1/testfile 
 +</code>
  
-  * Rafraîchir un service :+====Setting a User Reservation====
  
-  # svcadm refresh <FMRI> [Entrée]+As with setting quotas, setting a reservation is very simple:
  
-  * Réactiver un service. Ceci est utilisé pour passer un service antérieurement en mode maintenance ou en mode Degraded vers le mode Online après la réparation du service concerné :+<code> 
 +root@solaris:~# zfs set reservation=25M mypool/home/user1 
 +root@solaris:~# zfs get reservation mypool/home/user1 
 +NAME               PROPERTY     VALUE  SOURCE 
 +mypool/home/user1  reservation  25M    local 
 +</code> 
 +====Using Snapshots====
  
-  # svcadm clear <FMRI> [Entrée]+Create a file in **/users/user1**:
  
-Pour consulter la méthode associée à un serviceil convient d'utiliser la commande **svcprop -p** :+<code> 
 +root@solaris:~# echo "This is a test file for the first snapshot" > /users/user1/snapshot1  
 +root@solaris:~# ls /users/user1 
 +snapshot1 
 +</code> 
 + 
 +To create a snapshot of a ZFS file systemyou need to use the **snapshot** subcommand of the **zfs** command:
  
 <code> <code>
-svcprop -p start/exec system/cron +root@solaris:~zfs snapshot mypool/home/user1@Dec13
-/lib/svc/method/svc-cron+
 </code> </code>
  
-====Activer et Désactiver un Service ====+The snapshot is located in a hidden directory under **/users/user1** called **.zfs/snapshot**:
  
-Vous allez travailler sur le service **cron**. Vérifiez d'abord l'état du service :+<code> 
 +root@solaris:~# ls -l /users/user1/.zfs/snapshot 
 +total 3 
 +drwxr-xr-x   2 root     root           3 Dec 13 10:24 Dec13 
 +</code> 
 + 
 +As you can see, the snapshot contains the **snapshot1** file:
  
 <code> <code>
-# svcs cron +root@solaris:~# ls -l /users/user1/.zfs/snapshot/Dec13/ 
-STATE          STIME    FMRI +total 2 
-disabled        8:18:52 svc:/system/cron:default+-rw-r--r--   1 root     root          43 Dec 13 10:24 snapshot1
 </code> </code>
  
-Démarrez maintenant le service cron :+It is important to note here that the .zfs directory is also hidden from the **ls** command, even when using the **-a** switch:
  
 <code> <code>
-svcadm enable cron+root@solaris:~ls -laR /users/user1 
 +/users/user1: 
 +total 8 
 +drwxr-xr-x   2 root     root           3 Dec 13 10:24 . 
 +drwxr-xr-x   3 root     root           3 Dec 12 16:09 .. 
 +-rw-r--r--   1 root     root          43 Dec 13 10:24 snapshot1
 </code> </code>
  
-Contrôlez maintenant son état :+You can also create a recursive snapshot of all file systems in a pool:
  
 <code> <code>
-svcs cron +root@solaris:~zfs snapshot -r mypool@Dec13-1
-STATE          STIME    FMRI +
-online          8:21:14 svc:/system/cron:default+
 </code> </code>
  
-Rendez votre service cron inutilisable :+The snapshots are stored in their respective .zfs directories:
  
 <code> <code>
-mv /lib/svc/method/svc-cron /lib/svc/method/svc-cron.old +root@solaris:~ls /users/.zfs/snapshot 
-# svcadm restart cron+Dec13-
 +root@solaris:~# ls /users/user1/.zfs/snapshot 
 +Dec13    Dec13-1
 </code> </code>
  
-Contrôlez maintenant son état :+You can list all snapshots as follows:
  
 <code> <code>
-svcs cron +root@solaris:~zfs list -t snapshot -r mypool 
-STATE          STIME    FMRI +NAME                       USED  AVAIL  REFER  MOUNTPOINT 
-maintenance     8:22:28 svc:/system/cron:default+mypool@Dec13-1                0      -    31K  - 
 +mypool/home@Dec13-1                -    32K  - 
 +mypool/home/user1@Dec13            -  31.5K  - 
 +mypool/home/user1@Dec13-1          -  31.5K  -
 </code> </code>
  
-Identifiez maintenant le fichier log du service :+Create another file in **/users/user1**:
  
 <code> <code>
-svcs -x cron +root@solaris:~echo "This is a test file for the second snapshot" > /users/user1/snapshot2 
-svc:/system/cron:default (clock daemon (cron)) +root@solaris:~# ls -l /users/user1 
- State: maintenance since Sat Nov 30 08:22:28 2019 +total 4 
-Reason: Start method failed repeatedly, last exited with status 1. +-rw-r--r--   root     root          43 Dec 13 10:44 snapshot1 
-   Seehttp://sun.com/msg/SMF-8000-KS +-rw-r--r--   1 root     root          44 Dec 13 10:45 snapshot2 
-   See: cron(1M) +root@solaris:~# cat /users/user1/snapshot1 
-   See: crontab(1) +This is a test file for the first snapshot 
-   See: /var/svc/log/system-cron:default.log +root@solaris:~# cat /users/user1/snapshot2 
-Impact: This service is not running.+This is a test file for the second snapshot
 </code> </code>
  
-Examinez le fichier log pour connaître le problème à résoudre :+Now take a second recursive snapshot of **mypool**:
  
 <code> <code>
-cat /var/svc/log/system-cron:default.log +root@solaris:~zfs snapshot -r mypool@Dec13-2 
-[ Nov 29 13:26:34 Disabled. ] +root@solaris:~# zfs list -t snapshot -r mypool 
-[ Nov 29 13:26:34 Rereading configuration. ] +NAME                       USED  AVAIL  REFER  MOUNTPOINT 
-[ Nov 29 13:26:37 Enabled. ] +mypool@Dec13-1                        31K  - 
-[ Nov 29 13:26:46 Executing start method ("/lib/svc/method/svc-cron") ] +mypool@Dec13-2                        31K  - 
-[ Nov 29 13:26:46 Method "start" exited with status ] +mypool/home@Dec13-1                   32K  
-[ Nov 29 17:41:20 Executing start method ("/lib/svc/method/svc-cron") ] +mypool/home@Dec13-2                   32K  
-[ Nov 29 17:41:20 Method "start" exited with status ] +mypool/home/user1@Dec13             31.5K  
-[ Nov 30 05:28:20 Executing start method ("/lib/svc/method/svc-cron") ] +mypool/home/user1@Dec13-1     0       31.5K  
-[ Nov 30 05:28:20 Method "start" exited with status +mypool/home/user1@Dec13-2          -    33K  -
-[ Nov 30 06:14:40 Executing start method ("/lib/svc/method/svc-cron") ] +
-[ Nov 30 06:14:41 Method "start" exited with status 0 ] +
-[ Nov 30 06:19:26 Executing start method ("/lib/svc/method/svc-cron") ] +
-[ Nov 30 06:19:26 Method "start" exited with status +
-[ Nov 30 06:22:09 Executing start method ("/lib/svc/method/svc-cron") ] +
-[ Nov 30 06:22:09 Method "start" exited with status 0 ] +
-[ Nov 30 06:44:48 Executing start method ("/lib/svc/method/svc-cron") ] +
-[ Nov 30 06:44:48 Method "start" exited with status +
-[ Nov 30 08:18:52 Stopping because service disabled. ] +
-[ Nov 30 08:18:52 Executing stop method (:kill) ] +
-[ Nov 30 08:21:14 Enabled. ] +
-[ Nov 30 08:21:14 Executing start method ("/lib/svc/method/svc-cron") ] +
-[ Nov 30 08:21:14 Method "start" exited with status 0 ] +
-[ Nov 30 08:22:28 Stopping because service restarting+
-[ Nov 30 08:22:28 Executing stop method (:kill) ] +
-[ Nov 30 08:22:28 Executing start method ("/lib/svc/method/svc-cron") ] +
-/sbin/sh: /lib/svc/method/svc-cron: not found +
-[ Nov 30 08:22:28 Method "start" exited with status +
-[ Nov 30 08:22:28 Executing start method ("/lib/svc/method/svc-cron") ] +
-/sbin/sh: /lib/svc/method/svc-cron: not found +
-[ Nov 30 08:22:28 Method "start" exited with status 1 ] +
-[ Nov 30 08:22:28 Executing start method ("/lib/svc/method/svc-cron") ] +
-/sbin/sh: /lib/svc/method/svc-cron: not found +
-[ Nov 30 08:22:28 Method "start" exited with status 1 ]+
 </code> </code>
  
-Notez la ligne :+The **diff** subcommand of the **zfs** command displays the differences between two snapshots:
  
-<file+<code
-/sbin/sh: /lib/svc/method/svc-cron: not found +root@solaris:~# zfs diff mypool/home/user1@Dec13-1 mypool/home/user1@Dec13-
-</file>+M /users/user1/ 
 +M /users/user1/snapshot1 
 ++ /users/user1/snapshot2 
 +</code>
  
-Réparez maintenant le service cron :+<WRAP center round important 60%> 
 +The above out put shows that **/users/user1/snapshot2** has been added and included in the **second** snapshot as it appears in the command line. 
 +</WRAP> 
 + 
 +This output can contain the following characters: 
 + 
 +^ Character ^ Description ^ 
 +| M | **M**odification | 
 +| R | **R**enamed | 
 +| + | Added | 
 +| - | Deleted | 
 + 
 +Note that you cannot compare the snapshots in the reverse order:
  
 <code> <code>
-mv /lib/svc/method/svc-cron.old /lib/svc/method/svc-cron+root@solaris:~zfs diff mypool/home/user1@Dec13-2 mypool/home/user1@Dec13-
 +Unable to obtain diffs: mypool/home/user1@Dec13-1 is not a descendant dataset of mypool/home/user1@Dec13-2
 </code> </code>
  
-Lancez le service cron :+====Rolling Back to a Snapshot==== 
 + 
 +In the case that you wish to rollback to a specific snapshot, note that you can **only** roll back to the last snapshot as shown by the output of **zfs list**:
  
 <code> <code>
-svcadm clear cron +root@solaris:~zfs list -t snapshot -r mypool 
-svcadm enable -r cron+NAME                       USED  AVAIL  REFER  MOUNTPOINT 
 +mypool@Dec13-1                0      -    31K  - 
 +mypool@Dec13-2                0      -    31K  - 
 +mypool/home@Dec13-1                -    32K  - 
 +mypool/home@Dec13-2                -    32K  - 
 +mypool/home/user1@Dec13            -  31.5K  - 
 +mypool/home/user1@Dec13-1          -  31.5K  - 
 +mypool/home/user1@Dec13-2          -    33K  - 
 +root@solaris:~zfs rollback mypool/home/user1@Dec13-1 
 +cannot rollback to 'mypool/home/user1@Dec13-1': more recent snapshots exist 
 +use '-r' to force deletion of the following snapshots: 
 +mypool/home/user1@Dec13-2
 </code> </code>
  
-Dernièrement, vérifiez le bon fonctionnement du service cron :+Delete the **Dec13-2** snapshot as follows:
  
 <code> <code>
-# svcs cron+root@solaris:~# zfs destroy mypool/home/user1@Dec13-2 
 +root@solaris:~# zfs list -t snapshot -r mypool 
 +NAME                       USED  AVAIL  REFER  MOUNTPOINT 
 +mypool@Dec13-1                0      -    31K  - 
 +mypool@Dec13-2                0      -    31K  - 
 +mypool/home@Dec13-1                -    32K  - 
 +mypool/home@Dec13-2                -    32K  - 
 +mypool/home/user1@Dec13            -  31.5K  - 
 +mypool/home/user1@Dec13-1          -  31.5K  - 
 +</code> 
 + 
 +Now roll back to **Dec13-1**: 
 + 
 +<code> 
 +root@solaris:~# zfs rollback mypool/home/user1@Dec13-1 
 +root@solaris:~# ls -l /users/user1 
 +total 2 
 +-rw-r--r--   1 root     root          43 Dec 13 10:24 snapshot1 
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +Note that the **snapshot2** file has obviously disappeared since it was not in the **Dec13-1** snapshot. 
 +</WRAP>  
 + 
 +====Cloning a Snapshot==== 
 + 
 +Snapshots are read-only. To convert a snapshot to a writable file system, you can use the **clone** subcommand of the **zfs** command: 
 + 
 +<code> 
 +root@solaris:~# zfs clone mypool/home/user1@Dec13-1 mypool/home/user3 
 +root@solaris:~# zfs list 
 +NAME                              USED  AVAIL  REFER  MOUNTPOINT 
 +mypool                           25.5M   129M    31K  /mypool 
 +mypool/home                      25.1M   129M    34K  /users 
 +mypool/home/user1                50.5K  50.0M  31.5K  /users/user1 
 +mypool/home/user3                  18K   129M  31.5K  /users/user3 
 +rpool                            7.03G  12.3G  4.58M  /rpool 
 +rpool/ROOT                       4.87G  12.3G    31K  legacy 
 +rpool/ROOT/solaris               4.86G  12.3G  3.92G  / 
 +rpool/ROOT/solaris-backup-1      2.47M  12.3G  1.98G  / 
 +rpool/ROOT/solaris-backup-1/var    46K  12.3G   758M  /var 
 +rpool/ROOT/solaris/var            865M  12.3G   207M  /var 
 +rpool/VARSHARE                    102K  12.3G   102K  /var/share 
 +rpool/dump                       1.03G  12.3G  1.00G  - 
 +rpool/export                     90.5M  12.3G    32K  /export 
 +rpool/export/home                90.5M  12.3G    32K  /export/home 
 +rpool/export/home/trainee        90.4M  12.3G  90.4M  /export/home/trainee 
 +rpool/swap                       1.03G  12.3G  1.00G  - 
 +</code> 
 + 
 +Display the contents of **/users/user3**: 
 + 
 +<code> 
 +root@solaris:~# ls -l /users/user3 
 +total 2 
 +-rw-r--r--   1 root     root          43 Dec 13 10:24 snapshot1 
 +</code> 
 + 
 +====Using Compression==== 
 + 
 +In order to minimize storage space, you can make a file system use compression. Compression can be activated either at creation time or after creation. Compression only works for new data. Any existing data in the file system at the time of activating compression remains uncompressed. 
 + 
 +To activate compression on an existing file system, you need to change the file system's **compression** property from off to on: 
 + 
 +<code> 
 +root@solaris:~# zfs set compression=on mypool/home/user1 
 +root@solaris:~# zfs get compression mypool/home/user1 
 +NAME               PROPERTY     VALUE  SOURCE 
 +mypool/home/user1  compression  on     local 
 +</code> 
 + 
 +====Using De-duplication==== 
 + 
 +Another space saving property of ZFS file systems is **De-duplication**: 
 + 
 +<code> 
 +root@solaris:~# zfs set dedup=on mypool/home/user1 
 +root@solaris:~# zfs get dedup mypool/home/user1 
 +NAME               PROPERTY  VALUE  SOURCE 
 +mypool/home/user1  dedup     on     local 
 +</code> 
 + 
 +====Using Encryption==== 
 + 
 +Unlike **Compression** and **De-duplication**, **Encryption** can only be set on a file system at the time of creation: 
 + 
 +<code> 
 +root@solaris:~# zfs create -o encryption=on mypool/home/user2 
 +Enter passphrase for 'mypool/home/user2': fenestros 
 +Enter again: fenestros 
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +Note that the passphrase is not shown in the real output of the command. It is in the above example only for the purposes of this lesson. 
 +</WRAP> 
 + 
 +To check if encryption is active on a file system, use the following command: 
 + 
 +<code> 
 +root@solaris:~# zfs get encryption mypool/home/user1 
 +NAME               PROPERTY    VALUE  SOURCE 
 +mypool/home/user1  encryption  off    - 
 +root@solaris:~# zfs get encryption mypool/home/user2 
 +NAME               PROPERTY    VALUE  SOURCE 
 +mypool/home/user2  encryption  on     local 
 +</code> 
 + 
 + 
 + 
 +====Replacing a Faulty Disk==== 
 + 
 +In the case of a faulty disk and no hot spares, replacing the disk is a one-line operation using the **replace** subcommand of the **zpool** command: 
 + 
 +<code> 
 +root@solaris:~# zpool status mypool 
 +  pool: mypool 
 + state: ONLINE 
 +  scan: none requested 
 +config: 
 + 
 + NAME        STATE     READ WRITE CKSUM 
 + mypool      ONLINE               0 
 +   mirror-0  ONLINE               0 
 +     c7t2d0  ONLINE               0 
 +     c7t3d0  ONLINE               0 
 + spares 
 +   c7t5d0    AVAIL    
 + 
 +errors: No known data errors 
 +root@solaris:~# zpool replace mypool c7t2d0 c7t4d0 
 +</code> 
 + 
 +Use the **status** subcommand of the **zpool** command again to see what has happened: 
 + 
 +<code> 
 +root@solaris:~# zpool status mypool 
 +  pool: mypool 
 + state: ONLINE 
 +  scan: resilvered 601K in 0h0m with 0 errors on Thu Dec 13 11:45:49 2012 
 +config: 
 + 
 + NAME        STATE     READ WRITE CKSUM 
 + mypool      ONLINE               0 
 +   mirror-0  ONLINE               0 
 +     c7t4d0  ONLINE               0 
 +     c7t3d0  ONLINE               0 
 + spares 
 +   c7t5d0    AVAIL    
 + 
 +errors: No known data errors 
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +ZFS //Resilvering// is the equivalent of UFS re-synchronization. 
 +</WRAP>  
 + 
 +====Destroying a Pool==== 
 + 
 +Destroying a pool is achieved by using the **destroy** subcommand of the **zpool** command: 
 + 
 +<code> 
 +root@solaris:~# zpool destroy mypool 
 +</code> 
 + 
 +As you can see by the following output, this operation has also destroyed all the associated snapshots: 
 + 
 +<code> 
 +root@solaris:~# zfs list 
 +NAME                              USED  AVAIL  REFER  MOUNTPOINT 
 +rpool                            7.03G  12.3G  4.58M  /rpool 
 +rpool/ROOT                       4.87G  12.3G    31K  legacy 
 +rpool/ROOT/solaris               4.86G  12.3G  3.92G  / 
 +rpool/ROOT/solaris-backup-1      2.47M  12.3G  1.98G  / 
 +rpool/ROOT/solaris-backup-1/var    46K  12.3G   758M  /var 
 +rpool/ROOT/solaris/var            865M  12.3G   207M  /var 
 +rpool/VARSHARE                    102K  12.3G   102K  /var/share 
 +rpool/dump                       1.03G  12.3G  1.00G  - 
 +rpool/export                     90.5M  12.3G    32K  /export 
 +rpool/export/home                90.5M  12.3G    32K  /export/home 
 +rpool/export/home/trainee        90.4M  12.3G  90.4M  /export/home/trainee 
 +rpool/swap                       1.03G  12.3G  1.00G  - 
 +root@solaris:~# zfs list -t snapshot -r mypool 
 +cannot open 'mypool': filesystem does not exist 
 +root@solaris:~# ls -l /users 
 +total 0 
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +As you have seen above, destroying a pool, **all** the data in it and **all** the associated snapshots is disconcertingly simple. You should therefore be very careful when using the **destroy** subcommand. 
 +</WRAP> 
 + 
 + 
 + 
 +====Creating a RAID-5 Pool==== 
 + 
 +You can create a RAID-5 pool using the RAID-Z algorithm: 
 + 
 +<code> 
 +root@solaris:~# zpool create mypool raidz c7t2d0 c7t3d0 c7t4d0 spare c7t5d0 
 +root@solaris:~# zpool status mypool 
 +  pool: mypool 
 + state: ONLINE 
 +  scan: none requested 
 +config: 
 + 
 + NAME        STATE     READ WRITE CKSUM 
 + mypool      ONLINE               0 
 +   raidz1-0  ONLINE               0 
 +     c7t2d0  ONLINE               0 
 +     c7t3d0  ONLINE               0 
 +     c7t4d0  ONLINE               0 
 + spares 
 +   c7t5d0    AVAIL    
 + 
 +errors: No known data errors 
 +</code> 
 + 
 +Destroy **mypool** : 
 + 
 +<code> 
 +root@solaris:~# zpool destroy mypool 
 +</code> 
 + 
 +====Creating a RAID-6 Pool==== 
 + 
 +You can create a RAID-6 pool using the RAID-Z2 algorithm: 
 + 
 +<code> 
 +root@solaris:~# zpool create mypool raidz2 c7t2d0 c7t3d0 c7t4d0 c7t5d0 spare c7t6d0 
 +root@solaris:~# zpool status mypool 
 +  pool: mypool 
 + state: ONLINE 
 +  scan: none requested 
 +config: 
 + 
 + NAME        STATE     READ WRITE CKSUM 
 + mypool      ONLINE               0 
 +   raidz2-0  ONLINE               0 
 +     c7t2d0  ONLINE               0 
 +     c7t3d0  ONLINE               0 
 +     c7t4d0  ONLINE               0 
 +     c7t5d0  ONLINE               0 
 + spares 
 +   c7t6d0    AVAIL    
 + 
 +errors: No known data errors 
 +</code> 
 + 
 +Destroy **mypool** : 
 + 
 +<code> 
 +root@solaris:~# zpool destroy mypool 
 +</code> 
 + 
 +<WRAP center round todo 60%> 
 +Create a triple parity RAID **mypool** using your five 200MB disks. Do not delete it. 
 +</WRAP> 
 + 
 +====Displaying the Zpool History==== 
 + 
 +You can review everything that has been done to existing pools by using the **history** subcommand of the **zpool** command: 
 + 
 +<code> 
 +root@solaris:~# zpool history 
 +History for 'mypool': 
 +2012-12-13.14:02:17 zpool create mypool raidz3 c7t2d0 c7t3d0 c7t4d0 c7t5d0 spare c7t6d0 
 + 
 +History for 'rpool': 
 +2012-11-20.19:08:05 zpool create -f -B rpool c7t0d0s1 
 +2012-11-20.19:08:05 zfs create -p -o mountpoint=/export rpool/export 
 +2012-11-20.19:08:05 zfs set mountpoint=/export rpool/export 
 +2012-11-20.19:08:05 zfs create -p rpool/export/home 
 +2012-11-20.19:08:06 zfs create -p -o canmount=noauto -o mountpoint=/var/share rpool/VARSHARE 
 +2012-11-20.19:08:06 zfs set mountpoint=/var/share rpool/VARSHARE 
 +2012-11-20.19:08:07 zfs create -p -V 1024.0m rpool/dump 
 +2012-11-20.19:08:12 zfs create -p -V 1024.0m rpool/swap 
 +2012-11-20.19:08:20 zfs set primarycache=metadata rpool/swap 
 +2012-11-20.19:25:51 zfs set primarycache=metadata rpool/swap 
 +2012-11-20.19:26:25 zfs create rpool/export/home/trainee 
 +2012-11-20.22:45:56 zfs set primarycache=metadata rpool/swap 
 +2012-12-01.14:32:36 zfs set primarycache=metadata rpool/swap 
 +2012-12-03.13:15:45 zfs set primarycache=metadata rpool/swap 
 +2012-12-08.14:33:41 zfs /tmp/be 
 +2012-12-11.15:33:50 zfs set primarycache=metadata rpool/swap 
 +2012-12-12.09:57:00 zfs set primarycache=metadata rpool/swap 
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +Note that the history related to destroyed pools has been deleted. 
 +</WRAP> 
 + 
 +=====LAB #2 - Managing iSCSI Storage===== 
 + 
 +====Installing the COMSTAR Server==== 
 + 
 +Start by installing the COMSTAR storage server software: 
 + 
 +<code> 
 +root@solaris:~# pkg install group/feature/storage-server 
 +           Packages to install:  20 
 +       Create boot environment:  No 
 +Create backup boot environment: Yes 
 +            Services to change:   1 
 + 
 +DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED 
 +Completed                              20/20     1023/1023    54.5/54.5  636k/s 
 + 
 +PHASE                                          ITEMS 
 +Installing new actions                     1863/1863 
 +Updating package state database                 Done  
 +Updating image state                            Done  
 +Creating fast lookup database                   Done 
 +</code> 
 + 
 +The **COMSTAR target mode framework** runs as the **stmf** service. Check to see if it is enabled: 
 + 
 +<code> 
 +root@solaris:~# svcs \*stmf\*
 STATE          STIME    FMRI STATE          STIME    FMRI
-online          8:24:47 svc:/system/cron:default+disabled       15:43:16 svc:/system/stmf:default
 </code> </code>
  
-=====Arrêt du Système=====+Enable the service:
  
-====La commande shutdown====+<code> 
 +root@solaris:~# svcadm enable stmf 
 +root@solaris:~# svcs \*stmf\* 
 +STATE          STIME    FMRI 
 +online         16:01:56 svc:/system/stmf:default 
 +</code>
  
-La commande utilisée pour arrêter le système est la commande **shutdown** :+You can check the status of the server using the **stmfadm** command:
  
-  shutdown [-y] [-gsecondes] [-irunlevel]+<code> 
 +root@solaris:~# stmfadm list-state 
 +Operational Status: online 
 +Config Status     : initialized 
 +ALUA Status       : disabled 
 +ALUA Node         : 0 
 +</code>
  
-Les options sont :+====Creating SCSI Logical Units====
  
-^ Option ^ Description ^ +First you need to create your **Backing Storage Device** within your **mypool** pool:
-| -y | Commande non-intéractive | +
-| -gsecondes | Délai de grâce en secondes | +
-| -irunlevel | Choix du runlevel de destination |+
  
-L'option **-i** peut prendre plusieurs valeurs :+<code> 
 +root@solaris:~# zfs create -V 100M mypool/iscsi 
 +root@solaris:~# zfs list 
 +NAME                              USED  AVAIL  REFER  MOUNTPOINT 
 +mypool                            103M  51.6M    31K  /mypool 
 +mypool/iscsi                      103M   155M    16K  - 
 +rpool                            7.40G  11.9G  4.58M  /rpool 
 +rpool/ROOT                       5.22G  11.9G    31K  legacy 
 +rpool/ROOT/solaris               5.22G  11.9G  4.08G  / 
 +rpool/ROOT/solaris-backup-1      2.47M  11.9G  1.98G  / 
 +rpool/ROOT/solaris-backup-1/var    46K  11.9G   758M  /var 
 +rpool/ROOT/solaris-backup-2       127K  11.9G  3.92G  / 
 +rpool/ROOT/solaris-backup-2/var    58K  11.9G   266M  /var 
 +rpool/ROOT/solaris/var            980M  11.9G   209M  /var 
 +rpool/VARSHARE                    102K  11.9G   102K  /var/share 
 +rpool/dump                       1.03G  12.0G  1.00G  - 
 +rpool/export                      108M  11.9G    32K  /export 
 +rpool/export/home                 108M  11.9G    32K  /export/home 
 +rpool/export/home/trainee         108M  11.9G   108M  /export/home/trainee 
 +rpool/swap                       1.03G  12.0G  1.00G  - 
 +</code>
  
-^ Valeur ^ Description ^ +You can see your raw device in the **/dev/zvol/rdsk/mypool/** directory:
-| s | Single User. Ceci est le comportement par défaut | +
-| 0 | Arrêt complet SPARC | +
-| 5 | Arrêt complet x86 | +
-| 6 | Redémarrage |+
  
-Pour mieux comprendre, saisissez la commande suivante pour arrêter la machine dans minutes :+<code> 
 +root@solaris:~# ls -l /dev/zvol/rdsk/mypool 
 +total 0 
 +lrwxrwxrwx   1 root     root           0 Dec 14 09:42 iscsi -> ../../../..//devices/pseudo/zfs@0:6,raw 
 +</code> 
 + 
 +You can now create a logical unit using the **create-lu** subcommand of the **sbdadm** command:
  
 <code> <code>
-shutdown -y -g360 -i0+root@solaris:~sbdadm create-lu /dev/zvol/rdsk/mypool/iscsi 
 +Created the following LU:
  
-Shutdown started.    Sat Nov 30 08:26:05 CET 2019+       GUID                    DATA SIZE           SOURCE 
 +--------------------------------  -------------------  ---------------- 
 +600144f0e2a54e00000050cae6d80001  104857600            /dev/zvol/rdsk/mypool/iscsi 
 +</code>
  
-Broadcast Message from root (pts/2) on solaris.i2tch.loc Sat Nov 30 08:26:05... +====Mapping the Logical Unit====
-The system solaris.i2tch.loc will be shut down in 6 minutes +
  
-showmount: solaris.i2tch.locRPCProgram not registered+In order for the logical unit to be available to initiators, it has to be **mapped**In order to map the logical device you need its GUIDYou can use either one of the two following commands to get that information: 
 + 
 +<code> 
 +root@solaris:~# sbdadm list-lu 
 + 
 +Found 1 LU(s) 
 + 
 +       GUID                    DATA SIZE           SOURCE 
 +--------------------------------  -------------------  ---------------- 
 +600144f0e2a54e00000050cae6d80001  104857600            /dev/zvol/rdsk/mypool/iscsi
 </code> </code>
  
-Ouvrez un autre terminal puis saisissez la commande suivante pour rechercher le PID du processus shutdown :+<code> 
 +root@solaris:~# stmfadm list-lu -v 
 +LU Name: 600144F0E2A54E00000050CAE6D80001 
 +    Operational Status     : Online 
 +    Provider Name          : sbd 
 +    Alias                  : /dev/zvol/rdsk/mypool/iscsi 
 +    View Entry Count       : 0 
 +    Data File              : /dev/zvol/rdsk/mypool/iscsi 
 +    Meta File              : not set 
 +    Size                   : 104857600 
 +    Block Size             : 512 
 +    Management URL         : not set 
 +    Vendor ID              : SUN      
 +    Product ID             : COMSTAR          
 +    Serial Num             : not set 
 +    Write Protect          : Disabled 
 +    Write Cache Mode Select: Enabled 
 +    Writeback Cache        : Enabled 
 +    Access State           : Active 
 +</code> 
 + 
 +Create simple mapping for this logical unit by using the **add-view** subcommand of the **stmfadm** command:
  
 <code> <code>
-# ps -ef | grep shutdown +root@solaris:~# stmfadm add-view 600144F0E2A54E00000050CAE6D80001
-    root   907   824   0 08:26:06 pts/2       0:00 /sbin/sh /usr/sbin/shutdown -y -g360 -i0 +
-    root   948   932   0 08:27:14 pts/3       0:00 grep shutdown+
 </code> </code>
  
-Tuez maintenat le processus du shutdown :+====Creating a Target==== 
 + 
 +In order to create a target the **svc:/network/iscsi/target:default** service must be online. Check if it is:
  
 <code> <code>
-kill -9 907+root@solaris:~svcs \*scsi\* 
 +STATE          STIME    FMRI 
 +disabled       15:42:56 svc:/network/iscsi/target:default 
 +online         Dec_12   svc:/network/iscsi/initiator:default
 </code> </code>
  
-L'utilisation de la commande **shutdown** peut être accordée à d'autres utilisateurs de root en utilisant le fichier **/etc/shutdown.allow**+Start the service:
  
-====Autres commandes====+<code> 
 +root@solaris:~# svcadm enable -r svc:/network/iscsi/target:default 
 +root@solaris:~# svcs \*scsi\* 
 +STATE          STIME    FMRI 
 +online         Dec_12   svc:/network/iscsi/initiator:default 
 +online         10:06:54 svc:/network/iscsi/target:default 
 +</code> 
 + 
 +Now create a target using the **create-target** subcommand of the **itadm** command: 
 + 
 +<code> 
 +root@solaris:~# itadm create-target 
 +Target iqn.1986-03.com.sun:02:897fd011-8b3d-cf2b-fc1d-a010bd97d035 successfully created 
 +</code> 
 + 
 +To list the target(s), use the **list-target** subcommand of the **itadm** command: 
 + 
 +<code> 
 +root@solaris:~# itadm list-target 
 +TARGET NAME                                                  STATE    SESSIONS  
 +iqn.1986-03.com.sun:02:897fd011-8b3d-cf2b-fc1d-a010bd97d035  online           
 +</code> 
 + 
 +====Configuring the Target for Discovery==== 
 + 
 +Finally, you need to configure the target so it can be discovered by initiators: 
 + 
 +<code> 
 +root@solaris:~# devfsadm -i iscsi 
 +</code>
  
-Trois autres commandes existent pour arrêter la machine :+=====References=====
  
-^ Commande ^ Description ^ +  * **[[http://www.oracle.com/technetwork/documentation/solaris-11-192991.html|The Oracle Technology Network]]**
-| halt | Arrête le système ( RUNLEVEL 0 ) | +
-| reboot | Re-démarre le système ( RUNLEVEL 5/6 ) | +
-| poweroff | Arrête le système ( RUNLEVEL 0 ) et essaie de couper l'alimentation |+
  
 ----- -----
 <html> <html>
-<center>+<div align="center">
 Copyright © 2019 Hugh Norris. Copyright © 2019 Hugh Norris.
-</center> 
 </html> </html>
Menu