跳至主要内容

fssnap & ufsdump

昨天下班前在捣鼓关于如何使用更好的zone更快捷和方面,从目前已知的角度而言在
zoneadm -z test_zone export > test_zone.conf后会到出已经设置好的zone文件,那我们现在将这个文件导出之后,进行修改。

root@cnnjx026 # more cnnjx026z011.conf 
create -b
set zonepath=/local/zones/cnnjx026z011
set autoboot=true
set ip-type=shared
add fs
set dir=/app
set special=/app
set type=lofs
add options rw
add options nodevices
end
add fs
set dir=/env
set special=/env
set type=lofs
add options rw
add options nodevices
end
add fs
set dir=/var/home
set special=/var/home
set type=lofs
add options rw
add options nodevices
end
add net
set address=147.128.38.11/24
set physical=nxge0
set defrouter=147.128.38.1
end
add rctl
set name=zone.max-swap
add value (priv=privileged,limit=2147483648,action=deny)
end
add attr
set name=machine
set type=string
set value=sun4v
end
add dedicated-cpu
set ncpus=1
end
add capped-memory
set physical=2G
end

按照这个设置,只需要稍微改下里面的系统文件在run一下zonecfg -z 123 -f cnnjx026z011.conf 就能产生一个新的zone,然后就能换能up and running了。免去了大量配置的麻烦。

捣鼓完批量安装后,是捣鼓备份。 最近有位同事被开了,主要还是备份的原因,做IT还是得好好备份天天向上啊。
用fssnap创建snapshot的时候出现错误

# fssnap -F ufs -o bs=/snaps/usr.back.file /usr  snapshot error: Invalid backing file path
根据sun网站上的说法是因为使用了大分区,而不是对各个文件实现单独的文件系统分区,所以单独的创建snapshot备份是不行了。 那就只能用ufsdump来备份了


ufsdump相对来说比较便利,但是需要我去手动停掉需要备份的空间,会有些不利。之后用ufsresore.

bash-3.00# ufsdump 0f /var/zone.ufsdump /opt/zone/zone
  DUMP: Date of this level 0 dump: Wed Dec 23 11:27:20 2009
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c1t0d0s0 (ecnshpcnserv:/) to /var/zone.ufsdump.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Writing 32 Kilobyte records
  DUMP: Estimated 6469068 blocks (3158.72MB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: 6422974 blocks (3136.22MB) on 1 volume at 9635 KB/sec
  DUMP: DUMP IS DONE

但是在ufsrestore的情况下就出现了点问题,主要是交互式的比较麻烦
bash-3.00# ufsrestore -xf /var/zone.ufsdump /opt/zone/zone
Warning: ./opt: File exists
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1

set owner/mode for '.'? [yn] set owner/mode for '.'? [yn] y
Directories already exist, set modes anyway? [yn] y

首先是不能恢复到原目录,只能恢复到另外的目录,还需要在研究下

--
Alex Tu
-----------------------------------------------------------
ShangHai,China

评论

此博客中的热门博文

4 steps to delete account in Gerrit DB

4 steps to delete account in DB. Delete from accounts where preferred_email=’’; delete from account_ssh_keys where account_id=''; delete from account_external_ids where external_id='gerrit:*’; delete from account_external_ids where external_id='username:*’; whatever it was in H2 database and postgres db . H2: ssh -p 24198 localhost gerrit gsql Postgres: psql

Python学习笔记20100117

映射list   Dictionary 是用{}. list 是一那个[]. turple是用() 当你定义过dictionary后,你可以使用d.keys(), d.values(),d.items()将定义后的时候分别显示出来 当然可以将list里的值加减乘除,也可以如一般的定义直接重新复制这个list. 链接与分割字符串的 li=";", join(li) 则显示的就是 分隔符为;的数 如果使用li=li.split(";")则将刚刚;的分隔符删除,而split里也可定义域,如li.split(";",1)   自省 <---这是啥 之前在使用的时候发觉有些书本上的模块不能调用,很多是py脚本定义过的函数。 下载该脚本s,然后上传至指定位置。 >>>import sys >>>sys.path >>>sys.path.append("绝对位置")然后就能调用这些脚本和参数了。 删除 >>>sys.path.pop() 定义一个参数是 def info(test, test1=10.test2=12): info是函数名,test是必备参数,因为没有定义值,test1和test2是可选参数,定义了初始值   以上是外部函数的调用,下面转到内部函数 内部函数有type,str,dir及其他   ---type 返回任意字符的类型,模块也可以。types模块 >>> type(1) <type 'int'> >>> li=[] >>> type(li) <type 'list'> >>> import odbchelper >>> type(odbchelper) <type 'module'> >>> type(sys) <type 'module'> >>> import types ...