다음 명령을 사용하여 SSH를 통해 외부 시스템에서 덤프된 원시 파티션을 덤프했습니다.
ssh [email protected] 'dd if=/dev/xvda2 bs=1M | gzip' | gunzip | dd of=xvda2.raw
보시다시피 파티션만 덤프됩니다 /dev/xvda2
(예, 의도적인 것입니다). 이는 시스템 시작에 중요한 모든 데이터가 포함된 / 파티션이고 전체 서버가 다른 파티션과 함께 있기 때문에 파티션만 필요하기 때문입니다. 약 1TB 스토리지 파티션이므로 먼저 루트 파티션을 이동하고 서버를 시작한 다음 나머지 데이터를 재동기화해야 합니다.
다음으로 파티션을 복구하려고 합니다.
- xvda2.raw 덤프보다 약간 큰 새 디스크가 임시 시스템에 생성됩니다. 제 경우는 50GB이므로 제가 만든 디스크는 52GB입니다.
- 원래 파티션과 동일한 디스크에 ext4로 포맷된 새 파티션을 만듭니다.
- 콘텐츠를 다시 추가하세요.
dd if=xvda2.raw of=/dev/sde1 bs=1M conv=notrunc,noerror,sync
확인하기 위해 설치하려고 하면 다음과 같은 오류가 발생합니다.
# mount /dev/sde1 /mnt/temp/
mount: /dev/sde1: can't read superblock
제가 범할 수 있는 실수에 대해 제안해 주실 수 있나요?
뒷이야기
일반적으로 전체 디스크를 복제합니다. 그러나 이 경우 소스 시스템이 매우 크기 때문에 루트 드라이브를 복제하고 이와 같이 새 시스템을 부팅한 다음 다른 스토리지 파티션의 내용을 재동기화하는 방법이 사용됩니다. 내 경우에는 / 파티션에 서버에 대한 모든 것이 포함되어 있으므로 이것이 작동할 것이라고 믿습니다.
편집: 조언해 주셔서 감사합니다. 파티션을 마운트한 후 실패했으며 다음에서 찾을 수 있습니다 dmesg
.
[ 3530.757481] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587756: comm mount: lblock 30700 mapped to illegal pblock (length 1)
[ 3530.768332] jbd2_journal_bmap: journal block not found at offset 30700 on sde1-8
[ 3530.768334] JBD2: bad block at offset 30700
[ 3530.768336] JBD2: IO error -5 recovering block 30700 in log
[ 3530.768339] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587757: comm mount: lblock 30701 mapped to illegal pblock (length 1)
[ 3530.776409] jbd2_journal_bmap: journal block not found at offset 30701 on sde1-8
[ 3530.776411] JBD2: bad block at offset 30701
[ 3530.776412] JBD2: IO error -5 recovering block 30701 in log
[ 3530.776415] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587758: comm mount: lblock 30702 mapped to illegal pblock (length 1)
[ 3530.790785] jbd2_journal_bmap: journal block not found at offset 30702 on sde1-8
[ 3530.790788] JBD2: bad block at offset 30702
[ 3530.790789] JBD2: IO error -5 recovering block 30702 in log
[ 3530.790793] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587759: comm mount: lblock 30703 mapped to illegal pblock (length 1)
[ 3530.802422] jbd2_journal_bmap: journal block not found at offset 30703 on sde1-8
[ 3530.802425] JBD2: bad block at offset 30703
[ 3530.802426] JBD2: IO error -5 recovering block 30703 in log
[ 3530.802430] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587760: comm mount: lblock 30704 mapped to illegal pblock (length 1)
[ 3530.804867] jbd2_journal_bmap: journal block not found at offset 30704 on sde1-8
[ 3530.804869] JBD2: bad block at offset 30704
[ 3530.804870] JBD2: IO error -5 recovering block 30704 in log
[ 3530.804873] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587761: comm mount: lblock 30705 mapped to illegal pblock (length 1)
[ 3530.805166] jbd2_journal_bmap: journal block not found at offset 30705 on sde1-8
[ 3530.805167] JBD2: bad block at offset 30705
[ 3530.805168] JBD2: IO error -5 recovering block 30705 in log
[ 3530.805170] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587762: comm mount: lblock 30706 mapped to illegal pblock (length 1)
[ 3530.805467] jbd2_journal_bmap: journal block not found at offset 30706 on sde1-8
[ 3530.805468] JBD2: bad block at offset 30706
[ 3530.805469] JBD2: IO error -5 recovering block 30706 in log
[ 3530.805471] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587763: comm mount: lblock 30707 mapped to illegal pblock (length 1)
[ 3530.805980] jbd2_journal_bmap: journal block not found at offset 30707 on sde1-8
[ 3530.805981] JBD2: bad block at offset 30707
[ 3530.805982] JBD2: IO error -5 recovering block 30707 in log
[ 3530.805984] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587764: comm mount: lblock 30708 mapped to illegal pblock (length 1)
[ 3530.806322] jbd2_journal_bmap: journal block not found at offset 30708 on sde1-8
[ 3530.806324] JBD2: bad block at offset 30708
[ 3530.806325] JBD2: IO error -5 recovering block 30708 in log
[ 3530.806327] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587765: comm mount: lblock 30709 mapped to illegal pblock (length 1)
[ 3530.806644] jbd2_journal_bmap: journal block not found at offset 30709 on sde1-8
[ 3530.806645] JBD2: bad block at offset 30709
[ 3530.820916] JBD2: recovery failed
[ 3530.820919] EXT4-fs (sde1): error loading journal
[ 4016.957490] EXT4-fs (sde1): mounted filesystem with ordered data mode. Opts: (null)
[ 8947.062786] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587756: comm mount: lblock 30700 mapped to illegal pblock (length 1)
[ 8947.063597] jbd2_journal_bmap: journal block not found at offset 30700 on sde1-8
[ 8947.063599] JBD2: bad block at offset 30700
[ 8947.063600] JBD2: IO error -5 recovering block 30700 in log
[ 8947.063602] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587757: comm mount: lblock 30701 mapped to illegal pblock (length 1)
[ 8947.064111] jbd2_journal_bmap: journal block not found at offset 30701 on sde1-8
[ 8947.064113] JBD2: bad block at offset 30701
[ 8947.064114] JBD2: IO error -5 recovering block 30701 in log
[ 8947.064116] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587758: comm mount: lblock 30702 mapped to illegal pblock (length 1)
[ 8947.064540] jbd2_journal_bmap: journal block not found at offset 30702 on sde1-8
[ 8947.064541] JBD2: bad block at offset 30702
[ 8947.064542] JBD2: IO error -5 recovering block 30702 in log
[ 8947.064544] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587759: comm mount: lblock 30703 mapped to illegal pblock (length 1)
[ 8947.064960] jbd2_journal_bmap: journal block not found at offset 30703 on sde1-8
[ 8947.064961] JBD2: bad block at offset 30703
[ 8947.064962] JBD2: IO error -5 recovering block 30703 in log
[ 8947.064964] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587760: comm mount: lblock 30704 mapped to illegal pblock (length 1)
[ 8947.065338] jbd2_journal_bmap: journal block not found at offset 30704 on sde1-8
[ 8947.065340] JBD2: bad block at offset 30704
[ 8947.065340] JBD2: IO error -5 recovering block 30704 in log
[ 8947.065342] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587761: comm mount: lblock 30705 mapped to illegal pblock (length 1)
[ 8947.066019] jbd2_journal_bmap: journal block not found at offset 30705 on sde1-8
[ 8947.066020] JBD2: bad block at offset 30705
[ 8947.066021] JBD2: IO error -5 recovering block 30705 in log
[ 8947.066023] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587762: comm mount: lblock 30706 mapped to illegal pblock (length 1)
[ 8947.080135] jbd2_journal_bmap: journal block not found at offset 30706 on sde1-8
[ 8947.080138] JBD2: bad block at offset 30706
[ 8947.080139] JBD2: IO error -5 recovering block 30706 in log
[ 8947.080142] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587763: comm mount: lblock 30707 mapped to illegal pblock (length 1)
[ 8947.088046] jbd2_journal_bmap: journal block not found at offset 30707 on sde1-8
[ 8947.088049] JBD2: bad block at offset 30707
[ 8947.088051] JBD2: IO error -5 recovering block 30707 in log
[ 8947.088054] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587764: comm mount: lblock 30708 mapped to illegal pblock (length 1)
[ 8947.088677] jbd2_journal_bmap: journal block not found at offset 30708 on sde1-8
[ 8947.088679] JBD2: bad block at offset 30708
[ 8947.088680] JBD2: IO error -5 recovering block 30708 in log
[ 8947.088683] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587765: comm mount: lblock 30709 mapped to illegal pblock (length 1)
[ 8947.089133] jbd2_journal_bmap: journal block not found at offset 30709 on sde1-8
[ 8947.089134] JBD2: bad block at offset 30709
[ 8947.104770] JBD2: recovery failed
[ 8947.104773] EXT4-fs (sde1): error loading journal