Dumping de uma única partição com dd (não o disco inteiro)

1

Eu joguei a partição bruta descarregada via ssh de um sistema externo usando o comando:

ssh [email protected] 'dd if=/dev/xvda2 bs=1M | gzip' | gunzip | dd of=xvda2.raw

Como você pode ver, somente a partição é descartada /dev/xvda2 (sim, isto é de propósito) porque esta é a partição / com todos os dados importantes para o sistema inicializar, e precisamos apenas disso, porque todo o servidor é ~ 1TB com as outras partições de armazenamento, então precisamos mover a partição raiz primeiro, girar o servidor e o resto dos dados será rsync-ed.

Em seguida, tentei restaurar a partição:

  1. Criado um novo disco em um sistema temporário, com tamanho um pouco maior que o dump xvda2.raw. No meu caso, 50GB, então o disco que eu criei é de 52GB.
  2. Crie uma nova partição no disco igual ao original e formate como ext4.
  3. dd o conteúdo de volta: dd if=xvda2.raw of=/dev/sde1 bs=1M conv=notrunc,noerror,sync

E quando tentei montar para inspecionar, recebi um erro:

# mount /dev/sde1 /mnt/temp/
mount: /dev/sde1: can't read superblock

Alguma sugestão do que eu posso estar errado?

Um pequeno histórico

Normalmente eu clona todo o disco. No entanto, neste caso, o sistema de origem é muito grande, então a abordagem é clonar apenas o drive raiz, tentar iniciar o novo sistema assim e então rsync o conteúdo para as outras partições de armazenamento. No meu caso, acredito que isso funcionaria, porque a partição / tem todo o conteúdo do servidor.

Editar: Obrigado pelos ponteiros. Depois de montar a partição e ela falhar, é possível encontrar o seguinte em 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
    
por Spirit 09.03.2018 / 18:24

0 respostas