Partition Table Erased, Machine still running
Hi Folks, I erased the partition table of a running machine. Shame on me. Machine is still running though. There _must_ be a way to get theinformation from the running kernel. As fdisk states: "The kernel still uses the old table" I tried /proc/partitions, but can't seem to get the cylinders right. At the moment I am copying 120GB data over ethernet, which is kind of tedious. Anyone ever recover from this ? Regards Dan
On Wednesday 30 March 2005 16:42, Dan Am wrote:
Hi Folks,
I erased the partition table of a running machine. Shame on me. Machine is still running though. There _must_ be a way to get theinformation from the running kernel. As fdisk states: "The kernel still uses the old table" I tried /proc/partitions, but can't seem to get the cylinders right. At the moment I am copying 120GB data over ethernet, which is kind of tedious. Anyone ever recover from this ?
Try this, but ONLY AFTER you finish copying over ethernet :-) parted rescue see info parted, commands explanations I have once fully recovered a partition with parted rescue. -- Command: rescue START END rescue a lost partition that used to be located approximately between START and END. If such a partition is found, Parted will ask you if you want to create a partition for it. This is useful if you accidently deleted a partition with parted's rm command, for example. Might try this too: http://www.cgsecurity.org/index.html?testdisk.html
Dan Am wrote:
Anyone ever recover from this ?
No, but you might be able to consult /proc/partitions. On my system, for example, I see the following: gr2130666:/home/gapinski # cat /proc/partitions major minor #blocks name 3 0 78150744 hda 3 1 40131 hda1 3 2 265072 hda2 3 3 1 hda3 3 4 61071097 hda4 3 5 1028128 hda5 3 6 7354978 hda6 3 7 8385898 hda7 253 0 8388608 dm-0 253 1 33554432 dm-1 253 2 4194304 dm-2 gr2130666:/home/gapinski # sfdisk -l Disk /dev/hda: 155061 cylinders, 16 heads, 63 sectors/track Warning: extended partition does not start at a cylinder boundary. DOS and Linux will interpret the contents differently. Warning: The partition table looks like it was made for C/H/S=*/255/63 (instead of 155061/16/63). For this listing I'll assume that geometry. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/hda1 0+ 4 5- 40131 de Dell Utility /dev/hda2 * 5 37 33 265072+ 83 Linux /dev/hda3 38 2125 2088 16771860 f W95 Ext'd (LBA) /dev/hda4 2126 9728 7603 61071097+ 8e Linux LVM /dev/hda5 38+ 165 128- 1028128+ 82 Linux swap / Solaris /dev/hda6 166+ 1081- 916- 7354978+ 83 Linux /dev/hda7 1082+ 2125 1044- 8385898+ 83 Linux gr2130666:/home/gapinski #
On Wednesday 30 March 2005 15:42, Dan Am wrote:
Hi Folks,
I erased the partition table of a running machine. Shame on me. Machine is still running though. There _must_ be a way to get theinformation from the running kernel. As fdisk states: "The kernel still uses the old table" I tried /proc/partitions, but can't seem to get the cylinders right. At the moment I am copying 120GB data over ethernet, which is kind of tedious. Anyone ever recover from this ?
Regards Dan
/proc/partitions /proc/diskstats may give u enough info to recreate the partition. use sfdisk to save the partition file in future in case u do this again :-) PaulH -- Paul Hewlett (Linux #359543) Tel: +27 21 852 8812 Cel: +27 72 719 2725 Fax: +27 86 672 0563 --
On Wednesday 30 March 2005 17:22, Paul Hewlett wrote:
On Wednesday 30 March 2005 15:42, Dan Am wrote:
Hi Folks,
I erased the partition table of a running machine. Shame on me. Machine is still running though. There _must_ be a way to get theinformation from the running kernel. As fdisk states: "The kernel still uses the old table" I tried /proc/partitions, but can't seem to get the cylinders right. At the moment I am copying 120GB data over ethernet, which is kind of tedious. Anyone ever recover from this ?
Regards Dan
/proc/partitions /proc/diskstats
may give u enough info to recreate the partition.
use sfdisk to save the partition file in future in case u do this again :-)
Please can you give an example on using sfdisk to save the partition table? Regards Stefan
On Wednesday 30 March 2005 19:33, Stefan Sander wrote:
Please can you give an example on using sfdisk to save the partition table?
You don't need no other special tool other than dd to save your partition table. As root: dd if=/dev/hda of=partition_table.sector bs=512 count=1 The partition table and boot loader are located in sector 0 of the hard-disk. To restore: dd if=/where/you/have/saved/partition_table.sector of=/dev/hda bs=512 count=1 That's it. Ain't Linux great.
On Wednesday 30 March 2005 18:33, Stefan Sander wrote:
On Wednesday 30 March 2005 17:22, Paul Hewlett wrote:
On Wednesday 30 March 2005 15:42, Dan Am wrote:
Hi Folks,
I erased the partition table of a running machine. Shame on me. Machine is still running though. There _must_ be a way to get theinformation from the running kernel. As fdisk states: "The kernel still uses the old table" I tried /proc/partitions, but can't seem to get the cylinders right. At the moment I am copying 120GB data over ethernet, which is kind of tedious. Anyone ever recover from this ?
Regards Dan
/proc/partitions /proc/diskstats
may give u enough info to recreate the partition.
use sfdisk to save the partition file in future in case u do this again :-)
Please can you give an example on using sfdisk to save the partition table?
sfdisk -d /dev/hda > /mnt/floppy/hda.part NB good idea to save it to a different disk drive.. PaulH -- Paul Hewlett (Linux #359543) Tel: +27 21 852 8812 Cel: +27 72 719 2725 Fax: +27 86 672 0563 --
Dan Am wrote:
I erased the partition table of a running machine. Shame on me. Machine is still running though. There _must_ be a way to get theinformation from the running kernel. As fdisk states: "The kernel still uses the old table" I tried /proc/partitions, but can't seem to get the cylinders right. At the moment I am copying 120GB data over ethernet, which is kind of tedious. Anyone ever recover from this ?
Yes, but not done while running Linux. :-p DFSee can build a new partition table from scratch by scanning the disk for the start sectors of partitions, and give you a list of those to choose from. It's not for the faint of heart. Nearly anyone would need help figuring out how, but there is an excellent help forum available to registered users moderated by the DFSee author to make it happen. URL is on page below. -- "In everything, do to others what you would have them do to you." Matthew 7:12 NIV Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://members.ij.net/mrmazda/partitioningindex.html
participants (6)
-
Dan Am
-
Felix Miata
-
Gary Gapinski
-
Paul Hewlett
-
Silviu Marin-Caea
-
Stefan Sander