You are not logged in.

#1 2013-11-23 19:58:27

Dornith
Member
Registered: 2013-02-19
Posts: 78

Recovering a ruined partition table

I would like to begin by saying, I f***ed up big time. 

When trying to reboot my machine having hibernated it the night before, I found that the computer would only boot into recovery mode and didn't respond to my keyboard.  After trying again, and the fallback I put the Arch install disk in to try to figure out the problem.  The first thing I found was the /boot partition couldn't mount due to a filesystem problem.  I decided that rather than try and fix it, I'd create a new one.  I originally used JFS for god knows what reason but this time I tried to put ext2 on it (which is I use for all my other Arch installs).  Afterwhich, it seemed to have some kind of problem with both of the filesystems.  I learnt from another install that a good way to deal with a filesystem that refuses to die is to use:

dd if=/dev/urandom of=/dev/sdaX bs=1M

and create a new partition in it's place.  But I must have overlooked something because now it says that sda4 (the /boot partition I was trying to destroy) is longer than the hard drive. 

I'm fairly certain that my data is still there because it says dd only wrote about 176kB.  I think I should be able to delete the partition and everything should work, but I may be oversimplifying it. 

If anyone has any suggestions or idea the help is appreciated.  Also I am, at this moment, creating an image of my drive, just in case. 

Right now I'm thinking of print /dev/zero to sda4 for 176kB and see if that fixes it.

Last edited by Dornith (2013-11-23 21:36:48)

Offline

#2 2013-11-23 20:06:54

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,092
Website

Re: Recovering a ruined partition table

Okay, first, is that actually the command that you used? If so, it shouldn't have done anything since /dev/sdX almost certainly isn't a valid device (nor the one you talk about). Second, that command would zero the whole drive, so if you ran that command without specifying a specific partition, the drive is probably zero'd.

All the best,

-HG

Offline

#3 2013-11-23 21:39:09

Dornith
Member
Registered: 2013-02-19
Posts: 78

Re: Recovering a ruined partition table

Sorry it was urandom, not zero.  I fixed it in the orignal post. 

Also, that this not the actual command I typed into this computer, it was just a format for a command I had learnt to use in another instance.  The actual command I typed onto my now non-functional computer was:

dd if=/dev/urandom of=/dev/sda4

Last edited by Dornith (2013-11-23 21:39:42)

Offline

#4 2013-11-23 22:10:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Recovering a ruined partition table

Next time, look into wipefs.

Offline

#5 2013-11-23 23:47:38

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: Recovering a ruined partition table

Use Testdisk to resurrect that partition.  It is the fastest and simplest way I'm aware of resurrecting dead / old partitions.  It should be on the wiki about how Testdisk is used.  Your partition may still be damaged but at least you can access it after Testdisk is done and then run the fsck utility (JFS does have one, right?) on that partition.  From there I'm pretty sure you can figure out what else you need to do.

Last edited by MoonSwan (2013-11-23 23:49:03)

Offline

#6 2013-11-24 03:53:06

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: Recovering a ruined partition table

What kind of partition table does it have? GPT disks have a back up partition table which tools like gdisk can use to restore a damaged primary partition table.

Please post the output of gdisk -l /dev/sdX (for GPT) or fdisk -l /dev/sdX (for MBR).


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB