Vous êtes sur la page 1sur 45

CSE398:SystemAdministration

BackupandRestore

Spring2004

Whydoyouneedbackups?

Whatarebackups?

Backupandrestorepolicies

Backupschedule

Capacityandconsumablesplanning

CSE398:SystemAdministration

2004BrianD.Davison

Backupandrestore

Whydoweneedbackups?

Datagetslost.

Equipmentfails.

Humansdeletedatabymistakeandonpurpose.

Judgesimpoundalldocumentsrelatedtoa
lawsuitthatwerestoredonyourcomputersona
certaindate.

Datagetscorrupted,eitherbymistake,on
purpose,orbygammaraysfromspace.

Youneedreliablebackups.

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Threereasonstoneedrestores

Accidentalfiledeletion

Mostcommoncase

Userswantimmediaterestoration,but35hours
istypical,fromadayoldbackup

Spring2004

Asaresult,someuserswillregenerate(losing
productivity)ratherthanrestore

Newersystemsofferselfservicerestores(typically
fromasystemthattakesregularsnapshots)

CSE398:SystemAdministration

2004BrianD.Davison

Threereasonstoneedrestores(2)

Diskfailure

Doeshappen

Impliesbothlossofserviceandlossofdata

RAIDshouldbedeployedtopreventlossofservice

Archival

Spring2004

Needtorecordsnapshotforbusinessorlegal
reasonsorfordisasterrecovery

Workissimilartoafulldiskrestore

Archivesaretypicallystoredoffsite
CSE398:SystemAdministration

2004BrianD.Davison

Dataintegrity

Datacanbecorrupted

Maliciouslybyvirusesorindividuals

Inadvertentlybyindividuals,bugs,andhardwarefailures

Ensuringintegritycanbeadaytodayoperation

Comparestaticfilesagainstachecksum

Keepviruscheckingsoftwareuptodate

Lookforanomalies(e.g.,largechangestostaticdata)

Needlongtermbackupstohandleunnoticedproblems

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Whatarebackups?

Afullbackup(level0)isacompletecopyofthefiles
onapartition(ataparticulartime)

Anincrementalbackupisthestorageofthechanged
filessincethelastfullbackup(akaalevel1backup)

Incrementalbackupsgrowovertime

Somesystemsallowincrementalbackups(e.g.,level
2)ofchangessincethelastincrementalbackup
(level1)

Spring2004

Thus,therecanbelevel3,level4,level5backups,etc.

CSE398:SystemAdministration

2004BrianD.Davison

Example

Usage

Spring2004

Backups

Sat:A1B1C1D1

Sat:L0A1B1C1D1

Mon:A2B1C2D1

Mon:L1A2C2

Tue:A3B1C2D2

Tue:L1A3C2D2

Wed:A4B2C3D3

Wed:L1A4B2C3D3

Thu:A5B2C4D3

Thu:L2A5C4

Fri:A5B3C5D3

Fri:L2A5B3C5

CSE398:SystemAdministration

2004BrianD.Davison

Differentcustomers

Thethreetypesofrestoresservedifferent
customers

Individualuserrequestsfilerestoration

Legalandfinancialdepartmentsrequirearchival
backups

Spring2004

Althoughsometimestherequirementistonotbackup
data,orkeepforrelativelyshortperiodssothatit
cannotbethetargetofasubpoena

Completediskrestoresareneededforsysadmins
whoaremaintainingsomeSLA
CSE398:SystemAdministration

2004BrianD.Davison

Backuppolicies

Needanorganizationwidedocumentthatdictates
requirementsforbackupsystems

Spring2004

Explainwhybackupsareneeded

Whatconstitutesabackup

Whatdatashouldbebackedup

Definelegalrequirements

Definewhenbackupsshouldbeperformed

CSE398:SystemAdministration

2004BrianD.Davison

DatarecoverySLA

Considerthethreetypesofrestoresneeded

negotiatethedesiredtimetorestoration

determinethegranularityandretentionperiod

timewindowinwhichbackupsareperformed

Sample(aggressive)servicelevelagreementonnextslide.
Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

ExampleSLA

Customersshouldbeabletogetbackanyfilewitha
granularityofonebusinessdayforthelastsix
monthsandwithagranularityofonemonthforthe
lastthreeyears.

Diskfailuresshouldberestoredinfourhours,with
nomorethantwobusinessdaysoflostdata.

Archivesshouldbefullbackupsonseparatetapes
generatedquarterlyandkeptforever.

Criticaldatawillbestoredonasystemthatretains
useraccessiblesnapshotsmadeeveryhour.

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Backupschedule

GivenanSLAandpolicy,weneedto
schedulethebackups

listthedetailsofwhichpartitionsarebackedup
andwhen

modernbackupsoftwarewill(mostly)schedule
forusautomatically

Spring2004

Needtospecifyhowoftenfullbackupsarerun

thescheduledeterminestheamountofbackup
mediarequired
CSE398:SystemAdministration

2004BrianD.Davison

Example#1

Partitionof4GB

Scheduledfullbackupevery28days

Incrementalotherdays

Assumeincrementalsizegrows5%perday

Tapecapacityneeded:

Spring2004

Firstday,4GB(fullbackup)

2ndday,200MB,3rdday400MB,etc.

11thday,2GB,21stday4GB,etc.
CSE398:SystemAdministration

2004BrianD.Davison

Example#1,continued

Atsomepoint,itisbettertogeneratelevel0
backupsmoreoften

SNATable21.1(page450)showsbestcasefor
thisexampletobea7daylevel0cycle(49.2GB)

Longercycleswritetoomuchduplicatecontent

Smallestcycle(fulldumpseachday)worstcaseat
168GBdumped!

Amountofdatadumpeddeterminesamount
ofmediarequired

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Example#2

Previousexamplesomewhatsimplistic
Assumecustomersmodify10%offilesper
day,butoverlapswithpreviousday'
s
changes.
Thus,firstincrementalis10%,but
subsequentonesgrowonlyby1%
SNATable21.2(page452)showsbestcase
forthisexampletobea14daylevel0cycle
(37GB);worstcaseofdailylevel0(168GB)

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Scheduling

Morecomplexscheduling(e.g.,incorporating
level2backups,etc.)canminimizetape
usage
Drawbacks

Spring2004

Morecomplextotrack(notreallyaproblem)

Restoresareslower,moredifficultanderror
prone

CSE398:SystemAdministration

2004BrianD.Davison

Timeandcapacityplanning

Backupsandrestoresareconstrainedbytime

Backupsmustbeperformedduringcertaintimewindows

RestoresmustoccurwithinanSLA

Backupperformanceisaffectedby

readperformanceofdisk

writeperformanceofbackupmedium

bandwidthandlatencyofnetworkbetween

Restoreperformanceisaffectedbyreverse

Oftenmuch(515times)longer!

Needtodorealtesttoverifytimeandcapacity!

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Consumablesplanning

Policyandscheduledetermineconsumablesusage
(tapes,cleaners,etc.)

Usingsamplepolicy,incrementalscanberecycledafter
sixmonthsstorage,andfullbackupsafterthreeyears

Forfirstsixmonths,neednewtapesforeverything

Spring2004

Ifweneed8tapesperday,sixdaysaweek,forsixmonths
(1248tapes),at$40ea,or$49,920

CSE398:SystemAdministration

2004BrianD.Davison

Consumablesplanning(2)

In2ndsixmonths,we(mostly)justneedtobuytapes
forfullbackups

Assume9tapesperweek,plusonetapeforgrowing
incrementals
260tapes,at$9,100(assuming$35/ea)

2ndand3rdyeararesimilar

4thyearischeaper(canrecyclearchives)butcapacity
willlikelysoonbeinsufficient

Needtodeterminebackuppolicythatbalancescost
withrequiredcapabilities

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Therestoreprocess

Needtosetcustomerexpectations

Evenasimpleexplanationishelpful

Considersecurityimplications

Whocanrequestfilerestoration?

Wherewilltherestoredfilebeplaced?

Multiplepeopleneedtoknowhowtorestore
data

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Backupautomation/centralization

Backupsmustbeautomated

boringautomationisonlywayforreliability

tapehandlingcanbeprovidedbyclerks

Backupsshouldbecentralized

Spring2004

theyareexpensiveandimportant!

distributedtapedrivesareexpensiveand
manuallyintensive(tochangetapes)

tapejukeboxesareexpensive,butworthit
CSE398:SystemAdministration

2004BrianD.Davison

Otherconcerns

Firedrills

Onlywaytofullytestsystem

Goodwaytoburninnewhardware

Offsitestorage

Backupsshouldnotbeaffectedbydisasterthataffects
systemsbackedup

Mediaoffsiteisasecurityrisk

Canbeinformal(companyofficers)

Canbeformal(storageservice)

Tapecapacityvs.diskcapacityratiovariesovertime

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Helpfulhints

Performalldumpsfromone
machine

Labelyourtapes

Unlabeledtape==blanktape

Labelwithinfoneededto
restorerootand/usr

Pickreasonablebackup
interval

Easeofoperation,backuptoa
singledevice

Howmuchdataareyourusers
willingtolose?

Limitactivityduringdumps

Spring2004

Choosefilesystemscarefully

Somerarelychange

Makefilesystemssmaller
thanyourdumpdevice

Keeptapesoffsite

Protectyourbackups

Copiesofeverything!

Checkyourtapes

Developatapelifecycle

Designyourdataforbackups

Preparefortheworst

CSE398:SystemAdministration

2004BrianD.Davison

Backupsandmagneticmedia

CompaniesexisttobackupovertheInternet

Mostbackupsstillperformedlocally

Shouldbetoremovablemedia(toprevent
failure/disasterfromaffectingallcopies)
Careofmagneticmediaavoidmagnetic
fields,suchas

Spring2004

audiospeakers,transformersandpowersupplies,
unshieldedtapeandharddrives,fans,monitors,
andearth'
sbackgroundradiation
CSE398:SystemAdministration

2004BrianD.Davison

Backupmedia

Floppydisks

Superfloppies

don'
tevenconsiderexpensive,unreliable,slow
Zip100/250/750MBdisks;highmediacosts

CDR,CDRW,recordableDVD

Photochemicalprocessinitiatedbylaser

Muchlongershelflifebelievedthanmagneticmedia

650MBforCDROM;2.6GB,4.7GB,5.2GB,9.4GBforDVD

manycompeting(DVD)formats

Removableharddisks

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Tapes

Manyformats

8mmcartridgetapes

DAT(4mm)cartridgetapes

Travantapes

DLT

AIT

Mammoth

Varietyofcapacitiesandspeeds

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Tapejukeboxes/stackers/libraries

Manytimesyouneedmultipletapesforafullbackup

Stacker

Jukebox

Simpletapechangerforusewitha
standardtapedrive
automaticallychangeremovablemedia
amongasetofdrives

Tapelibrary

Spring2004

largemechanisms,multipledrives,
roboticarmforretrieval
CSE398:SystemAdministration

2004BrianD.Davison

Incrementalbackupswithdump

dumpandrestorearebasiccommands

oftenthebuildingblocksusedbycommercial
systems

dump

Spring2004

buildsalistoffilesthathavebeenmodifiedsince
apreviousdump

packsthemintoasinglefiletoarchiveonan
externaldevice

CSE398:SystemAdministration

2004BrianD.Davison

dumpadvantages

Backupscanspanmultipletapes

Filesofanytype(includingdevices)canbebacked
upandrestored

Permissions,ownerships,andmodificationtimesare
preserved

Fileswithholesarehandledcorrectly

Backupscanbeperformedincrementally

Efficientbecauseitunderstandsfilesysteminternals
(readsinodetablesviadeviceentry)

Canhandlearbitrarilylongfilenames/paths

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

dumplimitations

Everyfilesystem(partition)mustbedumped
independently
Onlylocal(notNFSmounted)filesystemscan
bedumped
Incrementaldumpsmayrequirerestoring
filesfromseveralsetsoftapes

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

dumpandtar

GNUversionoftarcandomostofwhatdumpcando

Candumpalocalfilesystemtoaremotetapedrive
withrdump

dumptakesparameters

thebackuplevel(09)

AlevelNbackupisincrementalfromthelastdump<N

thedevicetostoreon(orstdout)

thefilesystemtobackup

# rdump -2u -f anchor:/dev/nst0 /spare

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Restoringfromdumps

Createandcdtoatemporarydirectory

Interactiverestorewithrestorei

readsthetableofcontents,letsyounavigateanormal
directorytree(ls, cd, pwd)

selectfilestorestorewithaddcommand

extractstartsretrievingfiles

Ex:

Spring2004

mkdir /var/restore; cd /var/restore

rsh tapehost mt -f /dev/nst0 fsf 3

rrestore -x -f tapehost:/dev/nst0 ./janet/iamlost


CSE398:SystemAdministration

2004BrianD.Davison

Restoringentirefilesystems

Firstneedtocreateandmounttarget
filesystem
Startwithfirsttapeofmostrecentlevel0
dump

Spring2004

typerestore -r

mountandrestoreincrementaldumpsinorderof
creation

CSE398:SystemAdministration

2004BrianD.Davison

Exampledumpsequences

000000

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Exampledumpsequences

000000

05555

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Exampledumpsequences

000000

05555

032545

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Exampledumpsequences

000000

05555

032545

099599399599

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Exampledumpsequences

000000

05555

032545

099599399599

0359359

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Exampledumpsequences

000000

05555

032545

099599399599

0359359

Onlyrequiredtapesforrestorationarein
bold

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Dumping&restoringforupgrades

Dumpbeforeupgrading

asinsuranceforproblems(candropbackto
previousversion)

tobeabletochangepartitioning

tohandledifferentfilesystemformats

Needtoincludesystemspecificfiles

Spring2004

in/or/usr,suchas/etc/passwd,/usr/local

CSE398:SystemAdministration

2004BrianD.Davison

Otherarchivingprograms

tar

alsousefulformovingdirectorytrees

tar -cf fromdir | (cd todir ; tar -xfp - )

cpio

reallyold;nottypicallyused

dd

Spring2004

filecopyingandconversionprogram

CSE398:SystemAdministration

2004BrianD.Davison

AMANDA

AdvancedMarylandAutomaticNetworkDisk
Archiver

Spring2004

Sophisticated,popular,free,networkbackup
system

Wrapperarounddumpandrestore

Tapemanagementwritesaheadersoitnever
overwriteswrongtape

Managesdumplevelsbasedonconfigurationand
fullnessoftapes
CSE398:SystemAdministration

2004BrianD.Davison

Amandaarchitecture

Tapedrivesandholdingdisksareoncentralserver

Canwriteonlyonebackupimagetotapeatatime

Canspoolmultipledumpstoholdingdisks
simultaneously

Looksatconfigfilestodeterminewhichfilesystems
needtobebackedup,andwhatresourcesare
available(networkbandwidth,tapes,CPUload,etc.)

Clients(viadump)readfilesthroughthedevicefile
entry

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Amandascheduling

Amandadoesnotrigidlyscheduledumps

Youspecifyamountofredundancytoretain

Amandaspreadsoutworkloadacrossdumpcycle

Spring2004

Usingtapes/networkmoreefficiently

Willautomaticallymovetohigherdumplevel
whendumpsizeislargeenough

CSE398:SystemAdministration

2004BrianD.Davison

Additionalalternatives

Opensourcechoices

Commercialsystems

Arkeia,BURT,cddump,star
ADSM/TSM,Veritas,Legato

andmorehttp://www.backupcentral.com/

Spring2004

CSE398:SystemAdministration

2004BrianD.Davison

Vous aimerez peut-être aussi