노후 디스크교체/업그레이드 - RHEL4
페이지 정보
작성자 상석하대 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 에필로그 댓글 0건 조회 2,902회 작성일 22-06-22 20:36본문
노화된 하드디스크라 백업중에 망가질까 조심스러웠다.
오래된 장비는 백업하다가 디스크가 나가거나 레이드에 오류가 발생하는 경우가 있어서다.
설치된 RHEL 4.8(kernel 2.6.9-89)의 부팅 CD를 구할 수가 없어서 파티션 백업과 복구에 SystemRescueCD를 사용했다.
1. 파티션 정보 파악 *마운트 후 fstab 파일 내용 확인, df를 실행
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
LABEL=/data /data ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/home /home ext3 defaults 1 2
LABEL=/log /log ext3 defaults 1 2
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
LABEL=SWAP-sda5 swap swap defaults 0 0
/dev/sda1 * 63 208844 208782 102M 83 Linux
/dev/sda2 208845 21173669 20964825 10G 83 Linux
/dev/sda3 21173670 230886179 209712510 100G 83 Linux
/dev/sda4 230886180 488392064 257505885 122.8G 5 Extended
/dev/sda5 230886243 272831894 41945652 20G 82 Linux swap / Solaris
/dev/sda6 272831958 293796719 20964762 10G 83 Linux
/dev/sda7 293796783 314761544 20964762 10G 83 Linux
/dev/sda8 314761608 335726369 20964762 10G 83 Linux
/dev/sda9 335726433 488392064 152665632 72.8G 83 Linux
2. 백업 *sdb는 백업 저장용, sda는 원본
mount -t ext4 /dev/sdb1 /mnt
mkdir /mnt/partitions
mount -t ext3 /dev/sda1 /home
dump -0f /mnt/partions/boot.dump /home
umount /home
mount -t ext3 /dev/sda2 /home
dump -0f /mnt/partions/root.dump /home
umount /home
mount -t ext3 /dev/sda3 /home
dump -0f /mnt/partions/data.dump /home
umount /home
mount -t ext3 /dev/sda6 /home
dump -0f /mnt/partions/usr.dump /home
umount /home
mount -t ext3 /dev/sda7 /home
dump -0f /mnt/partions/var.dump /home
umount /home
mount -t ext3 /dev/sda8 /home
dump -0f /mnt/partions/home.dump /home
umount /home
mount -t ext3 /dev/sda9 /home
dump -0f /mnt/partions/log.dump /home
umount /home
3. 새 디스크 파티션
fdisk /dev/sda *다음처럼 용량은 적당히 분배
/dev/sda1 * 83 Linux
/dev/sda2 83 Linux
/dev/sda3 83 Linux
/dev/sda4 5 Extended
/dev/sda5 82 Linux swap / Solaris
/dev/sda6 83 Linux
/dev/sda7 83 Linux
/dev/sda8 83 Linux
/dev/sda9 83 Linux
mkfs.ext3 -I 128 /dev/sda1
tune2fs -l /dev/sda1 | grep -i 'inode size' *128을 기본값으로 해야 grub 복구가 가능했음, 아이노드 크기 확인
mkfs.ext3 /dev/sda2
mkfs.ext3 /dev/sda3
mkswap -L SWAP-sda5 /dev/sda5
mkfs.ext3 /dev/sda6
mkfs.ext3 /dev/sda7
mkfs.ext3 /dev/sda8
mkfs.ext3 /dev/sda9
e2label /dev/sda1 /boot
e2label /dev/sda2 /
e2label /dev/sda3 /data
e2label /dev/sda6 /usr
e2label /dev/sda7 /var
e2label /dev/sda8 /home
e2label /dev/sda9 /log
4. 파티션 복구
mount /dev/sdb1 /home
mkdir /mnt/restore
cd /mnt/restore
mount /dev/sda2 /mnt/restore
ll
rm -rf "./lost+found"
restore -rf /home/partitions/root.dump
mkdir ./boot
mount /dev/sda1 /mnt/restore/boot
cd ./boot
ll
rm -rf "./lost+found"
restore -rf /home/partitions/boot.dump
cd ..
mkdir ./data
mount /dev/sda3 /mnt/restore/data
cd ./data
ll
rm -rf "./lost+found"
restore -rf /home/partitions/data.dump
cd ..
mkdir ./usr
mount /dev/sda6 /mnt/restore/usr
cd ./usr
ll
rm -rf "./lost+found"
restore -rf /home/partitions/usr.dump
cd ..
mkdir ./var
mount /dev/sda7 /mnt/restore/var
cd ./var
ll
rm -rf "./lost+found"
restore -rf /home/partitions/var.dump
cd ..
mkdir ./home
mount /dev/sda8 /mnt/restore/home
cd ./home
ll
rm -rf "./lost+found"
restore -rf /home/partitions/home.dump
cd ..
mkdir ./log
mount /dev/sda3 /mnt/restore/log
cd ./log
ll
rm -rf "./lost+found"
restore -rf /home/partitions/log.dump
cd /
5. 마무리
chroot /mnt/restore /bin/bash
MAKEDEV sda
grub
root (hd0,0) > setup (hd0) > quit
cat /etc/fstab *점검
sync;sync;sync
exit
umount /mnt/restore/{boot,data,usr,var,home,log}
umount /mnt/restore/
reboot
댓글목록
등록된 댓글이 없습니다.