r1 - 17 Aug 2005 - 21:05:50 - IuriDinizYou are here: TWiki >  Personal Web  > XfsRestore

Reconstruindo o superblock (primeiros 512 bytes) XFS

Eu apaguei os 512 bytes da minha partição xfs sem querer (coloquei o stage1 do grub nele).

Desespero? morte? meus dados estão ali só perdi o inicio, tem solução.

Ia ler como o mkfs.xfs cria o superblock (fontes do mesmo), mas consegui achar na internet: http://oss.sgi.com/archives/linux-xfs/2005-03/msg00151.html

Criei uma partição em um arquivo do mesmo tamanho da anterior

#!/bin/sh
dd if=/dev/zero of=/tmp/xfs.root bs=1024 count=1 seek=94382442
criei o sistema xfs nele.
#!/bin/sh
mkfs.xfs -L "/" /tmp/xfs.root
Copie seus primeiros 512 bytes da nova partição em arquivo para a partição a recuperar.
#!/bin/sh
dd if=/tmp/xfs.root of=/tmp/xfs.root.512 bs=512 count=1
dd if=/tmp/xfs.root.512 of=/dev/hda1 bs=512 count=1
Agora rodei um xfs_repair e funcionou perfeitamente.
#!/bin/sh
xfs_repair /dev/hda1

-- IuriDiniz - 17 Aug 2005

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback