跳至主要内容

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

mod

apache安装后,如果想再添加模块,往往不想重新安装一次,再者,我在安装中发现,并不是安装文件中所有的modules都会被默认安装,即使在安装中使用了 ./configure --prefix=/usr/local/apache --enable-so --enable-modules=all --enable-mods-shared=all也是如此。我使用上述方法安装的apache2.2.6就没有安装proxy相关模块。这时,需要手工生成so文件,但会自动的被复制到你的apache安装目录的modules中,然后修改apache的配置文件,加载相关模块,验证apache配置并重启服务即可。以上描述的具体操作步骤如下: 操作系统:linux redhat 4.5 ES apache版本:2.2.6 可自行下载tar包 1. 拷贝安装包到/usr/local,并在目标目录下进行解压。[root@localhost local]# cd /usr/local[root@localhost local]# tar -zxvf httpd-2.2.4.tar.gz2. 配置安装参数,安装的目标目录为/usr/local/apache,建议设置enable-mods-shared=all,不用的module注释掉就行了![root@localhost local]# cd httpd-2.2.4[root@localhost httpd-2.2.4]# ./configure --prefix=/usr/local/apache --enable-so --enable-mods-shared=all3. 编译并安装。[root@localhost httpd-2.2.4]# make[root@localhost httpd-2.2.4]# make install4. 启动Apache,并测试。[root@localhost httpd-2.2.4]# cd /usr/local/apache/bin[root@localhost bin]# ./apachectl start 打开浏览器,并在地址栏中输入主机的IP地址如 http://192.168.1.254/ 如果出现以下画面则说明安装成功。It works! 注意:安装完成后检查系统服务中的HTTPD服务是否已