Ignore:
Timestamp:
09/06/13 08:19:48 (14 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
5a6ce05
Parents:
fe78043
Message:

Add new "mirror" functionality to the 'lpreserver' command. This will
easily allow the user to add a new disk, such as an external USB drive
to mirror their existing zpool.

Now we have to do the GUI bits and add options to the installer for
restoring from the external disk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/lpreserver/lpreserver

    r3c8d32d r1996f85  
    4040Type in help <command> for information and usage about that command 
    4141 
     42       help - This help file or the help for the specified command 
     43 
     44   cronsnap - Schedule snapshot creation via cron 
    4245        get - Get list of lpreserver options 
    43        help - This help file 
     46   listcron - Listing of scheduled snapshots 
     47   listsnap - List snapshots of a zpool/dataset 
    4448     mksnap - Create a ZFS snapshot of a zpool/dataset 
    45    listsnap - List snapshots of a zpool/dataset 
    46    listcron - Listing of scheduled snapshots 
    47    cronsnap - Schedule snapshot creation via cron 
     49     mirror - Enable / Disable ZFS mirroring to a local drive 
     50  replicate - Enable / Disable ZFS replication to a remote system 
    4851 revertsnap - Revert zpool/dataset to a snapshot 
    49   replicate - Enable / Disable ZFS replication to a remote system 
     52     rmsnap - Remove a snapshot 
    5053        set - Set lpreserver options 
    5154     status - List datasets, along with last snapshot / replication date  
    52      rmsnap - Remove a snapshot 
    5355__EOF__ 
     56}; 
     57 
     58help_mirror() 
     59{ 
     60 title 
     61 echo "Help mirror 
     62 
     63Life-Preserver mirror sub-system 
     64 
     65Mirroring uses ZFS to create a exact copy of your target disk to a new drive, 
     66such as an external USB disk. When first started the mirror will take a while 
     67to sync or "resilver". Once this is finished your new disk will be kept in sync 
     68with the target disk automatically, and can be used as a fall-back disk if the 
     69primary begins to fail.  
     70 
     71Should your primary disk fail the mirrored disk can then be used to restore 
     72the system via the restore option of the PC-BSD installation media.  
     73 
     74*NOTES*  
     75 
     76* Mirroring will only work with a non-raidz ZFS pool. If you are using 
     77raidz you will need to manage disks through the "zpool" command.  
     78 
     79* The mirror disk must be the same size or larger than the target disk 
     80 
     81Available Flags: 
     82        list - List mirror disks 
     83         add - Add a new mirror disk 
     84      remove - Remove a mirror disk 
     85 
     86Add Options: 
     87 
     88        add <zpool> <new disk> 
     89 
     90        Example 1:  
     91 
     92        add tank1 /dev/da0 
     93 
     94        Will enable mirroring of the tank1 pool to /dev/da0 
     95 
     96Remove Options: 
     97 
     98        remove <zpool> <disk> 
     99         
     100        Remove a mirrored disk from the zpool 
     101 
     102        Use 'mirror list' for a list of available disks  
     103 
     104List Options: 
     105 
     106        lizt <zpool> 
     107         
     108        Lists mirrored disks of a zpool 
     109 
     110Usage: 
     111 
     112  lpreserver mirror <subcmd> <flags> 
     113 
     114Example: 
     115 
     116  lpreserver mirror list tank1 
     117" 
    54118}; 
    55119 
     
    324388           listsnap) help_listsnap ;; 
    325389           revertsnap) help_revertsnap ;; 
     390           mirror) help_mirror ;; 
    326391           replicate) help_replicate ;; 
    327392           cronsnap) help_cronsnap ;; 
     
    421486                        fi 
    422487                        ;; 
    423                 *) exit_err "Invalid option!" ;; 
     488                *) help_replicate ;; 
     489            esac 
     490         ;; 
     491    mirror) require_root 
     492            shift 
     493            case ${1} in 
     494                add) add_mirror_disk "$2" "$3" ;; 
     495                list) list_mirror_disks "$2" ;; 
     496                remove) rem_mirror_disk "$2" "$3" ;; 
     497                *) help_mirror ;; 
    424498            esac 
    425499         ;; 
Note: See TracChangeset for help on using the changeset viewer.