免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: chalylau
打印 上一主题 下一主题

[新手入门] 利用chfs命令实现对jfs文件系统多阶段snapshot功能及snapshot命令使用实例 [复制链接]

论坛徽章:
0
21 [报告]
发表于 2008-07-18 13:58 |只看该作者
原帖由 beginner-bj 于 2008-7-17 23:04 发表
有个命令,本身就叫snapshot,楼主有空可以研究下。
我等结果啦,呵呵


#man snapshot
之后发现里面只介绍怎么新建snapshot,怎么查询,怎么删除,但没有介绍怎么使用snapshot后新建的lv。

~~~~~~~~~~~~~
给/testfs做snapshot
~~~~~~~~~~~~~
# lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
lvtest                      jfs2       1     1     1       open/syncd    /testfs
# cd /testfs
# ls -l
total 16
drwxr-xr-x  30 root     system         8192 Jul 18 13:03 etc
drwxr-xr-x   2 root     system          256 Jul 18 13:02 lost+found
~~~~~~~~~~~~~~~
创建snapshot使用方式一
~~~~~~~~~~~~~~~
# snapshot -o snapfrom=/testfs -o size=100M
Snapshot for file system /testfs created on /dev/fslv01
# lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
lvtest                  jfs2        1       1       1    open/syncd    /testfs
fslv01                 jfs2         1       1       1    open/syncd    N/A
~~~~~~~~~~~
查询snapshot信息
~~~~~~~~~~~
# snapshot -q /testfs
Snapshots for /testfs
Current  Location        512-blocks  Free        Time
*        /dev/fslv01     262144      261376      Fri Jul 18 13:04:47 BEIST 2008
~~~~~~~~~
挂载snapshot
~~~~~~~~~
# mkdir /snapshot               
# mount -o snapshot /dev/fslv01 /snapshot
# cd snapshot
# ls -l
total 16
drwxr-xr-x  30 root     system         8192 Jul 18 13:03 etc
drwxr-xr-x   2 root     system          256 Jul 18 13:02 lost+found

~~~~~~~~~~~~~~~~~~~
创建第二个snapshot,使用方式二
~~~~~~~~~~~~~~~~~~~
在/testfs里增加test1和test2
# ls -l /testfs
total 32
drwxr-xr-x  30 root     system         8192 Jul 18 13:03 etc
drwxr-xr-x   2 root     system          256 Jul 18 13:02 lost+found
-rw-r--r--   1 root     system            5 Jul 18 13:28 test1
-rw-r--r--   1 root     system            7 Jul 18 13:29 test2

新建jfs2的lv取名fslv02

# snapshot -o snapfrom=/testfs /dev/fslv02
Snapshot for file system /testfs created on /dev/fslv02

# lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
lvtest              jfs2       1     1     1    open/syncd    /testfs
fslv01              jfs2       1     1     1    open/syncd    N/A
fslv02              jfs2       1     1     1    open/syncd    N/A

~~~~~~~~~~~
查询snapshot信息
~~~~~~~~~~~
# snapshot -q /testfs
Snapshots for /testfs
Current  Location        512-blocks  Free        Time
         /dev/fslv01     262144      261376      Fri Jul 18 13:04:47 BEIST 2008
*        /dev/fslv02     262144      261376      Fri Jul 18 13:30:39 BEIST 2008
~~~~~~~~~~~~
挂载第二个snapshot
~~~~~~~~~~~~
# mkdir /snapshot2
# mount -o snapshot /dev/fslv02 /snapshot2
# cd /snapshot2
# ls -l
total 32
drwxr-xr-x  30 root     system         8192 Jul 18 13:03 etc
drwxr-xr-x   2 root     system          256 Jul 18 13:02 lost+found
-rw-r--r--   1 root     system            5 Jul 18 13:28 test1
-rw-r--r--   1 root     system            7 Jul 18 13:29 test2

~~~~~~~~~~~~
删除第一个sanpshot
~~~~~~~~~~~~
# umount /snapshot
# snapshot -d /dev/fslv01
rmlv: Logical volume fslv01 is removed.
# snapshot -q /testfs
Snapshots for /testfs
Current  Location        512-blocks  Free        Time
    *     /dev/fslv02     262144      261376      Fri Jul 18 13:30:39 BEIST 2008

。。。。。。

论坛徽章:
0
22 [报告]
发表于 2008-07-18 15:01 |只看该作者
照你的方法做到
#mount -o snapshot  /dev/fslv00 /snapshot
mount: 0506-326 snapshot is not a valid flag.
mount: 0506-322 Cannot determine log device to use for /dev/fslv00 (/snapshot).什么原因

论坛徽章:
0
23 [报告]
发表于 2008-07-18 15:21 |只看该作者
原帖由 wangpeng1688 于 2008-7-18 15:01 发表
照你的方法做到
#mount -o snapshot  /dev/fslv00 /snapshot
mount: 0506-326 snapshot is not a valid flag.
mount: 0506-322 Cannot determine log device to use for /dev/fslv00 (/snapshot).什么原因



lsvg -l rootvg 里fslv00的状态正常吗?

还有就是你的操作系统版本是多少?

[ 本帖最后由 chalylau 于 2008-7-18 15:29 编辑 ]

论坛徽章:
0
24 [报告]
发表于 2008-07-18 15:44 |只看该作者
# lsvg -l testvg
testvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
wplv                jfs2       10    10    1    open/syncd    /wp
loglv00             jfs2log    1     1     1    open/syncd    N/A
fslv00              jfs2       1     1     1    open/syncd    N/A
# oslevel -r
5200-05

论坛徽章:
0
25 [报告]
发表于 2008-07-18 16:11 |只看该作者
原帖由 wangpeng1688 于 2008-7-18 15:44 发表
# lsvg -l testvg
testvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
wplv                jfs2       10    10    1    open/syncd    /wp
loglv00             jfs2lo ...


是不是和loglv00有关

[ 本帖最后由 chalylau 于 2008-7-18 16:15 编辑 ]

论坛徽章:
0
26 [报告]
发表于 2008-07-18 16:17 |只看该作者
或者把整个操作过程帖一下

论坛徽章:
0
27 [报告]
发表于 2008-07-18 16:29 |只看该作者
就照着你的步骤做的

论坛徽章:
0
28 [报告]
发表于 2008-07-18 17:10 |只看该作者
原帖由 wangpeng1688 于 2008-7-18 16:29 发表
就照着你的步骤做的

我是5.3的,你man mount 看看-o 选项里有没有snapshot

招聘 : 系统集成
论坛徽章:
0
29 [报告]
发表于 2008-08-29 00:53 |只看该作者
原帖由 wangpeng1688 于 2008-7-18 15:01 发表
照你的方法做到
#mount -o snapshot  /dev/fslv00 /snapshot
mount: 0506-326 snapshot is not a valid flag.
mount: 0506-322 Cannot determine log device to use for /dev/fslv00 (/snapshot).什么原因






#mount -v jfs2 -o snapshot  /dev/fslv00 /snapshot
snapshot只能够用于jfs2

论坛徽章:
0
30 [报告]
发表于 2010-10-24 16:04 |只看该作者
楼主只做了一半,后面的动作才是主要的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP