Backing up data On LINUX and UNIX. Logical backup Why? Job security For user data. Remember endian order, character set issues. Full backup + incremental.

Slides:



Advertisements
Similar presentations
Backup and Restore Procedures. Introduction Performing regular backups should be considered one of a responsible system administrators top priorities.
Advertisements

Va-scanCopyright 2002, Marchany Unit 8 – Solaris File Systems Randy Marchany VA Tech Computing Center.
BACKUPS Whenever a crash occurs we run a backup program. The backup device can be magnetic or a cartridge tape, a floppy diskette or even a disk file.
การใช้ระบบปฏิบัติการ UNIX พื้นฐาน บทที่ 4 File Manipulation วิบูลย์ วราสิทธิชัย นักวิชาการคอมพิวเตอร์ ศูนย์คอมพิวเตอร์ ม. สงขลานครินทร์ เวอร์ชั่น 1 วันที่
LINUX System : Lecture 3 (English-Only Lecture) Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang University Acknowledgement.
Backup & Restore Objectives –to understand Unix backup strategies Contents –why have backups –backup terminology –backup media –backup utilities –issues.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 12.
Exploring the UNIX File System and File Security
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Chapter 5 Accessing Files and Directories. How Directories Get Created OS installation: usr, dev, etc, export, kernel and others places to store installation.
Guide To UNIX Using Linux Third Edition
Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.
*nix and Non-Intel Platform issues CSC 486/586 1.
CS 497C – Introduction to UNIX Lecture 13: - The File System Chin-Chih Chang
Linux+ Guide to Linux Certification, Third Edition Chapter 11 Compression, System Backup, and Software Installation.
1 Objectives Discuss the Windows Printer Model and how it is implemented in Windows Server 2008 Install the Print Services components of Windows Server.
Linux Commands LINUX COMMANDS.
Backups in Linux Ning Zhu Class presentation. Introduction The dump and restore commands are the most common way to create and restore from backups in.
Chapter 11 Compression, System Backup, and Software Installation.
Linux+ Guide to Linux Certification
Brief introduction to UNIX A. Emerson CINECA, High Performance Systems.
F8-Noncommercial-Based Forensic Duplications Dr. John P. Abraham Professor UTPA.
Backup Techniques Objectives –to illustrate practical application of backup utilities Contents –using dd, a direct device access command –manipulating.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Offline File Storage. Module 12 Offline File Storage ♦ Introduction Backup is usually done by first collecting all the data in a single archive file,
CIS 90 - Lesson 14 Lesson Module Status Slides – Properties - Flash cards – No-stress quiz – Web calendar summary – Web book pages – Commands – Lab – done.
Lesson 11-Locating, Printing, and Archiving User Files.
Backup Track SA-E AfNOG workshop May 15, 2009 Cairo, Egypt (Slides by Phil Regnauld)
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
Unix Basics Chapter 4.
Linux Operations and Administration
Linux+ Guide to Linux Certification Chapter Thirteen Compression, System Back-Up, and Software Installation.
Carnegie Mellon Linux Boot Camp Jenna MacCarley, Peter Pearson, Shashank Goyal 9/19/2015.
Find Find basics. find ~ -name myfile –print find directory criteria This will search the home directory (~) looking for files.
1 Lecture 5 Additional useful commands COP 3353 Introduction to UNIX.
Workbook 5 - Part 2 The Linux Filesystem RH030 Linux Computing Essentials.
Chapter Eight Exploring the UNIX Utilities. 2 Lesson A Using the UNIX Utilities.
Guide To UNIX Using Linux Third Edition Chapter 8: Exploring the UNIX/Linux Utilities.
Guide To UNIX Using Linux Third Edition Chapter 8: Exploring the UNIX/Linux Utilities.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
System Administration – Part 2. Devices in UNIX are files: A device can be accessed with different file names All device files are stored in /dev or its.
Linux Commands C151 Multi-User Operating Systems.
1 itec 400 Backups George Vaughan Franklin University.
Filesystem Management and Backups. 2 Section Overview Devices and Files Filesystem Management Network Filesystems Backups.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Feb 3 rd, 2009 Essential Unix Commands …the second half.
Chapter 19 File System Backup. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To describe how files and directories can be archived.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
Memory management. Linux Memory Management Total memory available for processes = real memory + paging space - 1MB. First megabyte of real memory is used.
tar: The tape archive program _______________________ Amber Jain IC-2K7-05 _______________________.
Back it up – Don't be a fool!
Filesystem Management and Backups
Overview – SOE Rsync SEP 2014.
Cairo, Egypt (Slides by Phil Regnauld)
Linux file system "On a UNIX system, everything is a file;
FTP Lecture supp.
COP 4343 Unix System Administration
File Managements.
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
Chapter Four UNIX File Processing.
Linux Commands LINUX COMMANDS.
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
A shell is a user interface.
January 26th, 2004 Class Meeting 2
Chapter 10 Archives and Backups.
Presentation transcript:

Backing up data On LINUX and UNIX

Logical backup Why? Job security For user data. Remember endian order, character set issues. Full backup + incremental = backup set No differential (see find command). Backup without a restore test is just a tape mt or rmt used for generic tape management. See mt, rmt manpage. See /dev/rmt0 See text for CD/DVD procedures Use commercial products for business. Why? Tape catalog management.

Backup Commands cp (duh) ftp (eh) rcp (no, no, no) scp rsync tar cpio pax (see cpio, tar) dump/restore – the standard

