Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 操作系统 > 其他操作系统 > File system snapshots in 10 steps
【标  题】:File system snapshots in 10 steps
【关键字】:File,system,snapshots,in,10,steps
【来  源】:http://www.cublog.cn/u/5370/showart.php?id=152722

File system snapshots in 10 steps

Your Ad Here

Snapshots are useful because they can be applied on active file systems. You do not need to have the system in single user mode, nor do you need to unmount the file system you want to backup, as apposed to traditional backups with the standard ufsdump utility.

In the example below, we backup the root file system.

  1. Create the backing store directory on a partition which has preferably at least the same amount of free space as the entire partition size you want to backup. E.g. if your root file system is 500 MB, you will need 500 MB of free space somewhere, no matter how much of that diskspace is actually being used for root file system data. The backing store may also be a raw device. Read the man pages if you want to take risks with sizes.

  2. Create the file system snapshot using the fssnap command:

    # fssnap -F ufs -o bs=/somewhere_spacy /
    

    This creates 3 files:

    • A big file in the /somewhere_spacy directory. While our actual root file system data are "frozen" so it is safe to make the backup, any changes that happen while the file system is in this frozen state will be written to the backing store file.
    • A raw snapshot device /dev/rfssnap/0 or the first free number if you already have active snapshot devices.
    • A block snapshot device /dev/fssnap/0 or first free number. These devices are images of the actual device that you want to backup.
  3. Use the fssnap from /usr/lib/fs/ufs/ with the -i option to get more information about the snapshot; you may want to add this to some kind of log file.

  4. Create a mount point for your snapshot device. Mount it and check that everything is OK:

    # mkdir /fssnap
    # mount -F ufs -o ro /dev/fssnap/0 /fssnap
    # ls /fssnap
    --output ommitted--
    
  5. Backing up the snapshot using tar is also done using the mounted block device:

    # cd /fssnap
    # tar cvf /dev/rmt/0 .
    --output ommitted--
    
  6. Of course you can also use ufsdump, on the raw device in that case:

    # ufsdump 0uf /dev/rmt/0 /dev/rfssnap/0
    --output ommitted--
    
  7. Test your backup:

    # tar tvf /dev/rmt/0
    --output ommitted--
    

    for tar, or like this if you used ufsdump:

    # ufsrestore tf /dev/rmt/0
    --output ommitted--
    
  8. When you are done making the backup of your snapshot, deactivate it as soon as possible. First unmount the device if you mounted it.

  9. Delete the snapshot:

    # fssnap -d /
    

    This will deactivate the freeze of your file system. All changes that were temporarily kept in the backin store file, are now written to the actual file system, which then resumes normal behavior.

  10. Remove the backing store file.

When using ufsdump, you can make incremental backups of snapshots just like you would do in a normal situation. Deactivate the snapshots after every level of backup.

UNIX 系统常用管理命令:【上一篇】
The /etc/nodename File(From SUN 399):【下一篇】
【相关文章】
  • 让Solaris默认不启动X window
  • solaris10版本
  • 第3章 简单的 port -- 3.1 编写 Makefile
  • 第3章 简单的 port -- 3.5 用 portlint 来检查 port
  • 第4章 复杂的 Porting
  • 理解GNU/Linux
  • Qmail 1.03+Courier+vpopmail+mysql+qmailadmin+webma
  • 什么是 Linux 的精神
  • Linux 手动创建RAID和LVM分区
  • linux指南
  • 【随机文章】
  • WiMax-新兴无线通信技术简介
  • Linux 网管 123 --- 第10章. 升级 Linux 及其他应用软体 -2.不使
  • 新鲜不复杂,电力线上网实现指南(图)
  • RM、RMVB视频文件减肥指南
  • 电信与网通IP分布(实用)
  • 弹出窗口杀手(下)
  • CACTI 流量監控工具
  • 升级
  • 莲花软件将支持Web服务和J2EE模块
  • reiserfs文件系统的修复
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.