SA Blog --系统管理员的博客生涯

书写自己的系统管理博客生涯
posts(330) comments(254) trackbacks(0)
  • IT博客
  • 联系
  • RSS 2.0 Feed 聚合
  • 管理

常用链接

  • 我的随笔
  • 我的评论
  • 我参与的随笔

留言簿

  • 给我留言
  • 查看公开留言
  • 查看私人留言

随笔分类(395)

  • *UNIX系统(148)
  • Cloud(3)
  • Moive
  • Music(1)
  • OpenStack(7)
  • openstack
  • Wiki(1)
  • Windows系统(32)
  • 其他(33)
  • 娱乐
  • 存储相关(22)
  • 存储网络(10)
  • 常用工具下载(25)
  • 数据库应用技术(53)
  • 网络技术(41)
  • 英语
  • 虚拟化(19)

随笔档案(330)

  • 2020年9月 (1)
  • 2020年8月 (1)
  • 2020年7月 (8)
  • 2020年4月 (1)
  • 2020年2月 (1)
  • 2020年1月 (1)
  • 2019年9月 (2)
  • 2019年4月 (1)
  • 2016年1月 (1)
  • 2015年12月 (1)
  • 2015年7月 (4)
  • 2015年5月 (2)
  • 2014年3月 (2)
  • 2014年1月 (1)
  • 2013年12月 (1)
  • 2013年3月 (5)
  • 2013年2月 (4)
  • 2012年12月 (1)
  • 2012年11月 (2)
  • 2012年9月 (2)
  • 2012年8月 (1)
  • 2012年6月 (1)
  • 2012年5月 (1)
  • 2012年1月 (1)
  • 2011年12月 (2)
  • 2011年10月 (1)
  • 2011年9月 (3)
  • 2011年8月 (1)
  • 2011年7月 (5)
  • 2011年6月 (3)
  • 2011年5月 (5)
  • 2011年4月 (2)
  • 2011年3月 (2)
  • 2011年2月 (1)
  • 2011年1月 (5)
  • 2010年12月 (1)
  • 2010年11月 (4)
  • 2010年9月 (13)
  • 2010年8月 (4)
  • 2010年7月 (5)
  • 2010年6月 (5)
  • 2010年5月 (13)
  • 2010年4月 (10)
  • 2010年3月 (5)
  • 2010年2月 (1)
  • 2010年1月 (9)
  • 2009年12月 (5)
  • 2009年11月 (5)
  • 2009年10月 (1)
  • 2009年9月 (3)
  • 2009年8月 (2)
  • 2009年7月 (6)
  • 2009年6月 (3)
  • 2009年5月 (2)
  • 2009年4月 (1)
  • 2009年3月 (2)
  • 2009年2月 (3)
  • 2008年12月 (3)
  • 2008年11月 (1)
  • 2008年10月 (9)
  • 2008年9月 (5)
  • 2008年8月 (3)
  • 2008年7月 (1)
  • 2008年6月 (1)
  • 2008年5月 (2)
  • 2008年4月 (1)
  • 2008年3月 (1)
  • 2008年2月 (3)
  • 2008年1月 (1)
  • 2007年12月 (5)
  • 2007年11月 (1)
  • 2007年10月 (6)
  • 2007年9月 (4)
  • 2007年8月 (4)
  • 2007年7月 (34)
  • 2007年6月 (1)
  • 2007年4月 (2)
  • 2007年3月 (1)
  • 2007年2月 (1)
  • 2006年11月 (1)
  • 2006年9月 (4)
  • 2006年8月 (4)
  • 2006年7月 (1)
  • 2006年6月 (10)
  • 2006年5月 (3)
  • 2006年4月 (14)
  • 2006年2月 (6)
  • 2006年1月 (6)
  • 2005年12月 (12)

收藏夹(5)

  • Other(5)

