Monday, July 13, 2009

Backup up a Mounted FS with a UFS Snapshot

Backup up a Mounted FS with a UFS Snapshot

/usr/sbin/fssnap –F FsType –V –o special-options(s) mount-point | special

Options for the fssnap command

-d Deletes the snapshots associated with the given FS. If –o unlink option was used
when you built the snapshot, the backing store file is deleted together otherwise it has
to be deleted manually
-F FsType Specifies the FS type to be used
-i Displays the state of an FSType snapshot
-v Echos the complete command line, but does not execute the command
-o Enables you to use special options. Such as the location & size of bs file

# fssnap –F ufs –o bs=backing_store_path /file_system
# fssnap –F ufs –o bs=/var/tmp /export/home
/dev/fssnap/0

backing store file -- The snapshot subsystem saves FS data in this file. The fssnap command creates the backing-store file and two read-only virtual devices. The block virtual device, /dev/fssnap/0, can be mounted as a read-only FS. The raw virtual device, /dev/rfssnap/0.

You can limit the size of the backing-store file by using the –o maxsize=n option.
If the backing-store file runs out of disk space, the system automatically deleted the ufs snapshot.

# fssnap –F ufs –o bs=/var/tmp,maxsize=500m /export/home
# fssnap –I -- Displays a list of all the current UFS snapshots on the system
0 /export/home
1 /usr
2 /database

# /usr/lib/fs/ufs/fssnap –I /export/home -- Shows the details for the /export/home snapshot

Performing a backup of a UFS Snapshot

# mkdir –p /backups/home.bkp -- Creating an empty directory
# mount –F ufs –o ro /dev/fssnap/0 /backups/home.bkp -- Mounting the block virtual device
# cd /backups/home.bkp
# tar cvf /dev/rmt/0
(or)
# ufsdump 0uf /dev/rmt/0 /dev/rfssnap/0
# ufsrestore tf /dev/rmt/0 -- To verify



Performing an Incremental Backup of a UFS Snapshot

Use ufsdump with the N option to create an incremental UFS snapshot. Which writes the name of the device being backed up, rather than the name of the snapshot device to the /etc/dumpdates file

# ufsdump 1ufN /dev/rmt/0 /dev/rdsk/c1t0d0s0 /dev/rfssnap/0
# ufsrestore tf /dev/rmt/0 -- To verify

# fssnap –d /extra(Source FS) -- To remove a snapshot
# rm /var/tmp/snapshot0

Restoring Data from a UFS Snapshot Backup

The backup created from a virtual device is a backup of the original FS when the UFS snapshot was taken. You can restore a UFS snapshot from a backup tape in the same manner as you would the backup of an original FS

# cd /usr
# ufsrestore if /dev/rmt/0
ufsrestore> add demo
ufsrestore> extract
ufsrestore> quit

Deleting a UFS Snapshot

# umount /dev/fssnap/0
# fssnap 0d /export/home
# rm /backing_store_file

No comments:

Custom Search

Feeds from my other blog

Samsung S2 Brand new for 25900 White piece sealed box

For Sale, Mobile Phones - Accessories in India, Andhra Pradesh, Hyderabad. Date September 17

For Sale in Hyderabad