[clug] Accidental commit to fdisk - rebuild (partitions stillmounted) [SEC=PERSONAL]

Chris Smart mail at christophersmart.com
Sun Jul 19 19:12:38 MDT 2009


2009/7/20 Roppola, Antti - BRS <Antti.Roppola at daff.gov.au>:
> Hi all,
>
> I hope there is a simple answer to this.
>
> I am helping out someone who accidentally removed an extended partition
> using fdisk on Suse linux 9 (86/64 sp3) and lost more partitions than
> expected.
> The system is up with all partitions still mounted. The risk is, if he
> reboots or unmounts any partition the data may be lost forever.
>
> I do not know how to obtain the current partition information on the
> drive to rebuild using fdisk.
> Help would be extremely appreciated here.
>

Firstly, if the data is still mounted, just back everything up onto an
external drive, re-partition, copy data back and keep moving.

If you can remember the exact sizes of the partitions then you can
re-partition the drive the same and all will be well.
Because the drive is still mounted df might be your friend there.

Logical partitions store their partition information in the partition
itself rather than the MBR, which might cause you headaches.

Also, if they happen to be on a software RAID array then you could
grab the partition table from the first drive and write it straight to
the second drive (or use it as a template to re-create).

Either way, your data is not lost. The smart thing to do is back up
before you reboot.

-c


More information about the linux mailing list