how to save back partition table

Franz Waldmüller waldbauernbub at gmx.at
Mon Oct 4 15:07:10 UTC 2010


Hi loody,
loody wrote:
> Dear all:
> I accidentally dd about 7MBytes to /dev/sda1, and it cause my HD
> cannot be recognized by ubuntu.
> Is there any way to save it back, no matter use any tool under XP or ubuntu?
> appreciate your help,
> miloody
> 
check out the tools gpart and testdisk


http://www.mohdshakir.net/2008/01/03/recover-lost-partition-table-using-ubuntu-live-cd-gpart
Before doing any further configurations you should backup your hard disk.

#apt-cache show gpart
Package: gpart
Priority: optional
Section: universe/admin
Installed-Size: 108
Maintainer: Ubuntu MOTU Developers <ubuntu-motu at lists.ubuntu.com>
Original-Maintainer: Debian Forensics 
<forensics-devel at lists.alioth.debian.org>
Architecture: i386
Version: 0.1h-9
Depends: libc6 (>= 2.4)
Filename: pool/universe/g/gpart/gpart_0.1h-9_i386.deb
Size: 38426
MD5sum: f9a1376e579f2b65738221199d9f3d43
SHA1: 8d4f61951016ac4fc25e8bfdb52de4538c30fbb7
SHA256: 2b8cdeb359f8707526aa0e7d8916b49830e1635fbf8fec5a069a40ac3eae92d1
Description: Guess PC disk partition table, find lost partitions
  Gpart is a tool which tries to guess the primary partition table of a 
PC-type
  disk in case the primary partition table in sector 0 is damaged, 
incorrect or
  deleted.
  .
  It is also good at finding and listing the types, locations, and sizes of
  inadvertently-deleted partitions, both primary and logical. It gives 
you the
  information you need to manually re-create them (using fdisk, cfdisk, 
sfdisk,
  etc.).
  .
  The guessed table can also be written to a file or (if you firmly 
believe the
  guessed table is entirely correct) directly to a disk device.
  .
  Currently supported (guessable) filesystem or partition types:
  .
   * BeOS filesystem type.
   * FreeBSD/NetBSD/386BSD disklabel sub-partitioning scheme used on Intel
     platforms.
   * Linux second extended filesystem.
   * MS-DOS FAT12/16/32 "filesystems".
   * IBM OS/2 High Performance filesystem.
   * Linux LVM physical volumes (LVM by Heinz Mauelshagen).
   * Linux swap partitions (versions 0 and 1).
   * The Minix operating system filesystem type.
   * MS Windows NT/2000 filesystem.
   * QNX 4.x filesystem.
   * The Reiser filesystem (version 3.5.X, X > 11).
   * Sun Solaris on Intel platforms uses a sub-partitioning scheme on PC 
hard
     disks similar to the BSD disklabels.
   * Silicon Graphics' journalling filesystem for Linux.
Homepage: http://home.pages.de/~michab/gpart/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

----------------------------

#apt-cache show testdisk
Package: testdisk
Priority: optional
Section: universe/admin
Installed-Size: 4672
Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
Original-Maintainer: Jean-Michel Kelbert <kelbert at debian.org>
Architecture: i386
Version: 6.11-1
Depends: e2fslibs (>= 1.41.0), libc6 (>= 2.7), libcomerr2 (>= 1.01), 
libjpeg62, libncursesw5 (>= 5.6+20071006-3), libntfs10 (>= 2.0.0), 
libuuid1 (>= 1.05)
Filename: pool/universe/t/testdisk/testdisk_6.11-1_i386.deb
Size: 1546936
MD5sum: d47c7bc23b630b832c78983b8deb0f6a
SHA1: ec0e0dea2e5df1d4d525e6c9fe06aff74c1a6236
SHA256: 55fc39e294f6e20aea65c2cf22e9b5636d18ce9aef0571f8b156d1548588ee90
Description: Partition scanner and disk recovery tool
   TestDisk checks the partition and boot sectors of your disks.
   It is very useful in recovering lost partitions.
   It works with :
   * DOS/Windows FAT12, FAT16 and FAT32
   * NTFS ( Windows NT/2K/XP )
   * Linux Ext2 and Ext3
   * BeFS ( BeOS )
   * BSD disklabel ( FreeBSD/OpenBSD/NetBSD )
   * CramFS (Compressed File System)
   * HFS and HFS+, Hierarchical File System
   * JFS, IBM's Journaled File System
   * Linux Raid
   * Linux Swap (versions 1 and 2)
   * LVM and LVM2, Linux Logical Volume Manager
   * Netware NSS
   * ReiserFS 3.5 and 3.6
   * Sun Solaris i386 disklabel
   * UFS and UFS2 (Sun/BSD/...)
   * XFS, SGI's Journaled File System



Wish you luck!
Franz




More information about the ubuntu-users mailing list