IT技术

  • MSDN 库(中文)
  • 欢迎使用 MSDN 库(中文),MSDN 库为使用 Microsoft® 工具、产品、技术和服务的开发人员提供必不可少的信息资源。MSDN 库包含操作方法和参考文档、示例代码、技术文章和其他内容。请浏览目录或使用搜索功能来查找所需内容。

健康

  • 体检咨询
  • 北京体检 体检咨询
  • 足医生
  • 足医生

友情链接

  • TestLink中文论坛
  • Testlink 中文论坛
  • 备案专题
  • 备案专题
  • 微软大中华区安全博客
  • 微软大中华区安全博客

存储技术

  • doit存储
  • doit 存储,存储热门论坛
  • ITPUB
  • Oracle DBA 热门中文社区
  • TechTarget IT专家网
  • 蓝德科技

网络技术

  • ChinaUnix 中文社区
  • ChinaUnix 热门中文社区

搜索

  •  

最新评论

  • 1. re: 吐槽一下阿里系软件,就是天天的升级???
  • 评论内容较长,点击标题查看
  • --David
  • 2. re: Symantec Backup exec system recovery 2010(BESR 2010)故障汇总
  • 评论内容较长,点击标题查看
  • --112
  • 3. re: OpenStack安装部署管理中常见问题解决方法(OpenStack-Lite-FAQ)
  • /home/stack/devstack/tools/worlddump.py -d /home/stack/logs
    求救这是什么问题啊。
  • --陈晓龙
  • 4. re: nokia 手机密码忘记后破解
  • nokia 2630,密码不见,恳请帮忙,谢谢
    串号:355219037959407
    lipolipo@gmail.com
  • --沈同学
  • 5. re: chroot 工具 jailkit 限制用户 活动范围 和 权限 _ 笔记
  • 是一个很好的工具嘛。感谢分享。
  • --少林功夫好

阅读排行榜

评论排行榜

View Post

HOWTO_Backup_to_DVD

The goal of this article is to backup a Linux system to multiple DVDs.

Backing up to another drive is optimal as DVD's can become scratched, and some DVD's organic dye only last a couple years, but backing up to a DVD can be practical for extra security or if necessary.
Manual Backup

This process uses command line processes tar ( to compress the operating system ) and growisofs ( a wrapper for DVD implementation of mkisofs ) for the backup and restore.

One can either choose to do a partial-backup, or do a complete system backup.
Partial Backup

Doing a full system backup, often isn't required. Since most applications are often updated within a 6 month release cycle, backing up the entire system often isn't necessary.

To do a partial backup we'll just concentrate on the personal data, configuration files, and any additional programs also added besides what the portage ( or package manager ) has installed.

A good backup for most users needs:

#!/bin/bash

# System-configs, /home

cd /
tar cvpzf backup-partial.tgz /boot /etc /usr/local/portage /home --exclude=/home//.mozilla/firefox/*.default/Cache --exclude=/home//.Trash --exclude=/home//.local/share/Trash/files

This will backup the kernel and the grub files as well.

The user may also wish to add /opt here as well. Many installation program outside the package manager install here.
Full System Backup

Theoretically because all of Linux is just files, a full system backup is possible on a running system. For safety, this isn't the best idea as files can be changed while backing up, though most distros can do this though.

To be able to backup files safely in Gentoo, boot a from another system other than the system being backed up. Gentoo uses baselayout and symlinks to /dev, making this required. An Install CD, another computer, or separate OS that has access to the drive are all possibilities.

The Gentoo Minimum CD works nicely, but any install CD will do.

Tar works very well to limit the space used when burning the DVDs.

Start the Install-CD or other OS and in the console/terminal make a directory to mount the system we intend to save.

mkdir /mnt/gentoo

and mount it:

mount /dev/hda /mnt/gentoo

Now change to that drive/partition:

cd /mnt/gentoo

and compress it:

tar -czpvf Gentoo-Backup.tgz --exclude=sys --exclude=proc --exclude=var/tmp --exclude=mnt --exclude=media --exclude=lost+found --exclude=usr/portage --exclude=usr/src --exclude=var/log/portage --exclude=Gentoo-Backup.tgz *

Not everything needs to compressed here ( though it can be ). Excluded are the /sys and /proc filesystems which are virtual and repopulating systems, and also portage as it changes and needs updated often.
Breaking up a Backup

It will take a number DVD's depending on whats installed to backup the system.

Because UDF (the DVD file system) write support in Linux is in an alpha stage using ISO-9660 format here is better for dependability.

ISO-9660 has a file size limitation of 4 GiB so the files here will be split into 2 segments to fit well onto the DVD.

The archive can be broken up with tar or split.

With tar:

tar -c -M --tape-length=2294900 --file=Gentoo-Backup-part1.tar Gentoo-Backup.tgz

After the first segment, at the prompt specify new (n) and the next split file

n Gentoo-Backup-part2.tar

* -c (create) and -M (multi-volume) breaks up the file.
* --tape-length refers to Unix original days when they actually backed up to magnetic tapes on large reels. --tape-length is in 1024 bytes measurements ( or 1 computer kilo ).

With split:

split -b 2240m Gentoo-Backup.tgz GB

* GB will be the prefix the split files start with.

For those that aren't familiar, DVD's marketing 4.7GB is in metric not binary. This makes the real ( binary ) number at 4.38GB of space on a DVD. So calculated right:

* DVD - 4.7 GB (metric) = 4.38 GB (binary) = 4592762 x 1024 kB

This doesn't allow for overhead ( filesystem and tar's ) for that the value is reduced to 4589800. Since this size a file isn't allowed on a ISO-9660 filesystem it's split in two. ((2240 [bin MB] * 1024 [bin kB / bin MB]) = 2293764 [bin kB] < 2294900 [bin kB])

Note: 2240m requires UDF filesystem (files larger than 2GB) - To get Linux and Windows filesystem on dvd split further:

split -b 1120m Gentoo-Backup.tgz GB

Burning to DVD

Use growisofs to burn the DVD (this command has support for Rockridge extensions). To burn the compressed archives:

growisofs -Z /dev/dvd -lrJ /Gentoo-Backup-part1.tar /Gentoo-Backup-part2.tar

To try UDF support and large file sizes (untested):

growisofs -Z /dev/dvd -lrJ -udf -allow-limited-size /Gentoo-Backup-part1.tar

Briefly, Rockridge extension are ISO additions that allow:

* Longer file names (up to 255 characters)
* Fewer restrictions on characters allowed in filenames
* UNIX-style file modes, user ids and group ids
* Symbolic links
* Deeper directory hierarchy

Backup Restore

Again Boot from the Install CD or other OS.

DVD only Device

If the only device available to restore from is the DVD, it is possible to eject the Gentoo Install CD and place a DVD in after the Installer is loaded.

Boot the Install CD with the '''gentoo docache''' option. When to command prompt is seen:

umount /mnt/cdrom
eject

Place the DVD and mount it:

mount /dev/cdrom /mnt/cdrom
mount /dev/ /mnt/gentoo

Putting it Back Together

Make sure the drive or partition is formated first

mkfs.ext3 /dev/
mkfs.reiserfs /dev/

Putting it back together is similar to creating it.

If breaking up was done with tar:

tar -x -M --file=Gentoo-Backup-part1.tar Gentoo-Backup.tgz

Be sure to use the original filename of the original archive or tar will refuse to rebind them. Again you will have to name the next split file.

If breaking up was done with split:

cat GB* > Gentoo-Backup.tgz

Restore the full backup now:

sudo tar xvpfz Gentoo-Backup.tgz -C /

posted on 2011-02-21 21:45 David 阅读(442) 评论(0)  编辑 收藏 引用 所属分类: *UNIX系统

只有注册用户登录后才能发表评论。
 
Powered by:
IT博客
Copyright © David