[00:07] <bob5> config table fw_platformsize runtime systab
[00:07] <bob5> efivars fw_vendor runtime-map vars
[00:07] <bob5> sudo parted-l is huge
[00:08] <bob5> partition table is GPT
[00:08] <arraybolt3> OK good.
[00:08] <arraybolt3> That's all I need to know from those.
[00:09] <bob5> the motherboard is set to both UEFI and legacy boot. I tried running it in either of them and it didn't help
[00:09] <bob5> running in both was best as it showed all options in boot menu
[00:09] <arraybolt3> OK.
[00:09] <bob5> the motherboard would detect "ubuntu" but it stayed broken no matter what I did
[00:09] <arraybolt3> What all different operating systems do you have on there?
[00:10] <bob5> only lubuntu now
[00:10] <bob5> I use to have windows lubuntu and mint
[00:10] <bob5> w7*
[00:11] <arraybolt3> Oh OK. You have an EFI partition near the very beginning of the drive, right?
[00:12] <bob5> I just opened a fiel from the partition that was restored from the usb and it works well
[00:12] <bob5> yes I have a 200mb Ext4 sda1
[00:13] <bob5> bios-grub flag is unchecked (checking it didn't fix it before)
[00:13] <arraybolt3> OK. And your BIOS is telling you that it can't find any OS when you try to boot?
[00:13] <bob5> No it lists the HDD and ubuntu as boot options
[00:14] <bob5> after that it would either say cannot read or write outsie hd0 or no OS found or maybe a 3rd options and entering grub rescue mode
[00:14] <arraybolt3> And both options result in an error message about no OS?
[00:14] <bob5> yes I could test it again now but I'm sure I've tried it
[00:14] <arraybolt3> OK! Good to know. Then I think you don't even have to reinstall the bootloader. I think you just need to regenerate the configuration.
[00:14] <arraybolt3> Can you do "ls /mnt" real quick? It should be empty.
[00:14] <bob5> I mean the option would change depending on what I did to try to get it to work
[00:15] <bob5> nothing happened
[00:15] <arraybolt3> That's fine. You're description sounds like the bootloader is working, but can't find the operating systems. This is very easy to fix.
[00:16] <arraybolt3> Good. So, mount your EFI partition using "sudo mount <path to EFI partition> /mnt".
[00:16] <bob5> right now the disk has the following: EFI, unallocated(u) 800mb, Shrinked OS part, u, backup of original size OS part, u, restored shrink OS part
[00:16] <bob5> , u
[00:17] <arraybolt3> That's fine. Just mount the EFI partition.
[00:17] <arraybolt3> (You can use "lsblk" to find your EFI partition.)
[00:18] <bob5> ok /dev/sda1 worked
[00:18] <arraybolt3> OK. Can you tell me the results of "ls /mnt/boot"?
[00:18] <bob5> no such file or dir
[00:18] <arraybolt3> Perfect. Do "sudo mkdir /mnt/boot
[00:19] <arraybolt3> Then do "sudo mkdir /mnt/boot/grub"
[00:20] <arraybolt3> Let me know whenever those are done.
[00:27] <bob5> done
[00:28] <bob5> I'd appreciate for my learning that you tell me what the commands do
[00:28] <arraybolt3> ls tells you the contents of a folder.
[00:29] <arraybolt3> mkdir makes a folder.
[00:29] <arraybolt3> lsblk tells you what block devices (usually disk drives) are in your system.
[00:29] <arraybolt3> So what we're doing right now is creating extra folders in your UEFI partition, where we'll get to put the GRUB configuration.
[00:30] <arraybolt3> This should enable your system to boot.
[00:31] <arraybolt3> OK, so, I'm doing some research, 'cause I'm realizing my setup is a bit weird, and I'd like things to just continue to work as normal for you once this is done. You're still restoring the backup partition, right?
[00:37] <bob5> No the backup partition was restored
[00:37] <bob5> and It works
[00:37] <bob5> so I have both the /home/ folder backup and a partition backup on USBs
[00:38] <bob5> by works I mean I can access and open files from it
[00:38] <arraybolt3> OK. I've almost finished getting the final solution made, hang tight for just a sec...
[00:42] <bob5> I'm going to fix my table I'll be back
[00:43] <arraybolt3> OK. I think I've got everything figured out, I'm doing one final test to be sure, if it works, I'll give you the commands.
[00:52] <arraybolt3> Alright, whenever you're back, I'm ready.
[01:07] <bob5> lol
[01:07] <bob5> rdy
[01:08] <arraybolt3> OK. "sudo grub-mkconfig -o /mnt/boot/grub/grub.cfg"
[01:08] <arraybolt3> That should generate the boot configuration file and enable your system to boot again. We're not quite done yet, though.
[01:10] <bob5> .
[01:11] <bob5>  /usr/sbin/grub-probe: error: failed to get canonical path of '/cow'
[01:11] <arraybolt3> Duh... what? Are you sure you didn't make a typo?
[01:12] <bob5> yeah
[01:13] <bob5> the prior command was sudo mkdir /mnt/boot/grub
[01:13] <arraybolt3> Crud. I've never seen that error before in my life.
[01:14] <arraybolt3> And that command runs perfectly on my system..
[01:15] <arraybolt3> I'm looking up what the error means.
[01:16] <arraybolt3> Oh I see why it's gone berzerk. 
[01:17] <arraybolt3> Hold on, I think I've got the solution. I'm almost there.
[01:21] <arraybolt3> OK, so the error appears to be because grub-mkconfig is getting confused because of our directory setup.
[01:22] <arraybolt3> Can you tell me the "/dev/sd<whatever>" of your main partition?
[01:22] <arraybolt3> It's /dev/sda3 right?
[01:24] <bob5> sda4
[01:24] <arraybolt3> OK. And /dev/sda1 is your EFI partition, correct?
[01:24] <bob5> wouldn't mind booting to sda 2
[01:24] <bob5> yes
[01:24] <arraybolt3> OK. Try this:
[01:25] <arraybolt3> sudo umount /dev/sda1
[01:25] <arraybolt3> sudo mount /dev/sda2 /mnt
[01:25] <bob5> sda1 and sda3 are shrinked versions so I would have to extent them later
[01:25] <arraybolt3> sudo mount /dev/sda1 /mnt/boot/efi
[01:25] <arraybolt3> sudo chroot /mnt
[01:25] <arraybolt3> sudo grub-mkconfig -o /boot/efi/boot/grub/grub.cfg
[01:25] <arraybolt3> exit
[01:26] <arraybolt3> That should get the mounts all in the way that grub-mkconfig wants, and then let it make the config file.
[01:26] <bob5> last command gave sudo: grub: command not found
[01:27] <bob5> oh wait
[01:27] <arraybolt3> Probably did a space rather than a dash
[01:28] <arraybolt3> (You'll notice the new "chroot" command - this gives you a shell that believes the root directory is whatever directory you tell it. This makes it so that grub-mkconfig can find all the files it expects.)
[01:29] <bob5>  /usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).
[01:29] <arraybolt3> How'd it go? Did it print some output about "sourcing configuration files" and "found initrd" and stuff like that?
[01:29] <bob5> no
[01:29] <bob5> just gave what I wrote
[01:30] <bob5> maybe it would be easier to edit mount points in KDE
[01:30] <arraybolt3> Oh I just saw that. Argh, forgot that about chroots...
[01:30] <bob5> nvm
[01:31] <arraybolt3> OK, so type "exit", then do "sudo mount --bind /dev /mnt/dev"
[01:31] <arraybolt3> Then do "sudo chroot /mnt" again.
[01:32] <arraybolt3> Then do "sudo grub-mkconfig -o /boot/efi/boot/grub/grub.cfg" again.
[01:35] <bob5> it's doing lots of stuff now
[01:35] <arraybolt3> That's a good sign!
[01:35] <bob5> cannot find list of partitions
[01:36] <arraybolt3> Hmm. OK, sounds like we need to do another bind mount. Do "exit".
[01:37] <arraybolt3> OK, my research is failing me. Bear with me while I get a test environment set up, this shouldn't take long.
[01:38] <arraybolt3> OK, getting my test stuff booted.
[01:39] <zob> Uploaded file: https://uploads.kiwiirc.com/files/1f8b72e2ccf6de42e9816cc3d2215e23/pasted.txt
[01:41] <arraybolt3> Got it! Here's the command sequence (assuming you did the "exit" already). I'll look at your file first.
[01:41] <arraybolt3> Oh wait, wrong guy's file.
[01:41] <arraybolt3> @bob3 Command sequence:
[01:41] <arraybolt3> @bob5 Command sequence:
[01:41] <arraybolt3> sudo mount --bind /proc /mnt/proc
[01:41] <bob5> no that's also me
[01:41] <arraybolt3> sudo mount --bind /sys /mnt/sys
[01:41] <arraybolt3> sudo chroot /mnt
[01:41] <arraybolt3> grub-mkconfig -o /boot/efi/boot/grub/grub.cfg
[01:41] <arraybolt3> OK, I'll look at it.
[01:42] <zob> got a bunch of fails will give u txt
[01:42] <arraybolt3> Yeah, that's similar to what I saw. The command sequence fixed it, but I'll look at what fails you got this time.
[01:42] <zob> oh wait it did find them
[01:42] <arraybolt3> Do you see "found linux image" in the output?
[01:42] <zob> Uploaded file: https://uploads.kiwiirc.com/files/8cc35c915b38e688efe7df528cf2dbc7/pasted.txt
[01:43] <zob> yes!
[01:43] <arraybolt3> Uh... you may have missed the "sudo mount --bind /proc /mnt/proc" part.
[01:43] <arraybolt3> Do this:
[01:43] <arraybolt3> exit
[01:43] <arraybolt3> sudo mount --bind /proc /mnt/proc
[01:43] <zob> I did miss it
[01:43] <arraybolt3> sudo chroot /mnt
[01:43] <arraybolt3> Now do grub-mkconfig again.
[01:44] <arraybolt3> Upload the results when it's done and I'll tell you if it's good.
[01:44] <zob> shouldn't i do the sys part first?
[01:44] <arraybolt3> If you already did the sys part, you don't need to do it again.
[01:44] <arraybolt3> And it doesn't matter what order you do the "mound --bind" commands in.
[01:45] <arraybolt3> As long as you do them before the chroot.
[01:45] <zob> think we got it
[01:45] <arraybolt3> What's the output look like? (It's probably good.)
[01:45] <zob> now I'll have to delete all but one of the isntalls to not get confused
[01:46] <zob> Uploaded file: https://uploads.kiwiirc.com/files/8ed29f41c21c82d1e8897d80d3716135/pasted.txt
[01:46] <arraybolt3> OK, there's one last step before everything's done.
[01:46] <arraybolt3> Looks good!
[01:46] <zob> When we're done I'd like a summary of what to do in the future for my notes
[01:46] <zob> if it happens again
[01:46] <arraybolt3> Alright, reboot, **remove the live ISO**, and boot into the fixed system.
[01:47] <arraybolt3> And yes, I'd be happy to give you a summary.
[01:48] <bob5> ok when I boot all I get is ubuntu followed by STA xxxxx whatever the drive name is
[01:48] <bob5> dman
[01:48] <arraybolt3> Does selecting an option in the menu do anything?
[01:48] <arraybolt3> Or are you stuck at a "/dev/sdXY clean" something or other prompt?
[01:48] <bob5> ubuntu gave " error file '/boot/grub/i386-pc/normal.mod' not found, entering rescue mode... grub rescue>
[01:49] <bob5> I don't recall if EFI was fresh or was after running boot-repair
[01:49] <arraybolt3> And confusingly, I'm not seing /dev/sda2 as an option to boot from in your grub-mkconfig output.
[01:49] <arraybolt3> Oh, wait, i386-pc : the thing's trying to boot in BIOS mode. Change it to EFI mode and try again.
[01:50] <arraybolt3> We just did a bunch of repairs for EFI, and now it's trying to boot with BIOS - that won't work.
[01:50] <bob5> holy shit I see something for the first time
[01:50] <arraybolt3> Anything good?
[01:50] <bob5> There's an additional bios option for storage boot option control
[01:50] <bob5> it was set to legacy only
[01:50] <arraybolt3> Yep, that's what it looked like.
[01:50] <bob5> noo same error
[01:51] <bob5> I set it to UEFI first
[01:51] <arraybolt3> Even in EFI mode? And the error says "i386-pc" in it?
[01:51] <bob5> yes
[01:51] <arraybolt3> OK, so this part will be interesting. Boot the live ISO again. We're going to do a manual bootloater install. (I've run into this same sort of thing on my systems.)
[01:52] <bob5> What should the mobo do? uefi only?
[01:52] <bob5> I could try uefi only for both options
[01:52] <arraybolt3> Yes, UEFI only. Actually, do that first before booting the live ISO.
[01:52] <arraybolt3> Your system keeps booting a BIOS copy of GRUB, when it needs a UEFI copy for the fixes we did to work.
[01:53] <arraybolt3> Once you've got UEFI only set, reboot without the live ISO.
[01:53] <bob5> reboot and select proper boot device
[01:53] <arraybolt3> Select your hard drive.
[01:53] <bob5> will select it now instead of leaving it to auto
[01:53] <arraybolt3> Do you get a GRUB menu or a desktop?
[01:54] <bob5> only option now is ubuntu and I get same error
[01:54] <bob5> It worked with UEFI before it stopped working
[01:54] <bob5> I had a menu where I could choose lubuntu mint or windows
[01:55] <arraybolt3> Yeah, sounds like something's gone awry with your bootloader. Really, at this point, it might be best to reinstall from scratch, since your system has a LOT of really weird config on it, but if we want to repair it still, we can install the bootloader.
[01:55] <bob5> bootloader is something in the EFI?
[01:55] <arraybolt3> Sorta. It's a mini-OS that your system boots first, and it finds Linux and boots it.
[01:55] <arraybolt3> It should be in your EFI partition.
[01:56] <arraybolt3> (While we're at this, we should change the EFI partition to fat32 - I've never seen an EXT4 EFI partition before, so I wonder if that's part of the problem.)
[01:56] <arraybolt3> OK, so boot into the live ISO. It has everything we need.
[01:57] <arraybolt3> Once you're in the live ISO, open KDE Partition Manager, and reformat the EFI partition to fat32. Make sure to set the "boot" flag on it when you do that.
[01:59] <bob5> the thing about KDE is the only flag option is "bios-grub"
[01:59] <arraybolt3> Hmm, that's odd. You're right-clicking the EFI partition, clicking Reformat, and selecting "fat32", right?
[01:59] <bob5> Buit I can download gnome-disk-utility
[02:00] <arraybolt3> Ugh, that's awful. Use "GParted". "sudo apt install gparted"
[02:00] <arraybolt3> I mean, if you're used to gnome-disk-utility, do whatever works for you, I just find it confusing and easy to make mistakes in.
[02:03] <bob5> where do I find this irc channel?
[02:04] <arraybolt3> https://lubuntu.me/links/
[02:04] <arraybolt3> It's near the top of the page.
[02:04] <bob5> it's not lubuntu.net or lubuntu.me
[02:04] <arraybolt3> Lubuntu.me.
[02:05] <bob5> got it
[02:05] <arraybolt3> Lubuntu.net is an unofficial site that the Lubuntu devs have tried to get taken down. There's a whole fight over it in a bug report.
[02:05] <bob5> is it malicious?
[02:05] <arraybolt3> Dunno, but it's incorrect for sure.
[02:06] <zob> libparted error: the backup gpt table is corrupt, but the primary appears OK so that will be used
[02:06] <arraybolt3> I think some former Lubuntu guy made it, and then when he left the team, he didn't let the site down. I could be wrong (probably someone else in this channel has better details)
[02:06] <zob> I remember I checked these before and only the header was corrupted
[02:06] <zob> then after restoring header from ehader backup all were good
[02:06] <arraybolt3> Oy! That's... possibly part of your problem.
[02:06] <zob> both aprtition priamry and backup were always good
[02:06] <zob> so this is news
[02:06] <arraybolt3> I'm guessing you've been messing with this system's partitions a lot?
[02:07] <zob> a lot
[02:07] <zob> I didn't save my instructions to fix this
[02:07] <arraybolt3> Yeah, it *might* be fixable at this point, but you have plenty of backups. I'd recommend reinstalling from scratch and then restoring from one of your home backups. That will be far more effective and probably much faster than any repair we can do at this point.
[02:09] <arraybolt3> Also, if you like messing with new operating systems like I do, you should look into virtualization. Once you're system is working again, do "sudo apt install virt-manager" and enjoy.
[02:09] <zob> If I overwrite the new install aprtition with the backup, will it work?
[02:09] <zob> no I had another use case
[02:09] <arraybolt3> No, erase disk and install Lubuntu. If your apps don't work, we can mess with the partition backups, but otherwise, erasing the whole disk is the best bet (we need to fix that partition table error you got earlier)
[02:10] <arraybolt3> (and just overwriting a partition probably won't fix it, but erasing the disk should)
[02:10] <arraybolt3> (Also, anything involving multiple operating systems is leaps and bounds easier using virt-manager. It allows you to split one system into multiple virtual computers, each running its own OS. You can run two, three, or more operating systems at the same time using it.)
[02:11] <zob> I'm aware but I only need 1 os
[02:11] <arraybolt3> oh OK.
[02:11] <zob> I was able to fix and verify that partition and header were fixed before
[02:12] <zob> so shouldn't I do this instead
[02:12] <zob> it sounds to me like you said onyl way to fix partition table is to wipe and reinstall
[02:12] <arraybolt3> The problem is, something got your partition table messed up, and I don't know what. Trying to repair something that's this scrambled *might* work, but it's not as safe as just starting afresh. You'll still have your home backups to make your apps work.
[02:13] <zob> hey it says the backup is fine
[02:13] <zob> so just copy backup to primary
[02:14] <zob> err backup is corrupt but primary ok*
[02:15] <bob5> going to use this https://www.rodsbooks.com/gdisk/repairing.html
[02:15] <arraybolt3> I've never messed with partition table backups before, so I don't know what it's going to do. You probably know more than I do about this particular part of what you're doing.
[02:16] <bob5> It's start with checking the status here if ur curious https://askubuntu.com/questions/386752/fixing-corrupt-backup-gpt-table
[02:19] <zob> oh got it's worse than last time
[02:19] <zob> Uploaded file: https://uploads.kiwiirc.com/files/27c3da25203d1bdf9d244d08d8338a36/pasted.txt
[02:19] <zob> going to put this here for posterity
[02:19] <zob> It was all fixed before we talked...
[02:20] <arraybolt3> That's really odd, because nothing that we did should have messed with the partition table... except for your copying the backup partition, but that doesn't seem like something that would do **this**.
[02:20] <arraybolt3> I wonder if your main hard drive is failing. What brand is it and how long have you been using it?
[02:29] <arraybolt3> @zob @bob5 Well, I hate to say it, but I have to go. I probably won't be on again for most of tomorrow, but if we run into each other again, I'd be happy to offer what help I can!
[02:30] <zob> Uploaded file: https://uploads.kiwiirc.com/files/a91cf09b6da472dc0c00750f4ba4b579/pasted.txt
[02:30] <zob> fixed it
[02:30] <zob> it's seagate and I thought about this too now :(
[02:35] <bob5> I'll try a fresh wipe and install in the meantime
[02:42] <bob5> https://askubuntu.com/questions/386752/fixing-corrupt-backup-gpt-table
[02:45] <bob5> manual recovery:
[02:45] <bob5> sudo mount --bind /proc /mnt/proc
[02:45] <bob5> sudo mount --bind /sys /mnt/sys
[02:45] <bob5> sudo chroot /mnt
[02:45] <bob5> grub-mkconfig -o /boot/efi/boot/grub/grub.cfg
[02:46] <bob5> ls /mnt
[02:47] <bob5> sudo mkdir /mnt/boot
[02:47] <bob5> sudo mkdir /mnt/boot/grub
[02:47] <bob5> sudo grub-mkconfig -o /mnt/boot/grub/grub.cfg
[02:54] <bob5> sudo umount /dev/sda1
[02:54] <bob5> sudo mount /dev/sda2 /mnt
[02:54] <bob5> sudo mount /dev/sda1 /mnt/boot/efi
[02:54] <bob5> sudo chroot /mnt
[02:55] <bob5> sudo grub-mkconfig -o /boot/efi/boot/grub/grub.cfg
[02:55] <zob> sudo mount /dev/sda1 /mnt/boot/efi
[03:00] <zob> oh I give up
[03:24] <bob5> it could be an usntable psu...
[15:41] <bob58> Any experts in remote hacking BIOS?
[15:47] <tomreyn> bob58: wrong channel
[15:47] <tomreyn> !topic