Use fssnap to create a file system-based Snapshot

Source: Internet
Author: User
Article Title: Use fssnap to create a file system-based snapshot. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The ufsdump command is mainly used for system backup. However, it is helpless to execute the command in single-user mode every time. A new command fssnap can actually solve this problem.
This command is released in solaris 1/01. the read-only snapshot that can be used to create a file system is different from that of ufsdump. This command does not need to be run in single-user mode. It can be executed in multi-user mode and when the file system is mounted.
  
# Df-k
Filesystem kbytes used avail capacity Mounted on
/Dev/dsk/c0t0d0s0 1984230 66332 1858372/
/Dev/dsk/c0t0d0s3 1984230 776737 1147967/usr
/Proc 0 0 0%/proc
Fd 0 0 0 0%/dev/fd
Mnttab 0 0 0%/etc/mnttab
/Dev/dsk/c0t0d0s4 4211158 77135 4091912/var
Swap 563936 16 563920 1%/var/run
Swap 564248 328 563920 1%/tmp
  
Now take a snapshot of/partition first. The snapshot file is stored in the/var directory and is named root. snap.
#/Usr/sbin/fssnap-F ufs-o bs =/var/root. snap/
/Dev/fssnap/1
When you execute this command, it will create a virtual device file for Snapshot
  
The Snapshot created for the/usr partition is also stored in the/var directory named usr. snap.
#/Usr/sbin/fssnap-F ufs-o bs =/var/usr. snap/usr
/Dev/fssnap/0
  
Query Information about a file system snapshot.
# Fssnap-I
0/usr
1/
Query snapshot details
# Fssnap-I/
Snapshot number: 1
Block Device:/dev/fssnap/1
Raw Device:/dev/rfssnap/1
Mount point :/
Device state: idle
Backing store path:/var/root. snap
Backing stores size: 384 KB
Maximum backing store size: Unlimited
Snapshot create time: Thu May 13 15:11:59 2004
Copy-on-write granularity: 32 KB
  
Delete A Virtual Device
# Fssnap-d/
Deleted snapshot 1.
However, the corresponding snapshot file will not be deleted. If you want to delete the snapshot file while deleting the snapshot device, you must
  
Specify the unlink parameter when the image is taken
# Fssnap-F ufs-o bs =/var/usr. snap, unlink/usr
  
How to back up and restore snapshots
This is done using the ufsdump and ufsrestore commands (in this example, it is not stored on tape)
# Ufsdump 0ucf/var/usr_snap.dmp 'fssnap-F ufs-o bs =/var/usr. snap, unlink/usr'
DUMP: Writing 63 Kilobyte records
DUMP: Date of this level 0 dump: Thu May 13 15:56:50 2004
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping/dev/rfssnap/1 to/var/usr_snap.dmp.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Estimated 1608764 blocks (785.53 MB ).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: 1608640 blocks (785.47 MB) on 1 volume at 2819 KB/sec
DUMP: DUMP IS DONE
DUMP: Level 0 dump on Thu May 13 15:56:50 2004
  
In this way, the backup of the file system snapshot is created, and the ufsrestore command is used for recovery.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.