免费注册 查看新帖 |

Chinaunix

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

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

论坛徽章:
0
21 [报告]
发表于 2006-05-09 08:33 |只看该作者
光纤-〉光纤一点问题都没

论坛徽章:
0
22 [报告]
发表于 2006-08-08 22:47 |只看该作者
顶一下!哪位老兄能不能详细说一下/dev/rdsk和/dev/dsk的不同?谢谢先!

论坛徽章:
0
23 [报告]
发表于 2006-08-08 22:50 |只看该作者
顶一下!

[ 本帖最后由 gnim 于 2006-8-8 22:52 编辑 ]

论坛徽章:
0
24 [报告]
发表于 2006-08-09 10:28 |只看该作者
1.  jumpstart + flash archive

It is a good solution to do system backup and restore.

Note, the opposite restore procedure is the flash installation procedure in fact, you should backup some configuration files, such as /etc/hosts etc.

2. ufsdump + ufsrestore

Another solution is: boot machine into single user mod from jumpstart boot server -> enable network + nfs -> mount nfs resource on /mnt -> ufsdump localdisk slices to /mnt  -> yes, backup procedure finished.

the opposite procedure is ufsrestore

I think the second solution is also a good solution to do system backup and restore.

Tip, you can modify boot image to implement automatic ufsdump in jumpstart boot server.

论坛徽章:
0
25 [报告]
发表于 2006-08-09 15:36 |只看该作者
我也来分享一个备份的脚本.
#!/sbin/sh
#
# Documentation at end of script
#
#
# Edit these values for your drive
#
####### EDIT THESE VALUES #######
SOURCE_DISK='c0t0d0'
DEST_DISK='c0t1d0'
DATA_SLICES='s0 s3'
SWAP_SLICES='s1'
####### EDIT THESE VALUES #######


for slice in $SWAP_SLICES; do
        echo newfs on ${DEST_DISK}${slice}
        /usr/sbin/newfs ${DEST_DISK}${slice}
done

for slice in $DATA_SLICES; do
        echo newfs on ${DEST_DISK}${slice}
        /usr/sbin/newfs ${DEST_DISK}${slice}
done

for slice in $DATA_SLICES; do
        echo copying ${SOURCE_DISK}${slice} ${DEST_DISK}${slice}

        /usr/sbin/mount /dev/dsk/${DEST_DISK}${slice} /mnt
        mount
        /usr/sbin/ufsdump 0f - /dev/rdsk/${SOURCE_DISK}${slice} \ | (cd /mnt;/usr/sbin/ufsrestore xf -)
        /usr/sbin/umount /mnt
done

for slice in $DATA_SLICES; do
        echo installboot on ${DEST_DISK}${slice}
        /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/${DEST_DISK}${slice}
done


exit


############################################################################
# Example partition table:
# Total disk cylinders available: 39533 + 2 (reserved cylinders)
#
# Part      Tag    Flag     Cylinders         Size            Blocks
#   0       root    wm       0 - 10158        4.88GB    (10159/0/0) 10240272
#   1       swap    wu   10159 - 10679      256.43MB    (521/0/0)     525168
#   2     backup    wm       0 - 39532       19.00GB    (39533/0/0) 39849264
#   3 unassigned    wm   10680 - 39532       13.87GB    (28853/0/0) 29083824
#   4 unassigned    wm       0                0         (0/0/0)            0
#   5 unassigned    wm       0                0         (0/0/0)            0
#   6 unassigned    wm       0                0         (0/0/0)            0
#   7 unassigned    wm       0                0         (0/0/0)            0
############################################################################
#  
#  There are four steps to this process.
#  
#   1)  View the source drive to get slice information.
#   2)  Format the destination drive with similar slices.
#   3)  Edit this script between the lines that say:
#           ####### EDIT THESE VALUES #######
#   4)  Run this script.
#  
#  
#
#  Step 1.
#
#  Run 'format' and select the source disk.
#  
#  You should see something like this:
#  
#     # format
#     Searching for disks...done
#     
#     
#     AVAILABLE DISK SELECTIONS:
#            0. c0t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>  gateway
#               /pci@1f,4000/scsi@3/sd@0,0
#            1. c0t1d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
#               /pci@1f,4000/scsi@3/sd@1,0
#     Specify disk (enter its number):
#  
#  
#  For example, disk 0 could be the SOURCE disk and disk1 could be the DESTINATION disk.
#
#  Select 'partition' and then 'print' to get the information above.
#
#
#  Step 2.
#
#  While still in the 'format' utility select the destination disk.
#  Select 'partition' and 'print' to get the slice information for it.
#  
#  If you do not see the destination drive then you must exit format
#  and run some disk utilities to make it visible.  
#  
#  To add the destination drive, run:
#      drvconfig
#      devlinks
#      disks
#  
#  Run 'format' again to see if the new disk is 'AVAILABLE'.
#
#  Select 'partition' and then 'change' each partition to get similar slices.
#  
#  DO NOT CHANGE SLICE 2.
#  
#  The flags for data slices will be 'wm' and for the swap slice will be 'wu'.
#  Allow 2.5 to 5 GB for the root partition, 256 to 512 MB for the swap slice
#  and the rest for the export slice.
#  
#  DO NOT CHANGE SLICE 2.
#  
#
#  Step 3.
#
#  You must edit the script and enter the correct values:
#
#  DO NOT COPY SLICE 2.
#  
#     SOURCE_DISK='c0t0d0'
#     DEST_DISK='c0t1d0'
#     DATA_SLICES='s0 s3'
#     SWAP_SLICES='s1'
#  
#  If you get SOURCE_DISK and DEST_DISK reversed you will overwrite the wrong disk.
#          BE CAREFULL!!!
#  
#  In the example above there are four slices with non-zero cylinder numbers: 0,1,2,3.
#
#  COPY  NAME       Function
#  ====  =======    ====================================================================
#  yes   Slice 0 is the 'root' partition - copy it.
#  yes   Slice 1 is the 'swap' partition - only make the new file system.
#  NO    Slice 2 is the 'backup' partition - this represents the whole drive - DO NOTHING WITH THIS SLICE.
#  yes   Slice 3 is the 'export' partition - copy it.
#  
#  The script has two slice lists; one for the swap slice and one for data slices.
#  The slices you put in the SWAP_SLICES will get 'newfs' (usually only slice 1).
#  The slices you put in the DATA_SLICES will get 'newfs' and a 'ufs pipe copy'.
#  
#  DO NOT COPY SLICE 2.
#  
#  Step 4.
#  
#  Run this script.  Answer 'yes' when it runs the 'newfs' command.

论坛徽章:
0
26 [报告]
发表于 2006-08-15 14:07 |只看该作者
不错的帖子

论坛徽章:
0
27 [报告]
发表于 2006-08-15 16:26 |只看该作者
机器少还可以,机器多了还是比较麻烦。我喜欢做Jumpstart。boot net - install R L P这个命把Path,充许root登陆,root-profile全部装好。最多的一次,我一个人一天装了二十多台机器的OS。笔记本累死掉了。还好,没挂。

论坛徽章:
0
28 [报告]
发表于 2006-09-10 17:03 |只看该作者
原帖由 gnim 于 2006-8-8 22:47 发表
顶一下!哪位老兄能不能详细说一下/dev/rdsk和/dev/dsk的不同?谢谢先!



一个是原始设备接口,一个是块设备。。
具体的,我也没理解。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP