0

Have XUbuntu 20.04 and Windows-10 in a duel boot configuration. Both OS working well for about 6 months. Boot default was set to Windows-10. Used MBR rather than EFI for boot (12 yr old motherboard but still had UEFI option). Windows-10 update removed Grub and apparently formatted the boot & other partitions ntfs?

Partition Table

I'd like to get Grub back so I can boot into Windows at least. Should Grub be in the /dev/sda1 partition; which is currently formatted ntfs?

I can boot to a Xubuntu 20.04 DVD and run GParted. If I just try to install Grub I get a "install device isn't specified" error.

When I boot from the XUbuntu DVD I can't find my old Linux partitions. I plan to get a 2nd harddrive & put XUbuntu on that so it doesn't get overwritten again.

Any help would be greatly appreciated!

Results from TestDisk scans of /dev/sda enter image description here

Results from a deeper scan of the Linux partition: enter image description here

Just crawled inside computer & checked. Harddrive is a 1 TB Hitachi mfgd Aug., 2009.

It appears that there are no recovery options available. I don't have a "backup boot sector". I've gone thru the Testdisk documentation and it appears that what I want to do isn't available. That would be to fix the Linux partition EXT4 and add Grub to it. I'm guessing that I can do a clean Linux install from a CD and maybe install Grub there?

Parttitions found on HardDrive

enter image description here

Latest update: I decided to reinstall XUbuntu from the "Live CD"; which is neither live nor a CD. It's the XUbuntu 20.04 boot DVD. The "Live CD" wouldn't pick up a wireless Network, but I plugged in a wire & it worked fine. I selected the custom install option and it picked up & installed to it's previous 142 GB partition. There was no keyboard at boot, thus I had to default to XUbuntu OS. After boot I was able to have some keyboard commands and I did the apt-upgrade & changed my Grub to load Windows. Special characters don't work so I have to access Stack Exchange from a cellphone.

At the Windows-10 boot the PC picked up that it was 86% thru it's update and it completed this. It was then able to boot Windows normally and all my files & data were there.

I'm sure I can eventually get the keyboard working and boot to XUbuntu. My concern is that this not happen in the future again. I think I have 2 options.

  1. Change my boot from MBR to UEFI. This seems a bit complex to do.
  2. Buy a second 2TB HDD and install XUbuntu & all it's data there. MBR would be on drive #1 (1 TB) but the data on drive #2. During a Windows update I could disconnect or protect drive #2. This seems like the easier solution.

I'd like to thank oldfred for his many comments and helpful suggestions. It allowed me to work thru the various recovery methods even tho I wasn't quite able to get GParted, gpart, or TestDisk to recover my Linux partition. The Linux swap partition was unaffected as you can see.

  • What kind of "Windows update" is that? Do you mean an upgrade to Windows 10 from previous (<10) Windows version or a normal update within Windows 10? – cipricus Jun 11 '21 at 13:53

1 Answers1

4

Windows in BIOS mode, is known to update partition table and "forget" to include a Linux logical partition. Data & partition is still there, but you have to update partition table to include ext4 partition and then you can reinstall grub. Without partition grub has nothing to boot.

You can use parted rescue or testdisk

Parted rescue seems easier than testdisk

'Upgraded' to Windows 10 on dual boot, and can't boot to Ubuntu partition

https://www.gnu.org/software/parted/manual/parted.html#rescue

http://www.cgsecurity.org/wiki/TestDisk

Windows 7 to Windows 10 MBR partition missing

http://ubuntuforums.org/showthread.php?t=2288988

http://ubuntuforums.org/showthread.php?t=2290190