The usual suspects cp –rp source destination ftp hostname user name cd source or destination lcd destination/source put/get filename quit scp source scp /destination rcp source rcp source:/pathtofile /destination uses.rhosts see manpage on hosts.equiv

rsync Support from rsync.samba.org rsync copies files either to or from a remote host, or locally on the current host but does not support copying files between two remote hosts. rsync can reduce the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. There are two different ways for rsync to contact a remote system: using a remote- shell program as the transport (such as ssh or rsh) or contacting an rsync daemon directly via TCP. See the manpage on rsyncd.conf. rsync –avh /source /destination rsync -avze ssh /home/user/directory/ Other Options -a, --archive archive mode; equals -r, --recursive recurse into directories -u, --update skip files that are newer on the receiver

Tape ARchive Most portable backup utility between systems. Oldest resource for user data backup. Destination is always larger than source. Use with compress. Be careful with builtin compress (GNU command); not as portable. Subject to errors especially in extract (see cpio) tar –cvf /archivefile /source1 /source2 creates archive. Remember caveat on relative versus absolute path archives. tar –tvf /archivefile Always list archive before extracting. Remember caveat about extracts as root. tar –xvf /archivefile Extract archive Other optiions: -A append - u update (refresh) -z compress (GNU)

cpio Another original backup utility for user data backup. Not as portable as tar. Can process native cpio or tar archives. Be careful with archive type. Uses STDIN/STDOUT for processing Accepts filenames as input from STDIN. Archive is redirected STDOUT Used with find to backup. Basic options: -i --extract, extracts files from STDIN. -o –create, reads the STDIN to obtain a list of path names and copies those files onto the STDOUToutput. -p --pass-through, reads the standard input to obtain a list of path names of files to stdout -A –append, to archive -c read or write header information in ASCII form for portability. -v verbose -d –make-directory -t –list, archive contents -H –format use specifies archive format -F –file=archivename

cpio find. -print | cpio -ocv > /dev/rmt0 Using the find command would list all files and directories and using the cpio command copy those files listed to tape. find. -print | cpio -dumpv /home/users/hope find all files and directories and using the cpio command copy those files to the hope user account. cpio -icuvd < /dev/rmt0 The above command would restore the files back from tape to the current directory. find -depth –print /export/home | cpio --create > /dev/rmt0 creates an archive of the /export/home directory tree on tape cpio --extract < /dev/rmt0 restores all of the files from the archive in /dev/fd0, since no file names were specified. find /export/home –depth -print | cpio --create --file=/vol/archive0 create archive to a specific file cpio --list < /dev/rmt0 Lists all files in the archive.

pax – Portable Archive eXtract New front end for tar, cpio. Developed under BSD. Processes both type of archives – tat, cpio Combines features of both commands Uses STDIN/STDOUT as default file source dest Options -w write archive -r read archive -a append to archive -v list archive - f archive -u refesh archive (ignore older than) -x format types

pax examples pax -w -f /dev/rmt0. Write current directory to tape pax -v -f filename View archive contents (to STDOUT) pax -w. >/dir/archive Write current directory to archive pax -r * </dir/archive Restore archive to current directory find c:/ -mtime 7 | pax -w >a:/archive Archive files modified in the last 7 days (differential backup)

dump / restore Original filesystem backup mechanism Most common UNIX/LINUX backup utility dump –options /dev/dumpdevice /source Common dump options: 0-9 : 0=full, 1-9 incremental dump level f : output file (tape) d : tape density u update /etc/dumpdates file Restore –options /dev/dumpdevice /destination Common restore options: i Interactive restoration of specified files r restore filesystemy t List filenames on the backup archive T extract to this directory C Compare the contents of the archive with the current filesystem x Only the named files are extracted from the archive f Specify the archive file v verbose output dump -0f /dev.rmt0 /home Full dump of home to tape restore -rf /dev.rmt0 –T /home Full dump of homne to tape

Physical backups Bit level backup Used for device level backup Used for OS recovery, recovery media Used for boot device recovery Used for disk device information Plenty of 3 rd party products use for OS level recovery with “bootable backup” in addition to user data backup

dd Bit level backup. Uses STDIN/STDOUT like other utilities Misused, stands for Destoyed Data Caution!! dd - copies until told to stop or end of input or output device Syntax: dd if=inputdevorfile of=outputdevorfile bs=blocksize count=#blocks Basic options: bs=BYTES cbs=BYTES, see ibs, obs conv=KEYWORDS - ascii, ebcdic, ibm, block,unblock, lcase, ucase, sync, noerror count=BLOCKS if=FILE of=FILE seek/skip #BLOCKS of output / input

dd examples dd if=/dev/zero /dev/sda Write binary zeros to disk. Destroy a disk dd if=dev/sda of=/dev/sdb conv=noerror,sync Clone a disk. Target must be exact C/H/S replica. dd if=dev/sda of=/mnt/someremovablemedia/sda.img Backup a disk dd if=/dev/hda2 of=/tmp/hda2.img Backup a partition dd if=/dev/sda of=/tmp/linux.mbr bs=512 count=1 Backup a MBR dd if=/dev/urandom of=jobeval.doc bs=7166 count=1; rm jobeval.doc Securely destroy a file by writing random bits and removing it dd if=/dev/sdc1 count=1 skip=1000 Examine block #1001 on sdc1 dd if=movie.avi of=rescued_movie.avi conv=noerror Repair a damaged.avi file (usually created with lossful compression) someunixcommand | dd ibs=10 skip=1 Skip first 10 bytes from the output of someunixcommand