Can't start Ubuntu after Windows update in a dual boot system

shardik

New Member
Joined
Dec 28, 2019
Messages
9
Reaction score
2
Credits
0
I have a pc with dual-boot win10 / ubuntu 18.04
After a Windows update, i can't start Ubuntu, Grub starts in command-line mode.

I start pc with a live version of Ubuntu and these are my attempts:

Code:
fdisk -l /dev/sda

Disk /dev/sda: 489.1 GiB, 525112713216 bytes, 1025610768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: BABB2881-5183-4807-8EFE-742DB838FF71

Device          Start        End   Sectors   Size Type
/dev/sda1        2048    1023999   1021952   499M Windows recovery environment
/dev/sda2     1024000    1228799    204800   100M EFI System
/dev/sda3     1228800    1261567     32768    16M Microsoft reserved
/dev/sda4     1261568  684606850 683345283 325.9G Microsoft basic data
/dev/sda5   684607488  685764607   1157120   565M Windows recovery environment
/dev/sda6   685766656 1002174463 316407808 150.9G Linux filesystem
/dev/sda7  1002174464 1025609727  23435264  11.2G Linux swap

The partition seems to be recognized, but if i try to mount:

Code:
sudo mount /dev/sda6 partition

mount: /home/ubuntu/partition: wrong fs type, bad option, bad superblock on /dev/sda6, missing codepage or helper program, or other error.

I tried to check and fix with fsck:

Code:
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a gpt partition table in /dev/sda

and tried to restore superblock from all alternate superblocks given by e2fsck command with -n option. No good results.

Is there hope to restart my Ubuntu or the only solution is to re-install the system?

Thanks for your time and suggestions
 


right... take into account brain is fussy with vino.
fsck to my knowledge won't fix efi because for first its not any ext2, 3 nor four , EF00 type i believe.

whats happened i think is that basically windows has overwritten the EFI . You don't need to re-install ubuntu just get grub updated. In theory if you have Windows 10 you could install Windows Linux subset. or try from the ubuntu live

probably grub update is s located /usr/sbin/update-grub


you might be able to do something like :
sudo chroot /usr/sbin/update-grub

that would run the update-grub as if you had it booted up and evoked the command.


with mount it should be something like : mount <what you want to mount> <where you are going to mount it>


with slackwarei have a /mnt dir not sure what ubuntu has.
 
Last edited:
Thank you for your reply.

I'm not sure I understand the meaning of your command, but this is the output:

Code:
sudo chroot /usr/sbin/update-grub

chroot: cannot change root directory to '/usr/sbin/update-grub': Not a directory

I would like to launch update-grub after setting root in /dev/sda6, but i can't mount it:

Code:
sudo mount /dev/sda6 /mnt/disk

mount: /mnt/disk: wrong fs type, bad option, bad superblock on /dev/sda6, missing codepage or helper program, or other error.

The problem, i think, is that that the file system of the linux partition is damaged. This is the output of the parted command:

Code:
sudo parted -l /dev/sda

Model: ATA Crucial_CT525MX3 (scsi)
Disk /dev/sda: 525GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  524MB  523MB   ntfs         Basic data partition          hidden, diag
 2      524MB   629MB  105MB   fat32        EFI system partition          boot, esp
 3      629MB   646MB  16.8MB               Microsoft reserved partition  msftres
 4      646MB   351GB  350GB   ntfs         Basic data partition          msftdata
 5      351GB   351GB  592MB   ntfs                                       hidden, diag
 6      351GB   513GB  162GB
 7      513GB   525GB  12.0GB

No file system is reported for last two partition (these are the linux partitions)

thanks
 
i will have to play tomorrow regarding chroot and will do this from knoppix. Haven't done in a while

i can see output but not the exact commands you used.
If i were to try to fix /dev/sda6 from either live usb or other.

First probably see what file systems are :

#df -T

or try

# mount | grep "^/dev"


//maybe see what fsck is available : # ls /usr/sbin | grep fsck*

First unmount it anyway you like

//running fsck on a mounted partition can do damage !


or # umount /dev/sda6

then fsck /dev/sda6 -v -y
-v verbose
-y takes yes to any question fsck brings up


did you just do fsck /dev/sda ? because bad block just might mean fsck can't see a linux file system
 
The problem is that /dev/sda6 (the linux partition) is unmountable. This the output:

Code:
> sudo mount /dev/sda6 /mnt/disk

mount: /mnt/disk: wrong fs type, bad option, bad superblock on /dev/sda6, missing codepage or helper program, or other error.

and fsck also can do nothing:

Code:
> fsck /dev/sda6 -v -y

fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda6

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>
 
when i was in Ghana, Africa for 6months i had slackware on a PC tower. Electricity went off without notice while pc was running some program or other. running fsck.ext4 never failed to fix it. Not sure with yours

with ext4 there are programs that can recover files back to what they were, but looks like your file system is ext2.


unless veteran Ubuntu users come forward its not looking good. Maybe though the computer god in the sky is saying you never wanted that Ubuntu in the first place, what you really want is Slackware !
 
oh by the way i had a play with chroot to remind myself( i've forgotten more than i know now) So i booted knoppix 8.6 from usb stick attached to my laptop with slackware.

I mounted my slackware installation /dev/sda3 to /media/sda3 on knoppix .i then just did
went from user knoppix to root user knoppix using "su"
then # chroot /media/sda3

i then did
#liloconfig

this brought up small gui to setup lilo. I know this evoked /usr/sbin/lilo script because lilo is on slackware as bootloader but not on knoppix. if you could have mounted your ubuntu partition you could have run # update-grub or even #grub install
 
Thank you very much for your time, but unfortunately, as I wrote in previous reply, I can't mount the partition, and therefore not even use chroot command
 
yes but its not the end of the world that you can't mount it. There are other approaches and the Hobson's choice is probably this :

1) get , but read up a ,lot to use software such as TestDisk
2) Go for re-install


What happends if you run sudo testdisk from live ubuntu ?


So fsck as you know works on partition most of the time on none mounted partitions.
If the ext2/ext3/ext4 primary superblock is damaged, the filesystem cannot be mounted.
fsck misses copies of superblock that are present in filesystem, which could save you

Testdisk can find the data you need : https://www.cgsecurity.org/wiki/TestDisk

I got mine for knoppix on usb with overlay using
apt search testdisk
apt install ..

i've got this on knoppix and why i always suggest everyone get it on a usb ;its the swizz army knife for a lot of issues. what it doesn't have as default you can install other useful stuff eg fsarchiver.

So you could eg run testdisk advanced and choose superblock
from menu .

if TestDisk say finds a superblock at block number 24577 and a blocksize of 1024 bytes, then tell fsck manually what to do as follows

fsck -b 24577 -B 1024 /dev/sda6
 
Hi, after a few days I managed to do some tests with testdisk.

This is the result of the analyses:

Code:
Disk /dev/sda - 525 GB / 489 GiB - CHS 63841 255 63
Current partition structure:
     Partition                  Start        End    Size in sectors

 1 P Unknown                     2048    1023999    1021952 [Basic data partition]
 2 P EFI System               1024000    1228799     204800 [EFI system partition]
No FAT, NTFS, ext2, JFS, Reiser, cramfs or XFS marker
 3 P MS Reserved              1228800    1261567      32768 [Microsoft reserved partition]
 3 P MS Reserved              1228800    1261567      32768 [Microsoft reserved partition]
 4 P MS Data                  1261568  684606850  683345283 [Basic data partition]
 5 P Unknown                684607488  685764607    1157120
 6 P Unknown                685766656 1002174463  316407808
 7 P Linux Swap            1002174464 1025609727   23435264

I tried to make a quick search. This is the result:

Code:
Disk /dev/sda - 525 GB / 489 GiB - CHS 63841 255 63
     Partition               Start        End    Size in sectors
>P MS Data                     2048    1023999    1021952
 P MS Data                  1024000    1228799     204800 [NO NAME]
 D MS Data                  1261568  684606850  683345283
 D MS Data                683450369  684607488    1157120
 D MS Data                684607488  685764607    1157120

Structure: Ok.  Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
                P=Primary  D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
     Enter: to continue
NTFS, blocksize=4096, 523 MB / 499 MiB

So i tried a deep search, and the result confused me:

Code:
TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <[email protected]>
http://www.cgsecurity.org

Disk /dev/sda - 525 GB / 489 GiB - CHS 63841 255 63
     Partition               Start        End    Size in sectors
>D MS Data                     2048    1023999    1021952
 D MS Data                  1023999    2045950    1021952
 D MS Data                  1024000    1228799     204800 [NO NAME]
 D MS Data                  1024006    1228805     204800 [NO NAME]
 D MS Data                  1261568  684606850  683345283
 D MS Data                  1555424    1558303       2880 [EFISECTOR]
 D MS Data                  6961760    6964639       2880 [EFISECTOR]
 D MS Data                 12475579   12481752       6174
 D MS Data                 12481752   12487925       6174 [Boot]
 D MS Data                 14127968   14130847       2880 [EFISECTOR]
 D MS Data                 14274592   14277471       2880 [EFISECTOR]
 D MS Data                 16182976   16185855       2880 [EFISECTOR]
 D MS Data                 23110800   23113679       2880 [EFISECTOR]
 D MS Data                 23916160  707261442  683345283
 D MS Data                 45546528   45549407       2880 [EFISECTOR]
 D MS Data                 46275387   46281560       6174
 D MS Data                 46281560   46287733       6174 [Boot]
 D MS Data                 67216755   67222928       6174
 D MS Data                 67222928   67229101       6174 [Boot]
 D MS Data                 73074707   73080880       6174
 D MS Data                 73080880   73087053       6174 [Boot]
 D MS Data                 75599968   75602847       2880 [EFISECTOR]
 D MS Data                102349619  102355792       6174
 D MS Data                102355792  102361965       6174 [Boot]
 D MS Data                104781363  104787536       6174
 D MS Data                104787536  104793709       6174 [Boot]
 D Mac HFS                142773967  142774128        162
 D Mac HFS                142774125  142774286        162
 D MS Data                145315344  145318223       2880 [EFISECTOR]
 D MS Data                145385427  145391600       6174
 D MS Data                145391600  145397773       6174
 D MS Data                148890313  150262296    1371984 [GWM-9M-$ث݊M-= b~^dS
 D MS Data                148890314  150262297    1371984 [GWM-9M-$ث݊M-= b~^dS
 D MS Data                160583571  160589744       6174
 D MS Data                160589744  160595917       6174 [Boot]
 D MS Data                176645924  176650595       4672 [NO NAME]
 D MS Data                201857747  201863920       6174
 D MS Data                201863920  201870093       6174 [Boot]
 D MS Data                219972659  219978832       6174
 D MS Data                219978832  219985005       6174
 D MS Data                222398840  222401719       2880 [EFISECTOR]
 D MS Data                235237944  235240823       2880 [EFISECTOR]
 D MS Data                235240824  235243703       2880 [EFISECTOR]
 D MS Data                324412416  324415295       2880 [EFISECTOR]
 D MS Data                341189331  341195504       6174
 D MS Data                341195504  341201677       6174
 D MS Data                342719896  342722775       2880 [EFISECTOR]
 D MS Data                342719960  342722839       2880 [EFISECTOR]
 D MS Data                354116123  354122296       6174
 D MS Data                354122296  354128469       6174
 D MS Data                377343600  377346479       2880 [EFISECTOR]
 D MS Data                522122080  522124959       2880 [EFISECTOR]
 D MS Data                522212192  522215071       2880 [EFISECTOR]
 D MS Data                533166299  533172472       6174
 D MS Data                533172472  533178645       6174
 D MS Data                683450369  684607488    1157120
 D MS Data                684607488  685764607    1157120
 D MS Data                684933667  684939840       6174
 D MS Data                684939840  684946013       6174 [Boot]
>D MS Data                685764607  686921726    1157120
Structure: Ok.  Use Up/Down Arrow keys to select partition.

I don't know what i can do now....
 
try this :

# dumpe2fs /dev/sda6 | grep superblock
(/dev/sda6 should be unmounted) -which i guess its still unmountable anyway


then does it show any backup superblock that makes sense matching numbers below ?



if you get output of: Backup superblock at <somenumber>

try that eg as


e2fsck -b 8193 /dev/sda6
e2fsck -b 32768 /dev/sda6

where 8193 and 32768 might be in the output of :
# dumpe2fs /dev/sda6 | grep superblock
 
Last edited:
Thank you. I tried to execute the command but unfortunately it can't help me. This is the response:
Code:
dumpe2fs 1.44.1 (24-Mar-2018)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sda6
Couldn't find valid filesystem superblock.
 
ahh that doesn't look good it suggests there are NO copies of super block ; unless those that know ubuntu come forward then i think your install is toast. Also the test says /dev/sda6 is "unknown"

However on the bright side there are a few commands i have forgotten about and you now know :^)

/dev/sda2 seems about right the right size and and EFI for uefi booting .Windows seems very greedy with all the partitions it takes up .

i think i going to be a case of 1) re-install
2) what
3) back on with Windows or an another dedicated HD
 
Yes, Windows starts correctly without problem.
I also think that the only solution is reinstall linux.
Thanks a lot for your time.
 
Yes, Windows starts correctly without problem.
I also think that the only solution is reinstall linux.
Thanks a lot for your time.
I don't think re-installing Linux won't solve the problem.

I read a long time ago that Windows updates break the Grub bootloader with dual boot systems.


Did you have a power outage or a not so graceful shutdown?
 
No, the problem appeared after a major update of Windows.
I used dual boot since Windows 2000, first with LILO as boot loader and later with GRUB.
I don't remember a time when i can't restore boot loader after that Windows broke it (e.g. after a Windows re-installation).
This time seems that Windows has damaged the partition.
I tried also with r-tools to read some data from the linux partition, but seems unreadable.
 
No, the problem appeared after a major update of Windows.
I used dual boot since Windows 2000, first with LILO as boot loader and later with GRUB.
I don't remember a time when i can't restore boot loader after that Windows broke it (e.g. after a Windows re-installation).
This time seems that Windows has damaged the partition.
I tried also with r-tools to read some data from the linux partition, but seems unreadable.
After reading through the whole thread a second time it sounds like ......
/dev/sda6 685766656 1002174463 316407808 150.9G Linux filesystem is corrupt.

Is Grub starting in command-line mode only?
 
If Grub repair doesn't work than unfortunately you'll have to delete your Ubuntu partition and do a fresh installation. You can use the partition manager that comes with Ubuntu to delete the old partition and than just create a new partition from that free space.

Shame that the Windows update damaged the partition.
 
Yes, i lost hope to restore my installation, i'll do a fresh one.

Shame that the Windows update damaged the partition.
Agree :mad:

Thank you all for your time and your replies
 

Members online


Top