免费注册 查看新帖 |

Chinaunix

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

[原创]ufsdump and ufsrestore 的新用法! [复制链接]

论坛徽章:
0
11 [报告]
发表于 2005-12-08 15:49 |只看该作者

回复 1楼 innashi 的帖子

用lu 命令不是更简单吗?

论坛徽章:
0
12 [报告]
发表于 2005-12-09 12:42 |只看该作者
原帖由 fg008 于 2005-12-1 06:59 发表
c0t0d0s0应该是c0t1d0s0吧~



我也在想这个问题,期待回贴

论坛徽章:
0
13 [报告]
发表于 2005-12-23 08:17 |只看该作者
谢谢!!

论坛徽章:
0
14 [报告]
发表于 2005-12-23 11:03 |只看该作者
这也能精华  确实没有什么水准

论坛徽章:
0
15 [报告]
发表于 2005-12-23 14:26 |只看该作者
还不如直接用cpio做,其实是一样的

论坛徽章:
0
16 [报告]
发表于 2005-12-29 17:13 |只看该作者
机器多的时候都是这么做的啊,这样免得一台一台打patch,安装应用软件。

类似pc上的ghost安装系统.

论坛徽章:
0
17 [报告]
发表于 2005-12-29 20:44 |只看该作者
不会吧,干嘛不用FLASH?

论坛徽章:
0
18 [报告]
发表于 2006-01-01 22:02 |只看该作者
原帖由 lem0 于 2005-12-8 15:43 发表
光纤硬盘要用这个
#cd  /dev/dsk
#ls -al
#luxadm -v set_boot_dev /devices/pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w500000e010a7ee61,0:a



请问这样真的可以吗?  谢谢

记下了,回去一定要试试,现在的盘啊,说坏就坏,如果能恢复就不怕了,

论坛徽章:
0
19 [报告]
发表于 2006-05-08 17:27 |只看该作者
当然了,这个可是在生产环境里做的啊。

论坛徽章:
0
20 [报告]
发表于 2006-05-09 01:06 |只看该作者

We did as good as the others

http://www.samag.com/documents/s=1148/sam0107j/0107j.htm

#!/bin/sh
# Original Script written by Constantin Ionescu
# Modified by Carlo Cosolo
# Modified by Peter Baer Galvin
# Modified by John West
# Use and distribute freely

# Define variables for use in the script
# ! Important, these must be set correctly !

# The root disk to duplicate (leave off slice numbers and path)
SRC=c0t0d0

# The empty disk to duplicate it to (leave off slice numbers and path)
DEST=c0t1d0

# The directory to mount destination partitions on while duplicating
MOUNTDIR=/dup_0

# The file name of this script, to rename it on the destination to avoid execution
SCRIPT=/opt/local/etc/rootcopy

# The slices that should be copied
SLICES="s0 s3 s4 s6 s7"

echo ====================================
echo Disk Copy script started `date`
echo

# Make sure the mount point for duplicate partitions exists
if [ ! -d $MOUNTDIR ]; then
  mkdir $MOUNTDIR
  chmod 700 $MOUNTDIR
fi

# Partition the duplicate disk, make filesystems, make it bootable
prtvtoc /dev/rdsk/${SRC}s2 > /tmp/vtoc
fmthard -s /tmp/vtoc /dev/rdsk/${DEST}s2
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/${DEST}s0

# Modify the following loop to handle any special cases
for fs in $SLICES
do
  newfs /dev/dsk/${DEST}${fs} < /dev/null; mount /dev/dsk/${DEST}${fs} ${MOUNTDIR};
  ufsdump 0f - /dev/dsk/${SRC}${fs}|(cd ${MOUNTDIR}; ufsrestore rf -);
  if [ $fs = "s0" ]; then
    sed 's/${SRC}/${DEST}/g' /etc/vfstab > ${MOUNTDIR}/etc/vfstab;
    mv ${MOUNTDIR}/${SCRIPT} ${MOUNTDIR}/${SCRIPT}.DONTRUN;
  fi
  umount ${MOUNTDIR}
done

echo
echo Disk Copy script ended `date`
echo ====================================
echo
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP