Broken computer recovery


TeDaDeS

Advanced Member
Joined
Jan 15, 2004
Messages
1,070
Location
The Netherlands
Website
Visit site
Hi everyone!

My computer recently 'broke' as it won't boot anymore.
I have/had a dual-boot system with Ubuntu (Linux) and Windows 10, located on a single disk with multiple partitions.

Recently Windows 10 had a big update that needed to be installed (because windows updates never cause issues, so it's safe to install /s).
So during the patch install it automatically restarts multiple times, which would automatically boot back into Linux if I didn't intervene, and the second reboot gave me this nice grub2 message:

error: no such partition.
Entering rescue mode...
grub rescue> _

My first thought was: Win10 has overwritten the MBR, and restoring Grub2 via a live-CD/USB would solve my issue.
But I can't mount my Ubuntu partition, as it's mentioned to be unallocated space.
My hypothesis would be: "The Windows 10 update changed something in the partitioning of my disk, possibly claiming a part of my Ubuntu partition."
I want to recover my partition, restore Grub2, finished my 'very important' Windows 10 update, and start using my computer again.

This topic has been started to show my progress, in case others run into the same issue.
And you can give your opinion and insights in what I'm doing.
 

PowerGod

Hardcore Member
Joined
Jun 20, 2011
Messages
3,612
This saved my dualboot PC once, it can detect installed OSes and run them, then you can restore your main bootloader.

 

TeDaDeS

Advanced Member
Joined
Jan 15, 2004
Messages
1,070
Location
The Netherlands
Website
Visit site
First plan:
1. Create a fresh up-to-date recovery bootable Ubuntu live-USB (as booting from DVD is slow, and it's Unbuntu 16 which is not the latest): ->Done (I'm posting from it right now)
2. Create a second back-up live-USB, because I'm probably going to lose the first after a while: -> Todo (I got 2 USB-sticks to do this, but it's more for future issues)
3. Get a disk ready to create a back-up/clone of the original disk, as I might break it during recovery: -> Done (used ccrescue)
4. Find a way to recover the Linux partition, the Windows one appears to be intact: -> Done (used Testdisk)
5. Recover Grub2: -> Busy (Reinstalled Grub2)
6. Complete Windows 10 update: -> Done
7. Possibly recover Grub2 again: -> Todo
8. If no other issues, celebrate everything working again: -> Todo

Some more computer info:

Current partition scheme of disk:
Samsung SSD 750 EVO 250GB
/dev/sda1 - NTFS - 105MB
/dev/sda2 - NTFS - 165GB
/dev/sda3 - NTFS - 551MB
/dev/sda - Unallocated - 2.1MB
/dev/sda4 - Extended partition - 84GB
-- /dev/sda - Unallocated - 83GB (Was Unbuntu, EXT4 I think)
-- /dev/sda5 - Swap - 1GB
/dev/sda - Unallocated - 473MB
 
Last edited:

Elw3

ƐʍlƎ
Joined
Aug 10, 2010
Messages
1,410
Afaik even windows isnt dumb enough to touch partitions during updates so there is a chance that this isnt even its fault. You should check your ssd health (with gsmartcontrol) to see if something fishy is going on. And if there is, copy the disk instantly.
Try to install grub first before trying to mount the partition, the grub installer has quite the good detecting system.
If you have to reinstall: Get rid of the swap and make the linux partition a primary, extended always cause problems.
 

TeDaDeS

Advanced Member
Joined
Jan 15, 2004
Messages
1,070
Location
The Netherlands
Website
Visit site
I tried installing Clonezilla onto my 3rd USB stick. The second USB-stick is now prepared with Super Grub2 Disk (which uEFI complaint about when I tried booting this, but that's for later).

Clonezilla needs an iso-file, but afterwards needs to be made bootable.
I used Unetbootin to create the Clonezilla USB-boot, but it required the disk to be a different filesystem (FAT) before it was detected.
Have to try this USB-stick out, but I'll do that later as it requires a restart.

Afaik even windows isnt dumb enough to touch partitions during updates so there is a chance that this isnt even its fault. You should check your ssd health (with gsmartcontrol) to see if something fishy is going on. And if there is, copy the disk instantly.
Agreed. I already checked SMART status, it showed everything was fine except it once recovered from a bad-sector. The disk isn't that old, so it's suspicious.

-I've fixed the repository links, one was broken so it couldn't search for applications-
The Ubuntu 20 live-USB didn't have gsmartcontrol already installed. So it should been easy to install, but apt-get and package manager both state they don't know this tool.
I downloaded it manually (.deb) but it has dependencies to xterm and menu, those can't be resolved. Also this version of Ubuntu open's .deb as an archive instead of a package, so you need to manually select the package manager to open it (or use sudo apt install <file> which I eventually used as it can handle dependencies).
-after fix-
I installed gsmartcontrol from package manager (ubuntu software) and it states all tests are PASSED. I ran a quick self-test from the tool and it also ran fine.

----
Clonezilla still doesn't boot. Maybe it's the USB-stick type, its different from the other two.

----
For some reason one of the USB-sticks just boots, while the other ones (even the same type one) the SSD is preferred by the BIOS.
So manually selecting the USB-stick from BIOS appears to work.
Now I can boot Clonezilla. I would have started cloning already if I didn't have identical disks in my computer, as I can't see which one is the original and which one is the empty one.
I'll note the serialnumber etc. before I start Clonezilla again.

----
I ran CloneZilla, but I think it only copied the partitions it had seen not the unallocated one with my Linux data.

----
I downloaded TestDisk and ran it agains my drive, it sees my Linux and Home partition (hurray!?).
Now I'll check if I can do an actually copy of the unallocated space to, before changing my primary drive.

----
For copying a broken disk you can use ddrescue. It's like dd but it has some features that are beneficial when copying a disk with bad sectors:

I ran:

sudo add-apt-repository universe
sudo apt update
sudo apt install gddrescue
sudo /ddrescue -f -r3 /dev/sda /dev/sdc /home/ubuntu/mapfile

( sda = original-disk, sdc = copy-disk, obviously you need to adapt those to your situation if you like to run this command on your system. Also it directly starts and overwrites the content of the copy-disk if there is any present. This might take a few minutes depending on your drives speed, mine was 250GB at ~440MB/s so roughly 10minutes.)

----
I ran testdisk against the copied disk, it shows the partitions are recoverable. So ddrescue did copy all the files compared to Clonezilla.

I ran testdisk against my original disk, it also shows the missing partitions. But when I try to recover them it tells me the structure is bad.
So I restarted testdisk and before analyzing in options I set 'align partition' to No. Now everything is green by default, checked if files can be viewed (they can) and wrote changes to disk.

----
Via the Ubuntu live-USB I ran the following commands to try to recover Grub2:

sudo mount /dev/sda5 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/sda5

But this gave an error message:
error: will not proceed with blocklists.

So I ran this:
grub-install --root-directory=/mnt /dev/sda
 
Last edited:

TeDaDeS

Advanced Member
Joined
Jan 15, 2004
Messages
1,070
Location
The Netherlands
Website
Visit site
Not done yet. But I'm posting from my own Ubuntu install, so looks like at least I haven't lost my Linux partition with my files.

----
Ran:
sudo update-grub

----
Now it starts Grub, but doesn't link to any OS.
I just typed: exit
And it boots into the original Grub2 menu which is working.
Now have to find out where both Grub's are located so I can just use the one.
Otherwise my disk appears to be working again.
 
Last edited:
Top