系統備份和恢復_製作引導維護盤

【背景】前期多系統安裝已經完成(win7 32位、win8.1 64位、centos7、ubuntu14、opensuse、suse linux),如果出現問題怎麼辦?爲了預防系統出現問題,所以需要進行備份恢復。先做一個維護引導盤,支持

【所用軟件下載地址】

1、再生龍clonezilla:(官網地址)(官網下載地址)(本站下載地址

2、ghost.img(搜一下,還是比較多的)(本站下載地址)

3、grub2:(官網地址)(本站下載地址)

4、syslinux:(官網下載地址

5、memdisk:(從上面下載的壓縮包中解出)

6、centos7-livecd(官網下載地址)

7、整體打包,參見(雲盤下載

【製作】

1、格式化U盤或移動硬盤,大約需要1.4GB。

2、下載維護引導盤_共享版.rar,然後解壓到U盤的根目錄下,目錄格式如下:

I:\usb_boot_part.txt
I:\boot
I:\boot\grub2win
I:\boot\grub2win\grub
I:\boot\grub2win\grub\bg004_1366_768.png
I:\boot\grub2win\grub\grub.cfg
I:\boot\grub2win\grub\grubenv
I:\boot\grub2win\grub\memdisk
I:\boot\grub2win\grub\fonts
I:\boot\grub2win\grub\fonts\unicode.pf2
I:\boot\grub2win\grub\i386-pc
I:\boot\grub2win\grub\locale
I:\boot\grub2win\grub\themes
I:\boot\img_set
I:\boot\img_set\CentOS-7.0-1406-x86_64-livecd.iso
I:\boot\img_set\clonezilla-live-2.4.2-10-amd64.iso
I:\boot\img_set\clonezilla-live-2.4.2-10-i586.iso
I:\boot\img_set\ghost.img
I:\boot\img_set\W7PE.ISO
I:\boot\tools
I:\boot\tools\grub-2.02~beta2-for-windows_reame.txt
I:\boot\tools\grub2b2_4_win

3、安裝gurb2引導

(1)打開cmd窗口,以管理員運行。

(2)執行wmic diskdrive  list brief,查看U盤所在磁盤序號,實例如下:

C:\Windows\system32>i:
I:\>cd I:\boot\tools\grub2b2_4_win
I:\boot\tools\grub2b2_4_win>wmic diskdrive  list brief
Caption                    DeviceID            Model                      Partit
ions  Size
HGST HTS721010A9E630       \\.\PHYSICALDRIVE0  HGST HTS721010A9E630       15      1000202273280
RAM Disk (SuperSpeed LLC)  \\.\PHYSICALDRIVE1  RAM Disk (SuperSpeed LLC)  1      3684925440
磁盤驅動器                 \\.\PHYSICALDRIVE2  磁盤驅動器                 1      1998743040

(3)假設U盤的盤符是I,則執行如下:

I:\boot\tools\grub2b2_4_win>grub-install --force --debug  --target=i386-pc --root-directory=I:\boot\grub2win --boot-directory=I:\boot\grub2win //./physicaldrive2
4、處理完畢,使用U盤重啓後如下,可以使用ghost進行window分區的備份和恢復;可以使用再生龍進行linux系統備份和恢復。也可以進入Win7 PE或centos7 live進行系統哦南方維護。


5、本文使用的grub.cfg部分如下:

#必須爲utf8的格式
#uefi平臺
insmod efi_gop
insmod efi_uga
#bios平臺
insmod vbe

search --no-floppy --set=root -f /usb_boot_part.txt
set bootpart=$root
insmod font
if loadfont /boot/grub2win/grub/fonts/unicode.pf2
then
    insmod gfxterm
    set gfxmode=auto
    set gfxpayload=keep
    terminal_output gfxterm
    set locale_dir=/boot/grub2win/grub/locale
    set lang=zh_CN
    insmod gettext
    insmod vga
    insmod ieee1275_fb
    insmod video_bochs
    insmod video_cirrus
fi


#這二行是支持jpeg和png圖片格式
insmod jpeg  
insmod png
if background_image /boot/grub2win/grub/bg004_1366_768.png; then
  true
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi   


#set color_normal=red/black #菜單中未選中項目的字體顏色
#set color_highlight=light-gray/blue #選中項目的字體顏色
set color_normal=white/black #菜單中未選中項目的字體顏色
set color_highlight=light-red/blue #選中項目的字體顏色


insmod part_msdos
insmod fat
insmod ntfs
insmod ext2
insmod loopback
insmod iso9660


menuentry "GHOST, DISKGEN, HDDREG, MHDD, DOS" {
    insmod ntfs
    linux16 /boot/grub2win/grub/memdisk raw
    initrd16 /boot/img_set/ghost.img
}
menuentry "Window7 PE X86" {
    insmod ntfs
    linux16 /boot/grub2win/grub/memdisk iso raw
    initrd16 /boot/img_set/W7PE.ISO
}


menuentry "Clonezilla-live-2.4.2-10 amd64 ISO" {
search --no-floppy --set=root -f /usb_boot_part.txt
set isofile=/boot/img_set/clonezilla-live-2.4.2-10-amd64.iso
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset nodmraid locales= keyboard-layouts= ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_batch=no vga=788 ip=  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 findiso=$isofile
initrd (loop)/live/initrd.img
}


menuentry "Clonezilla-live-2.4.2-10 amd64 ISO(VGA mode 1024x768)" {
search --no-floppy --set=root -f /usb_boot_part.txt
set isofile=/boot/img_set/clonezilla-live-2.4.2-10-amd64.iso
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset nodmraid locales= keyboard-layouts= ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_batch=no vga=791 ip=  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 findiso=$isofile
initrd (loop)/live/initrd.img
}


menuentry "Clonezilla-live-2.4.2-10 amd64 ISO 中文" {
search --no-floppy --set=root -f /usb_boot_part.txt
set isofile=/boot/img_set/clonezilla-live-2.4.2-10-amd64.iso
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset nodmraid locales=\"zh_CN.UTF-8\" keyboard-layouts= ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_batch=no vga=788 ip=  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 findiso=$isofile
initrd (loop)/live/initrd.img
}


menuentry "Clonezilla-live-2.4.2-10 amd64 ISO 中文(VGA mode 1024x768)" {
search --no-floppy --set=root -f /usb_boot_part.txt
set isofile=/boot/img_set/clonezilla-live-2.4.2-10-amd64.iso
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset nodmraid locales=\"zh_CN.UTF-8\" keyboard-layouts=\"\" ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_batch=\"no\" vga=791 ip=  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 findiso=$isofile
initrd (loop)/live/initrd.img
}
menuentry "Clonezilla-live-2.4.2-10-i586 ISO" {
search --no-floppy --set=root -f /usb_boot_part.txt
set isofile=/boot/img_set/clonezilla-live-2.4.2-10-i586.iso
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset nodmraid locales= keyboard-layouts= ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_batch=no vga=788 i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 ip=frommedia  nosplash findiso=$isofile toram=filesystem.squashfs
initrd (loop)/live/initrd.img
}


menuentry "Clonezilla-live-2.4.2-10-i586 ISO(VGA mode 1024x768)" {
search --no-floppy --set=root -f /usb_boot_part.txt
set isofile=/boot/img_set/clonezilla-live-2.4.2-10-i586.iso
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset nodmraid noeject locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch=no vga=791 ip=  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 findiso=$isofile
initrd (loop)/live/initrd.img
}


menuentry "Clonezilla-live-2.4.2-10-i586 ISO zh_CN" {
search --no-floppy --set=root -f /usb_boot_part.txt
set isofile=/boot/img_set/clonezilla-live-2.4.2-10-i586.iso
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset nodmraid locales=\"zh_CN.UTF-8\" keyboard-layouts=\"\" ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_batch=no vga=788 ip=  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 findiso=$isofile
initrd (loop)/live/initrd.img
}


menuentry "Clonezilla-live-2.4.2-10-i586 ISO 中文(VGA mode 1024x768)" {
search --no-floppy --set=root -f /usb_boot_part.txt
set isofile=/boot/img_set/clonezilla-live-2.4.2-10-i586.iso
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset nodmraid noeject locales=\"zh_CN.UTF-8\" keyboard-layouts= ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_batch=no vga=791 ip=  nosplash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 findiso=$isofile
initrd (loop)/live/initrd.img
}


menuentry 'Start CentOS Linux 7 Live' --class fedora --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set isofile=/boot/img_set/CentOS-7.0-1406-x86_64-livecd.iso
loopback loop $isofile
linux (loop)/isolinux/vmlinuz0 root=live:CDLABEL=CentOS-7-livecd-x86_64 iso-scan/filename=$isofile rootfstype=auto ro rd.live.image quiet  rhgb locale=zh_CN.UTF-8
initrd (loop)/isolinux/initrd0.img
}


menuentry 'Start CentOS Linux 7 Live in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set isofile=/boot/img_set/CentOS-7.0-1406-x86_64-livecd.iso
loopback loop $isofile
linux (loop)/isolinux/vmlinuz0 root=live:CDLABEL=CentOS-7-livecd-x86_64 iso-scan/filename=$isofile rootfstype=auto ro rd.live.image quiet  rhgb rd.luks=0 rd.md=0 rd.dm=0 nomodeset locale=zh_CN.UTF-8
initrd (loop)/isolinux/initrd0.img
}

menuentry "重啓" {
    reboot
}

menuentry "關機" {
    halt
}



                                                                                                                                 


【附錄】下面的沒有驗證過,僅是記錄一下

1、centos7下載地址

http://mirrors.aliyun.com/centos/7.1.1503/isos/x86_64/

http://ftp.sjtu.edu.cn/

http://livecdlist.com/

2、通過iso引導ubuntu live-cd

通過iso引導ubuntu live-cd:

在grub2中通過loopback設備加載,或者其它方法,只要能夠訪問到該iso中的casper目錄,如果是在grub2中,可以通過以下方式引導:
grub> loopback lo (hd0,1)/ubuntu-11.10-desktop-i386.iso
grub> linux (lo)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-11.10-desktop-i386.iso
grub> initrd (lo)/casper/initrd.lz
grub> boot

menuentry "ubuntukylin-14.10-desktop-amd64.iso" {
    search --no-floppy --set -f /ubuntukylin-14.10-desktop-amd64.iso
    loopback loop ($root)/ubuntukylin-14.10-desktop-amd64.iso
    linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=/ubuntukylin-14.10-desktop-amd64.iso locale=zh_CN.UTF-8 quiet splash --
    initrd (loop)/casper/initrd.lz
}

menuentry 'Ubuntu LiveCD' { 
set root='(hd0,msdos1)'
loopback loop (hd0,msdos1)/ubuntu-12.04-desktop-i386.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-12.04-desktop-i386.iso
initrd (loop)/casper/initrd.lz
}

3、通過iso引導openSuse live-cd

menuentry "openSUSE-13.2-KDE-Live-x86_64.iso" {
  set root='hd0,msdos5'
  set device='/dev/sda5'
  set isofile='/openSUSE-13.2-KDE-Live-x86_64.iso'
  set loader='/boot/x86_64/loader'                        
  loopback loop $isofile
  linux   (loop)$loader/linux isofrom_device=$device isofrom_system=$isofile LANG=zh_CN.UTF-8
  initrd  (loop)$loader/initrd
}

4、通過iso引導其他方式

title disk boot DT7
root (hd0,0)
kernel /vmlinuz0 root=CDLABEL=redflag-DT7-livecd isodev=/dev/sda1 isodev_dir=/ rootfstype=iso9660 vga=788 live_locale=zh_CN.UTF-8
initrd /initrd4disk.img



發佈了42 篇原創文章 · 獲贊 6 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章