oldfred
  • 12,100
  • The command granted rescue gives an error message: "could not start rescue device no such file or directory". Tried running granted in graphical mode: which is how I got pix of partition table. Could not enter rescue mode. – Nicholas Bourbaki Jun 06 '21 at 06:24
  • At the moment cannot boot anything. All computers are down: just have a cell phone. XUbuntu 20.04 boot DVD will boot a desktop but does not have drivers for network card; thus no internet. – Nicholas Bourbaki Jun 06 '21 at 06:27
  • Ran gparted from XUbuntu boot DVD and also GParted 1.1.0 from a GParted boot DVD. It gave an error message: the disk scan did not find any recognizable file systems on the disk. It will create a new Ext4 partition of 135.7 GB in the unallocated partition. That seems to be my only choice. So is the Ubuntu OS unrecoverable? – Nicholas Bourbaki Jun 06 '21 at 06:47
  • 1
    Then try testdisk, if parted rescue not working. It is included on some rescue Linux ISO, but you need network to download into Ubuntu live installer. – oldfred Jun 06 '21 at 14:02
  • There is no network on the XUbutnu 20.04 Live DVD. It apparently does not have a driver for the network card. When I originally set up XUbuntu on this machine, it did install the network which worked. But on the "Live DVD" or booting from a DVD, there is no network driver. I can copy Testdisk onto a USB but it can't be installed as there is no ext4 partition to install it to. – Nicholas Bourbaki Jun 06 '21 at 15:25
  • 1
    If you did not have Internet before you could not have downloaded a driver. So how did you get it to work before? Download a live installer or repair disk that includes testdisk. Not sure which still include testdisk. I always have multiple repair ISO on bootable flash drives, just in case. Once the only one that worked was rEFInd which I had on an old tiny flash drive that was too small for anything else. – oldfred Jun 06 '21 at 17:37
  • Tried a wired connection & that works with my "Live CD" (aka XUbuntu 20.04 boot DVD?). Now to find how to run Testdisk. I have no EXT4 partition so not sure how I can install it. I can borrow my son's laptop occasionally to burn DVD. Otherwise I may have to use GParted on the install disk to format the unallocated partition. – Nicholas Bourbaki Jun 06 '21 at 21:54
  • Okay got the Testdisk program up on the computer. It found one partition, which was my 16 GB flash drive I was using to save logs and notes. I'll update my post with a new photo. – Nicholas Bourbaki Jun 06 '21 at 22:47
  • Second screen should show drives. Does it not see your drive? – oldfred Jun 06 '21 at 23:15
  • No, Testdisk results are the black screen at the bottom-right on my 2nd pix. They show no partitions of any kind found: even under the "Advanced Scan". Other users have reported "blank partition" info on the TestDisk forum and the dev said this indicates a bad disk: use a disk recovery service company. But Ubuntu file mgr (Thunar) can see all the files on my old Windows partition & I'm transferring these files to a backup External Harddrive. I'm reasonably? sure there is no failure of the harddrive. – Nicholas Bourbaki Jun 07 '21 at 20:21
  • 1
    your screen is for sdb, go back one screen & choose sda – oldfred Jun 07 '21 at 21:07
  • Wow, I can't believe I missed that. Reset TestDisk to scan /dev/sda. Still not sure how I can recover my boot sector which apparently holds Grub with it. Apparently the boot sector is NTFS. I'll upload a pix of the DBA partition table soon. – Nicholas Bourbaki Jun 10 '21 at 23:15
  • 1
    IF Boot Sector issue: You want to get to this screen: http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step#NTFS_Boot_sector_recovery [HowTo] Repair the bootsector of a Windows partition - YannBuntu https://help.ubuntu.com/community/BootSectorFix It may say primary is valid as grub in a BS is valid, just not valid in NTFS partitions. If you have to use Rebuild, it may make XP type & you then have to run chkdsk from a newer Windows to convert from XP to newer NTFS version of BS. – oldfred Jun 11 '21 at 03:44
  • Unfortunately after a detailed scan I can't get to that screen. I don't have any "backup boot sector" nor options for it. As you can see from the my recent deep analysis of the Linux partition, it's listed as unrecoverable. – Nicholas Bourbaki Jun 11 '21 at 13:22
  • Then in Disks and upper right corner is Smart Status. It can run lots of tests but all I know is whether it says drive is good or not. – oldfred Jun 11 '21 at 14:13
  • Despite being old (Aug, 2009) I suspect my Hitachi 1 TB HDD is good. As mentioned I was able to get all my data off of the Windows.old directory it created during the Windows-10 update. Ubuntu Live (i.e. the boot DVD) gives me the option to either install Ubuntu or format a partition (presumably EXT4). Should I format the "unallocated" 142 GB partition where I guess my old Linux was or just try for an install? I'd love to know how to install Grub not from the MBR but using the new UEFI system which apparently is less likely to be overwritten by windows. – Nicholas Bourbaki Jun 12 '21 at 16:19
  • You need to convert to gpt partitioning with normally erases drive. There are conversion tools, but good backups required & typically reinstall of grub required. How you boot install media UEFI or BIOS is then how it installs. Remove esp flag from Windows before install to second or external drive - Tim Richardson https://askubuntu.com/questions/16988/how-do-i-install-ubuntu-to-a-usb-key-without-using-startup-disk-creator/1056079#1056079 & https://askubuntu.com/questions/1296065/dual-booting-w10-ubuntu-with-2-separate-ssds-in-uefi-mode/1296153#1296153 – oldfred Jun 12 '21 at 20:19
  • Thanks very much oldfred. I appended to my question above. I now have a fresh install of XUbuntu and have recovered my Windows-10 OS with all the data. I plan to install a 2nd HDD and put XUbuntu on that but keeping my MBR system. If I upgrade my motherboard and have to do a fresh Windows install, then I'll make sure to do the UEFI boot. I mentioned you inthe main question section. – Nicholas Bourbaki Jun 13 '21 at 14:55
  • If second drive is going to be Ubuntu only, I suggest gpt partitioning. The only place the old MBR(msdos) partitioning is required is for BIOS boot of Windows. I used gpt back in 2010 with BIOS only system. Grub2 requires a bios_grub partition 1MB unformatted with bios_grub flag for BIOS boot or ESP - efi system partition FAT32 with esp/boot flags 300 to 500MB. When first converting from BIOS to UEFI system I added both bios_grub & ESP as first two partiitons, only one used depending on boot mode, but then easy to switch, by reinstalling grub. And no major partition conversion. – oldfred Jun 13 '21 at 17:12
  • Okay, that's what I'll do then. The 2nd HDD will be Linux-only. I'll open a new thread if I run into problems with the partitioning. Does this mean both drives must be partitioned GPT? I really don't want to risk wiping out my Windows partition & all it's data and programs. – Nicholas Bourbaki Jun 13 '21 at 20:21
  • No, Windows must have MBR unless you reinstall it in UEFI mode, then it must be gpt. And Windows in BIOS mode reads gpt partitions on another drive, so you still can have a NTFS data partition on new drive. I had XP on MBR & Ubuntu on gpt. And converted all new drives to gpt, even larger flash drives. Once XP was retired, I obsoleted my last MBR drive (converted to gpt). http://askubuntu.com/questions/743095/how-to-prepare-a-disk-on-an-efi-based-pc-for-ubuntu does not show bios_grub, but that is just 1MB unformatted with bios_grub flag. Since unformatted often shown as error in gparted, but ok – oldfred Jun 13 '21 at 22:17