- 论坛徽章:
- 0
|
备份:
1) 挂接一块介质好的盘
2) kudzu
3) fdisk -l
Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 653 5245191 7 Linux
/dev/hda5 654 666 104359+ 83 swap
Device Boot Start End Blocks Id System
4) 按照 /dev/hda, 为/dev/hdc划一样的分区
5) fdisk -l
Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 653 5245191 7 Linux
/dev/hda3 654 666 104359+ 83 swap
Device Boot Start End Blocks Id System
/dev/hdc1 1 653 5245191 7 Linux
/dev/hdc3 654 666 104359+ 83 swap
6) toggle a bootable flag on /dev/hdc1
7) fdisk -l /dev/hdc
Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 653 5245191 7 Linux
/dev/hdc3 654 666 104359+ 83 swap
8) mount /dev/hdc1 /mnt
9) df -k
文件系统 1K-块 已用 可用 已用% 挂载点
/dev/hda1 6190664 3310424 2565772 57% /
none 192264 0 192264 0% /dev/shm
/dev/hdc1 6190664 2424 2565772 1% /mnt
10) dump -0uf - /|(cd /mnt; restore -xaf -)
after dump/restore finish, setup grub on /dev/hdc
11) grub
> root (hd0,0)
> setup (hd0)
> quit
don't forget change fstab file, and grub.conf file
12) change /mnt/etc/fstab, vi /mnt/etc/fstab
LABEL=/boot /boot ext3 defaults 1 2 -->
/dev/hdc1 /boot ext3 defaults 1 2
13) change /mnt/boot/grub/grub.conf, vi /mnt/boot/grub/grub.conf
title Red Hat 9
root (hd0,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ --> kernel /vmlinuz-2.4.20-8 ro root=/dev/hdc1
initrd /initrd-2.4.20-8.img
14) reboot
if the original disk is crashed, replace it with the good one and boot server.
ok! |
|