Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Grub Rescue

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
Chris Olson
Posts: 7
Joined: 2015-11-05 01:04

Grub Rescue

#1 Post by Chris Olson »

I installed Jessie on a Dell XPS using the entire disk, as I do not dual boot or have any use for Windows. The machine ran fine for a couple days but when I booted it yesterday it fails to boot with an unknown filesystem error and grub rescue.

I am not new to this so no sense going thru all the grub commands, which I am already familiar with. None of them work. So I booted the machine with the net install CD using recovery mode to see if I could get a shell on the root filesystem to fix it. Alas, my disk partitioning is hosed. /dev/sda1 should be my root partition. I could not get a shell on that partition so I had to start a shell in the installer. Running fdisk -l shows that /dev/sda1, instead of being a linux partition, is Win95 FAT32. The disk is 150GB, /dev/sda1 should be the root, /dev/sda3 is the Extended, /dev/sda5 is swap. The extended and swap partitions are fine. The root is gone. With /dev/sda1 mounted to /target in the installer shell, cd /target and ls shows a Windows file system and it is only 2.5 GB in size. I believe this is the original Windows recovery partition, which the Debian installer did not delete or format during the install for some reason. And it is now /dev/sda1 according fdisk.

I have never in my life seen this, and I been running Debian for 15 years. So the big question is, what happened to my root filesystem, and how can I recover it?

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Grub Rescue

#2 Post by dasein »

Chris Olson wrote:So the big question is, what happened to my root filesystem...
Sounds like your partition table got corrupted. What caused the corruption? Could be any of a half dozen different things, many of which cannot be definitively diagnosed nor detected.
Chris Olson wrote:...and how can I recover it?
How would you, as a 15-year Linux veteran, answer that question if you weren't the one asking it?

Personally, I can't think of a reason (particularly on an install that is just 2 days old) not to reinstall, or restore from backup, re-creating the partition table from scratch in the process. No muss, no fuss, and way quicker than any other alternative. You could try in situ recovery, but IME that tends to works better on a clobbered partition table, rather than a corrupted one.

OTOH, if it would make you feel better, you could try to do an extensive analysis to hunt up a root cause. But given that many candidate causes are one-time freak occurrences that are entirely OS-independent (power spikes, cosmic, rays, etc.), you may end up on a bit of a wild goose chase.

Either way, neither post-mortem diagnostic procedures nor alternate recovery procedures are Debian-specific. You know that. Google awaits.

Chris Olson
Posts: 7
Joined: 2015-11-05 01:04

Re: Grub Rescue

#3 Post by Chris Olson »

dasein wrote: How would you, as a 15-year veteran, answer that question?

Personally, I can't think of a reason (particularly on an install that is just 2 days old) not to reinstall, or restore from backup.
I always like to know the cause when something like this happens. Especially when I've never seen it before. And the fix if others have run into it.

I had this laptop given to me a week ago because the owner thought it was junk. It was running every virus known to man and was non-functional. I never refuse a free laptop, especially a newer one that's pretty nice.

I think I figured out what happened. That extended partition was the Windows restore partition, which automatic guided partitioning failed to delete during install. When I rebooted the machine, somehow the automatic recovery mode got executed. Still haven't figured out that happened but apparently with the Dell XPS it will go into automatic recovery after four repeated attempts to boot it, which I did. So it attempted to re-install Windows 7 on my root partition from the restore partition. That failed as it did not modify the MBR, but it completely destroyed my root partition before it ran into an error and halted.

I pulled the drive out of the machine, put it in an external enclosure and mounted it on another Debian machine and / is gone on it.

Nothing that a re-install, delete that extended partition, and disable auto recovery in the BIOS won't fix. And it is, after all, Friday the 13th when these sort of things tend to be more prominent. Thanks for the reply, and remember that it never hurts to ask when you see something you've never seen before, as somebody else might have run into it at one point. Never start thinking that just because you're an old dog that you can't learn a new trick.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Grub Rescue

#4 Post by GarryRicketson »

I believe this is the original Windows recovery partition, which the Debian installer did not delete or format during the install for some reason. And it is now /dev/sda1 according fdisk.
This tells me, you did not completely wipe the HD, there should not have been anything left over , not even the "original Windows recovery partition".
Why ?
Because,
It was running every virus known to man and was non-functional. I never refuse a free laptop, especially a newer one that's pretty nice.
If taken literally,
there are, or at one time or another, there have been viruses, that get so deeply "embedded" or into the HD that they essentially destroy it, I would have do some searches to find the specific names, but you can do that as well, but it really does not matter. The main thing, if the HD was not completely wiped, there could have, and probably were "things", still infecting the "original Windows recovery partition", after your "fresh install" it took the "things" a little while, but again they wreck the partitioning, and the system crashes.
Especially with a computer that badly infected, it would be essential to thoroughly "disinfect" it, that means, totally wiping out everything that was on the HD, after that,
Well if it was me, I wouldn't install any "windows", to start with, but you could if you want ,and have good install mediums, ie: DVD or CD, If you had, or used any kind of USB device, on the infected HD, forget that, it probably is infected as well.
Any way after setting up the new partitions, installing the OS's, if the same thing still occurs, my guess is a new HD is needed.
In a nut shell , I do remember reading some where about some viruses, that can and do destroy the HD, and leave it un-repairable, that is to say even a new install will not "cure" it.
I have seen and have some, "used computers" that, as long as no windows is installed
they run perfectly, and keep running just fine, but if and when windows is installed, the go right back to the same "unstable state", that was the reason they ended up in a repair shop, or the dumpster.

Post Reply