Variados

Páginas: 7 (1631 palabras) Publicado: 7 de febrero de 2013
WORKING WITH

SOLARIS ZFS SNAPSHOTS
TM

> Solaris™ 10 How To Guides

Dominic Kay, Solaris Marketing Version 1.1 | Last updated: 09/09/09

About This Solaris™ How To Guide
This guide is intended to show a new user the capabilities of the Solaris ZFS snapshots feature. It describes the steps necessary to set up a ZFS filesystem and the use of snapshots including how to create them, usethem for backup and restore purposes, and how to migrate them between systems. After reading this guide, the user will have a basic understanding of how snapshots can be integrated into system administration procedures.
Contributors: Reviewed by Paul Eggleton & Cindy Swearingen

Contents
ZFS Snapshots: Overview Setting up the File System Taking a Snapshot Rolling Back a Snapshot CopyingIndividual Files From a Snapshot Storing a Snapshot on Your System Sending a Snapshot to Another System For More Information Page 1 Page 1 Page 1 Page 2 Page 3 Page 3 Page 3 Page 5

1
Solaris 10 Operating System sun.com/solaris

Solaris ZFS Snapshots How To Guide
ZFS Snapshots: Overview
A zfs snapshot is a read-only copy of a Solaris™ ZFS file system or volume. Snapshots can be created almostinstantly and initially consume no additional disk space within the pool. They are a valuable tool both for system administrators needing to perform backups and other users who need to save the state of their file system at a particular point in time and possibly recreate it later on the same machine or some other. It is also possible to extract individual files from a snapshot. These tasks can beperformed with ZFS without the need for any additional software. In this short guide, we take a look at the simple command syntax necessary to achieve these tasks.

Setting up the File System
1. First, we create a pool (which we call pool ) and display it: # zpool create -f pool c0d0s5 # zpool list NAME pool 2. SIZE 3.11G USED 75K AVAIL 3.11G CAP 0% HEALTH ONLINE ALTROOT -

Then we create afile system (called file system) in our pool and confirm that we have done so: # zfs create pool/filesystem # zfs list NAME pool pool/filesystem USED 97.5K 18K AVAIL 3.06G 3.06G REFER 18K 18K MOUNTPOINT /pool /pool/filesystem

3.

Now to illustrate our example we fill the file system with some data: # cd /platform # du -h -s . 261M . # find . -print | cpio -pd /pool/filesystem 536032 blocks # zfslist NAME pool pool/filesystem USED 206M 206M AVAIL 2.86G 2.86G REFER 19K 206M MOUNTPOINT /pool /pool/filesystem

We are now ready to start working with snapshots.

Taking a Snapshot
1. Snapshots are named with the syntax pool/fs@something, where something can be a fairly arbitary name, but ideally one that means something to the creator. # zfs snapshot pool/filesystem@thursday

2Solaris 10 Operating System sun.com/solaris

2.

The snapshot is then visible using zfs list: # zfs list NAME pool pool/filesystem pool/filesystem@thursday USED 262M 262M 0 AVAIL 2.81G 2.81G REFER 19K 262M 262M MOUNTPOINT /pool /pool/filesystem -

3.

However, the snapshot does not appear as a file system using df: # df -h Filesystem pool pool/filesystem SIZE 3.1G 3.1G USED 19K 262M AVAIL 2.8G2.8G CAP 1% 9% MOUNTED ON /pool /pool/filesystem

The reason it is hidden from normal Solaris utilities such as ls, tar, cpio, and others is to prevent the snapshot from appearing in backups.

Rolling Back a Snapshot
1. Our snapshot can now be used as a recovery mechanism. First, we “accidentally” delete all the files in our file system: # cd /pool/filesystem # ls i86hvm # ls # df -h/pool/filesystem Filesystem pool/filesystem SIZE 3.1G USED 18K AVAIL 2.8G CAP 1% MOUNTED ON /pool/filesystem i86pc i86xpv # rm -rf *

We see that the files have been removed and the size of the data reported for our file system has decreased appropriately. 2. Rolling back the snapshot to restore all our missing files is trivial: # zfs list NAME pool pool/filesystem pool/filesystem@thursday # cd...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Variado
  • Varios
  • Varios
  • Varios
  • Variados
  • Varios
  • Varios
  • Varios

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS