Changes between Version 1 and Version 2 of jupiter/recovery


Ignore:
Timestamp:
04/30/06 20:14:36 (21 years ago)
Author:
Daniel Kahn gillmor
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • jupiter/recovery

    v1 v2  
    11= Recovering data from backups =
    22
     3Ok, there's been a disaster.  don't panic.
    34
     5== Preparing the logical volume for recovery ==
     6Plug in your most recent backup media, and update LVM's knowledge of the system volumes:
     7
     8{{{
     9jupiter:~# vgscan
     10  Reading all physical volumes.  This may take a while...
     11  Found exported volume group "vgbackup0_jupiter" using metadata type lvm2
     12  Found volume group "vghome_jupiter" using metadata type lvm2
     13  Found volume group "vg0_jupiter" using metadata type lvm2
     14jupiter:~# vgs vgbackup0_jupiter
     15  VG                #PV #LV #SN Attr  VSize   VFree 
     16  vgbackup0_jupiter   1   1   0 wzx-n 372.61G 279.46G
     17jupiter:~#
     18}}}
     19The `x` in the `Attr` column means we need to `vgimport` the volume group so that it can be used:
     20{{{
     21jupiter:~# vgimport vgbackup0_jupiter
     22  Volume group "vgbackup0_jupiter" successfully imported
     23jupiter:~# vgs vgbackup0_jupiter
     24  VG                #PV #LV #SN Attr  VSize   VFree 
     25  vgbackup0_jupiter   1   1   0 wz--n 372.61G 279.46G
     26jupiter:~#
     27}}}
     28activate the volume you care about, and switch it to read-only (so you don't destroy the backups by accident while trying to recover!)
     29{{{
     30jupiter:~# lvs vgbackup0_jupiter
     31  LV      VG                Attr   LSize  Origin Snap%  Move Copy%
     32  backup0 vgbackup0_jupiter -wi--- 93.15G                         
     33jupiter:~# lvchange -ay -pr vgbackup0_jupiter/backup0
     34  Logical volume "backup0" changed
     35jupiter:~# lvs vgbackup0_jupiter
     36  LV      VG                Attr   LSize  Origin Snap%  Move Copy%
     37  backup0 vgbackup0_jupiter -ri-a- 93.15G                         
     38jupiter:~#
     39}}}
     40
     41== mounting the recovery volume ==
     42
     43Create a place to mount the volume, and mount it.  remember to mount it read-only:
     44
     45{{{
     46jupiter:~# TODAY=$(date +%Y%m%d)
     47jupiter:~# mkdir /var/local/backups/recovery.$TODAY
     48jupiter:~# mount -o ro /dev/vgbackup0_jupiter/backup0 /var/local/backups/recovery.$TODAY   
     49jupiter:~#
     50}}}
     51
     52== look at the differences ==
     53
     54you can see what might have changed:
     55
     56{{{
     57jupiter:~# diff -qr /srv/calfs/home/ /var/local/backups/recovery.$TODAY/srv/calfs/home/ >/var/local/backups/changes.$TODAY
     58jupiter:~#
     59}}}
     60
     61== recovering data ==
     62
     63you should be able to use simple tools like `rsync` and `cp` to pull out old versions of data that you need to pull out.
     64
     65== clean up ==
     66
     67when yer done, you should clean up.  unmount the recovery volume, deactivate it, and export the volume group:
     68
     69{{{
     70jupiter:~# umount /var/local/backups/recovery.$TODAY
     71jupiter:~# lvchange -an vgbackup0_jupiter/backup0
     72jupiter:~# vgexport vgbackup0_jupiter
     73  Volume group "vgbackup0_jupiter" successfully exported
     74jupiter:~#
     75}}}
    476
    577== see also ==