Disaster Recovery

Aus Doku-Wiki
Zur Navigation springenZur Suche springen

Partitionstabelle sichern/wiederherstellen

Sichern

# sfdisk -d /dev/hda > part.table

wiederherstellen

# sfdisk /dev/hda <  part.table

Bootsektor sichern/wiederherstellen

sichern

# dd if=/dev/hda of=/mnt/backup/hda.mbr bs=512 count=1

wiederherstellen

# dd if=/mnt/backup/hda.mbr of=/dev/hda bs=512 count=1

Linuxsystem kopieren

Lösung 1

Nicht vegessen den Boot-Loader und die fstab anzupassen

mkdir /mnt/old /mnt/new
mount /dev/sda1 /mnt/old
mount /dev/md1 /mnt/new
mkdir /mnt/new/usr /mnt/new/var
mount /dev/sys/usr /mnt/new/usr
mount /dev/sys/var /mnt/new/var
cd /mnt/old
find . | cpio -mavup /mnt/new

Lösung 2

Nicht vegessen den Boot-Loader und die fstab anzupassen

cd /mnt_old_system
tar -cvpf - . | (cd /mnt_new_system ; tar -xvf -)

Beste Lösung

System auf eine neun Platte umziehen

Vorbereitung
  • Nach dem Einbau der neuen Platte die Partitionen wie gewünscht erstellen
cfdisk /dev/[NEUE PLATTE/PARTITION]
  • Den Bootlodaer anpassen Achtung das sind nur Beispieldaten die angepasst werden müssen!!!
Grub
# Modified! Last modification Jul 25 CEST 2005
gfxmenu (hd0,9)/boot/message
color white/blue black/light-gray
default 0
timeout 8
bootp

###Don't change this comment - YaST2 identifier: Original name: Suse9.1-TEST(hda11-Test)###

title SuSE9.3-TEST(hda11-Test)
kernel (hd0,10)/boot/vmlinuz root=/dev/hda11 vga=791
initrd (hd0,10)/boot/initrd

###Don't change this comment - YaST2 identifier: Original name: Suse9.1-PRO(hda10-Pro)###

title SuSE9.3-PRO(hda10-Pro)
kernel (hd0,9)/boot/vmlinuz root=/dev/hda10 vga=791
initrd (hd0,9)/boot/initrd 
Lilo
boot	= /dev/hda
change-rules
reset
read-only
menu-scheme = Wg:kw:Wg:Wg
lba32
prompt
timeout	= 80
message	= /boot/message

 image  = /boot/vmlinuz
 label  = Suse8.x-TEST(hda11)
 root   = /dev/hda11
 vga    = 791
 initrd = /boot/initrd
 append = "hdc=ide-scsi"

 image  = /boot/vmlinuz
 label  = Suse8.x-PRO(hda10)
 root   = /dev/hda10
 vga    = 791
 initrd = /boot/initrd
 append = "hdc=ide-scsi"

 image  = /boot/vmlinuz.suse
 label  = failsafe
 root   = /dev/hda5
 vga    = 791
 initrd = /boot/initrd.suse
 append = "ide=nodma apm=off acpi=off  idebus=133 hdd=ide-scsi"
 optional

 image  = /boot/memtest.bin
 label  = memtest86

# Wie man sieht ist auch hier lediglich das label (Der angezeigte Name) und der root-Eintrag geändert.

Rescue-System Starten

  • Hier verwendet man entweder die Boot-CD der Distribution auf dem das System läuft, oder zum Beispiel eine aktuelle Knoppix