[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is it possible to recreate partition table from /var/log/installer data?



On Sat, Mar 15, 2008 at 11:33:03AM +1100, Jeff Ewing wrote:
> I accidentally overwrote 5MB over /dev/sda - the partition table and
> my /boot partion

*IF* you have not rebooted and at least one partiton on your /dev/sda is
in use (as it seems), then /proc/partitions still contains the correct
data (the kernel does not re-read the partition table of a disk which is
in use), so for example mke2fs /dev/sda1 sould build a filesystem with
the correct start and end points (even if the partition table on disk is
corrupted). With a correct filesystem on disk then existing tools should
help: perhaps testdisk is not useful (it searches sane files in sane
filesystems when the partition table is corrupted), but there are also
tools like gpart that should work to reconstruct a corrupted partition
table when the filesystems are sane.

If you have lost *only* /boot then it sufficies to umount /boot,
recreate the partition table, recreate the filesystem for /boot/,
remount /boot , reinstall the kernel and the boot loader.

If you have also lost the beginning of the filesystem in the encripted
lvm partition then the recover is much harder and I have no idea. But if
you are still using the / filesystem without errors then it is quite
possibly still sane.

-- 
Chi usa software non libero avvelena anche te. Digli di smettere.
Informatica=arsenico: minime dosi in rari casi patologici, altrimenti letale.
Informatica=bomba: intelligente solo per gli stupidi che ci credono.


Reply to: