View previous topic :: View next topic |
Author |
Message |
D-Dub n00b
Joined: 19 Jan 2019 Posts: 6 Location: U.S.
|
Posted: Sat Jan 19, 2019 8:42 pm Post subject: Day 4 of Humbling Experiences. Need advice or direction. |
|
|
Good morning,
Here is a little history on how this week has gone:
The past few days I have made an effort to get Gentoo installed on my laptop. I wasn't so much interested in just acquiring a completed version, so I sat down to give the Stage 3 installation a try (Also taking a Linux class this semester, so I figured i'd be more full-immersion). Before class, between classes, after classes until bed I have followed through the guide with diligence, doing my best to look up information that I did not quite understand... and to be quite honest, aside from countless manual pages and documentation, the Gentoo forums has been a great help in giving me a better understanding. I was hoping I wouldn't have to create an account, but I seem to have hit a barrier and I'm not sure where to search. Just too many variables.
My first attempt at installing took roughly three days as I have been quite busy. But with PuTTY and my desktop monitors, reading documentation and following instructions were a breeze. I made it all the way to the installation of Grub(2) until I thought I came to a dead end and decided to restart the installation.
Along the SECOND attempt, I realized so many mistakes that I made from the first attempt and felt rather confident. I payed more attention to what I was doing, taking advice that a site admin from here gave to someone else... I decided to keep everything as minimal and simple as possible when it comes to profiles at user options... just to get it running and just build from there.
Double-Checking my entries, reading new items... Understanding and sticking to my partition table choice I reached the same Grub2 error.
Sitting here I began seeking alternatives to Grub... Trying to find SOME clue. Digging through the Gentoo Cheat Sheet I decided to Upgrade all packages:
Code: | emerge -uDU --keep-going --with-bdeps=y @world |
After an hour or so it finally completed... and it worked! I didn't have any important notifications of outdated packages (mainly involving some autounmask). Grub2 worked and I was able to make it all the way to the last line of the Handbook!
The moment of truth, fingers crossed... I went to reboot and Intel Boot Agent greeted me with a disappointing screen. I'll get into it further, soon as I get this post more organized.
I've gathered as much information as I could prior to writing this post, and I am able to pull any information that could give a better understanding, but I was curious if someone could look over where I've gotten and maybe give a clue as to where I went wrong.
My System (Lenovo ThinkPad T470):
Integrated Graphics (Intel HD Graphics 620)
Bios Settings:
Partition Table Choice/Early decisions:
4 Partitions: BIOS / Boot / Swap / Root
multilib - Default Desktop Profile
For the next part I'll post some common config files that might provide some information. Unsure of what should or shouldn't be posted, I'll put <ID> in it's place:
blkid:
Code: | /dev/loop0: TYPE="squashfs"
/dev/sda1: PARTLABEL="grub" PARTUUID="<ID>"
/dev/sda2: UUID="<ID>" TYPE="ext2" PARTLABEL="boot" PARTUUID="<ID>"
/dev/sda3: UUID="<ID>" TYPE="swap" PARTLABEL="swap" PARTUUID="<ID>"
/dev/sda4: UUID="<ID>" TYPE="ext4" PARTLABEL="rootfs" PARTUUID="<ID>"
/dev/sdc1: LABEL="GENTOO AMD6" UUID="<ADDRESS>" TYPE="vfat" PARTUUID="<ID>" |
List of Partitions:
Code: | Device Start End Sectors Size Type
/dev/sda1 2048 6143 4096 2M BIOS boot
/dev/sda2 6144 268287 262144 128M Linux filesystem
/dev/sda3 268288 4462591 4194304 2G Linux filesystem
/dev/sda4 4462592 351649839 347187248 165.6G Linux filesystem |
fstab:
Code: | /dev/sda2 /boot ext2 defaults,noatime 0 2
/dev/sda3 none swap sw 0 0
/dev/sda4 / ext4 noatime 0 1 |
make.conf:
Code: | COMMON_FLAGS="-march=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
MAKEOPTS="-j1"
GENTOO_MIRRORS="https://gentoo.osuosl.org/ http://gentoo.osuosl.org/ https://mirror.sjc02.svwh.net/gentoo/ http://mirror.sjc02.svwh.net/gentoo/ http://gentoo.mirrors.tds.net/gentoo" |
/etc/conf.d/net:
Code: | config_enp0s31f6="dhcp" |
rc.conf:
Code: | unicode="YES"
rc_tty_number=12 |
---------------------------------
Steps skipped or not existing:
Code: | root #mkdir -p /etc/modules-load.d
root #nano -w /etc/modules-load.d/network.conf |
No Longer Existing:
/boot/ directory
/boot/grub/grub.cfg
Mounting and unmounting steps were followed as per the Handbook.
Boot behavior (depending on boot order):
Will not boot from HDD0 (SSD)
All that is displayed is: Intel Boot Agent... MAC ADDR: <ADDRESS> GUUID: <ID> and DHCP that just hangs. (I'm assuming because it is not communicating with or finding anything on Hard drive.
WHEW....
If there is any more information I could provide, please let me know. I am just unsure of where to begin my troubleshooting as I am still learning commands. I was really hoping it wouldn't come to this. I hate not being able to follow a simple handbook, but I'll accept this loss.
Thank you! |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Sat Jan 19, 2019 9:27 pm Post subject: |
|
|
D-Dub,
Welcome to Gentoo.
There are no failed Gentoo installs but you can have varing degrees of success. Learning is a success.
You say you have Secure Boot Off and Legacy Mode in your BIOS, then go on to say
Partition Table Choice/Early decisions: GPT + BIOs
GPT and Legacy mode don't always mix well.
What does Code: | fdisk -l -t dos /dev/sda | tell ?
I get Code: | # fdisk -l -t dos /dev/sda
Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HGST HDN726040AL
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 1 4294967295 4294967295 2T ee GPT
Partition 1 does not start on physical sector boundary. |
The important part here is the Code: | Device Boot Start End Sectors Size Id Type
/dev/sda1 * 1 4294967295 4294967295 2T ee GPT |
This is the protective msdos partition table that says that GPT is in use.
As you have selected Legacy and GPT you may need to set the bootable flag here for your system to detect that the HDD is bootable.
There are a few mix and match rules.
Legacy with MSDOS partition table. Works
Legacy with GPT. Mostly works. Broken on some Dells. May need extra steps.
UEFI with MSDOS partition table. Not possible.
UEFI with GPT partition table. Works _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
D-Dub n00b
Joined: 19 Jan 2019 Posts: 6 Location: U.S.
|
Posted: Sat Jan 19, 2019 9:44 pm Post subject: |
|
|
NeddySeagoon,
Thank you so much for your reply. You have definitely restored my mood with this installation. At first, I did not explore fdisk (as the Handbook explained how it can be dicey when handling GPT). running the code you provided, I see that it is in fact not marked with a "*" under boot.
When dealing with partitions, is it safe to say that I will most likely be starting over again? I don't mind doing so, I am just unsure at which points within the Handbook is it safe to redo (Aside from mounting root and chrooting).
I also noticed upon chrooting back in again, I appear to have absolutely no trace of grub or really any indication that shows it is still... present?
Again, I appreciate your response. I'll read into fdisk to see if I can set a flag and keep everything in-tact or if I will have to start over.
If it happens that I will have to start over, I will look into going MBR + BIOs. The Handbook seemed to persuade GPT + BIOs being the easiest/main choices, at least to me.
Last edited by D-Dub on Sat Jan 19, 2019 9:54 pm; edited 1 time in total |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Sat Jan 19, 2019 9:50 pm Post subject: |
|
|
D-Dub,
run fdisk, hit 'x' for expert options, hit 'm' to list options. Toggling bootable flag is right there. No starting over.
Re: Grub disappearance. You created /boot partition (not mandatory), it needs to be mounted before you can see its contents. _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Sat Jan 19, 2019 10:02 pm Post subject: |
|
|
D-Dub,
Lesson 1 is you don't fix Gentoo by reinstalling. That can be a hard lesson to learn.
Well, it is possible to break Gentoo that badly but its not easy.
When you mount all your partitions, prior to the chroot, order is important.
Your root goes to /mnt/gentoo
Your boot goes to /mnt/gentoo/boot after /mnt/gentoo is present.
If you skipped mounting /mnt/gentoo/boot then /mnt/gentoo/boot will be empty and grub and your kernel will appear to be missing. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
D-Dub n00b
Joined: 19 Jan 2019 Posts: 6 Location: U.S.
|
Posted: Sat Jan 19, 2019 10:55 pm Post subject: |
|
|
Jaglover,
I've gone in with fdisk and toggled the legacy BIOS bootable flag on Partition 1. Upon printing the table with fdisk I see:
Code: | Device Start End Sectors Type-UUID UUID Name Attrs
/dev/sda1 2048 6143 4096 <ID's> grub LegacyBIOSBootable
/dev/sda2 6144 268287 262144 <ID's> boot
/dev/sda3 268288 4462591 4194304 <ID's> swap
/dev/sda4 4462592 351649839 347187248 <ID's> rootfs |
fdisk -l -t dos /dev/sda gives me:
Code: | Device Boot Start End Sectors Size Id Type
/dev/sda1 1 351651887 351651887 167.7G ee GPT |
parted gives me:
Code: | Model: ATA INTEL SSDSC2KF18 (scsi)
Disk /dev/sda: 180GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 3146kB 2097kB grub legacy_boot
2 3146kB 137MB 134MB ext2 boot
3 137MB 2285MB 2147MB linux-swap(v1) swap
4 2285MB 180GB 178GB ext4 rootfs |
I do notice LegacyBIOSboot Attributes under fdisk (and called flag under parted) but I am not getting the "*" to appear in the boot column as previously discussed. I hope I'm not a bother with all of these issues. Is there any way of narrowing this problem? And to clarify, this is all done outside of chroot, correct?
Thank you. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Sat Jan 19, 2019 11:05 pm Post subject: |
|
|
D-Dub,
You have two partition tables. When you ask to display the partition table, the tools show you the GPT table.
Thats not the one you need to manipulate as Legacy Mode can't see it.
Code: | fdisk -t dos /dev/sda | will let you change the protective MSDOS partition table.
You must only toggle the bootable flag and save as you exit. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
D-Dub n00b
Joined: 19 Jan 2019 Posts: 6 Location: U.S.
|
Posted: Sat Jan 19, 2019 11:31 pm Post subject: |
|
|
Neddy,
Thank you! This makes sense as the help menus were slightly different. I have toggled on the flag and I am seeing the "*" under the boot column now. Being as I hadn't set this to 'on' during my installation process, is it possible that it created some conflicts when installing Grub?
I am not seeing any change in boot behavior, as I am still proceeding to what I am assuming to be some form of Network boot, which is lowest in the boot order. Trying to manually boot from my SSD is not possible either. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Sun Jan 20, 2019 12:05 am Post subject: |
|
|
D-Dub,
The boot flag is a single bit in the partition table that some dumb BIOSes and Legacy Mode firmware wants to be set before it will see your HDD.
We can now say that its not your issue.
If you boot with System Rescue CD (on a USB stick is fine) it has an option to boot an existing HDD install.
Does that work?
It sounds like Legacy Mode is not seeing your install.
The Dell BIOSes that I know of that won't work in legacy mode with GPT refuse to boot from a partition type of 0xee.
How did you install grub?
It has to be emerged than installed with a separate command as some of it must be moved to space outside of any filesystem. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
D-Dub n00b
Joined: 19 Jan 2019 Posts: 6 Location: U.S.
|
Posted: Sun Jan 20, 2019 2:30 am Post subject: |
|
|
Neddy,
I did as you suggested with SystemRescueCD, attempting to boot an existing OS from the hard drive, And here are the last few bits that may get us a little closer:
Code: | Searching a root filesystem having /sbin/init
File /sbin/init found on already mounted filesystem, link created in /newroot/
Checking /sbin/init can be executed by the current kernel...
Readelf: Error: '/newroot/sbin/init': No such file
The current running kernel architecture is x86_64
mount: mounting /dev on /newroot/dev failed: No such file or directory
!! /sbin/init not found on root filesystem
!! Running a mini shell (cannot complete the boot process)
/bin/sh: can't access tty; job control turned off |
Quote: | It sounds like Legacy Mode is not seeing your install.
The Dell BIOSes that I know of that won't work in legacy mode with GPT refuse to boot from a partition type of 0xee. |
Are there mandatory options that you've come accross that must also be disabled (or enabled) in BIOS? From what I see (I don't recall them exactly) but I don't know of anything else that may conflict on that front. I could always double check.
I installed Grub as followed:
Code: | root #emerge --ask --verbose sys-boot/grub:2
root #grub-install /dev/sda |
And then straight to:
Code: | root #grub-mkconfig -o /boot/grub/grub.cfg |
I did not specify any target or directory, nor did I use the --removable flag.
This may be important to note:
Both attempts at installing, I could not get genkernel nor grub to install after emerging. At least not properly. Which lead me to restart from the beginning. It happened this time as well, but after running:
Code: | root #emerge -uDU --keep-going --with-bdeps=y @world |
both worked. (genkernel was only used for building initramfs) |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Sun Jan 20, 2019 1:19 pm Post subject: |
|
|
D-Dub,
This snippit is interesting
Code: | Searching a root filesystem having /sbin/init
File /sbin/init found on already mounted filesystem, link created in /newroot/
Checking /sbin/init can be executed by the current kernel...
Readelf: Error: '/newroot/sbin/init': No such file |
/sbin/init is the file the kernel runs to start the system, so if it missing, the system won't start.
The usual reason for it being missing is that the wrong partition is being used as root.
Likewise Code: | mount: mounting /dev on /newroot/dev failed: No such file or directory |
Your grub install is correct.
Here is a test to determine if your system is checking the partition type in msdos partition table.
Run Code: | fdisk -t dos /dev/sda | and read the partition table.
Code: | Device Boot Start End Sectors Size Id Type
/dev/sda1 1 351651887 351651887 167.7G ee GPT | you have the bootable flag set.
Change the partition type from ee to Linux. That's either 82 or 83, I don't remember.
With that setting, your system won't boot ... or if it does, I'll be very surprised.
The result we want is for your system to see the HDD now.
If it does, we can add your system to list that won't mix legacy BIOS and GPT.
Don't reinstall. Knowing your GPT partition table, we can write an identical msdos partition table under your install.
The partition table is only a set of pointers to your install. Destroying the pointers does not harm the stuff being pointed to. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21633
|
Posted: Sun Jan 20, 2019 4:39 pm Post subject: |
|
|
82 is Linux swap. 83 is Linux any-filesystem. In GPT mode, where the codes are a luxurious 16 bits, more detail is encoded in the other 8 bits. For extra fun, 82 on MBR can also mean Solaris data. I don't know if anyone ever actually overwrote their Solaris data partition with a Linux swap header, but I remember reading warnings about the danger that the overlap represented.
For the curious, see https://en.wikipedia.org/wiki/Partition_type for a full list of the partition type codes. This is probably not essential reading for the current problem. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Sun Jan 20, 2019 5:05 pm Post subject: |
|
|
Hu,
Probably anything except 0xee will do for this test. It looks like 0x83 would be good. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Sun Jan 20, 2019 6:15 pm Post subject: |
|
|
Jaglover,
That's probably a better solution than the hack I was considering :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
D-Dub n00b
Joined: 19 Jan 2019 Posts: 6 Location: U.S.
|
Posted: Sun Jan 20, 2019 9:24 pm Post subject: |
|
|
Neddy,
Good afternoon. I have changed my partition type to Linux using the 83 ID. Rebooting and removing the liveCD I'm greeted with:
Code: | GRUB loading.
Welcome to GRUB!
error: no such partition.
Entering rescue mode ...
grub rescue>... |
I'm happy to know it's reading something
Right now my dos partition table reads:
Code: | Disk /dev/sda: 167.7 GiB, 180045766656 bytes, 351651888 sectors
Disk model: INTEL SSDSC2KF18
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: dos
Disk identifier: <ID>
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 1 351651887 351651887 167.7G 83 Linux |
I think this is meaning that it at least sees my HDD now
-----------------------------------------
Quote: |
Another option is to use sda2 as EFI partition and boot using UEFI instead. MBR boot was yesterday after all. |
Jaglover,
Thank you for your response. Just to make sure I am understanding things correctly, and this is may be entirely wrong.. But as of right now my partitions are as follows:
Code: | sda1 = BIOS
sda2 = boot
sda3 = swap
sda4 = root |
Going your route, will this mean that sda3 will become boot partition, i'll remove the swap partition, and sda4 will still remain root? I'm still doing my best to understand how these partitions work. All I know is that root (my biggest partition) will be similar to what my C: drive would be in Windows (where user files are stored etc.). I think I need to do some reading up on that. BIOS and Boot confused me, sda1 is my 'boot' partition (which is named BIOS) instead of sda2 which is named boot. Sorry if that makes entirely no sense, I'm just trying to make sense of it |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Sun Jan 20, 2019 10:19 pm Post subject: |
|
|
D-Dub,
That's what I expected. With the GPT marker gone (the 0xee) partition type, it happy to boot in legacy mode.
Your system cannot work in legacy mode with a GPT partition table.
We need to add it to the list of broken legacy mode systems.
I was going to suggest, throwing away the GPT partition table and writing an MSDOS partition table underneath you install.
That's a bit of a hack.
Jaglover is suggesting converting to UEFI mode, which is a better idea. I've never done a UFEI install, never mind the conversion.
I know the theory and I'll watch. You will not loose your install.
Its time to let Jaglover lead the way though.
-- edit --
Code: | sda1 = BIOS
sda2 = boot
sda3 = swap
sda4 = root |
sda1 is for grub. It installs piece of itself there.
sda2 is /boot
sda3 is swap
sda4 is root.
That won't change if you go the UEFI root. /boot will need to be reformatted to vfat, so the UEFI firmware can see it
It will get a new partition type too.
The contents will be much the same. The EFI firmware will load grub directly.
Here ends the theory. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Sun Jan 20, 2019 10:20 pm Post subject: |
|
|
There is nothing to it, really.
First, use existing sda2, set the partition type to EFI System.
Second, format it FAT. It may work with FAT16, although I believe some firmware may require FAT32. It is in Gentoo Handbook, no need to duplicate it here.
Then use Grub2 or rEFInd or even EFI stub kernel to boot. These are the most popular choices.
I haven't read the Handbook for a while, if something is still unclear, don't hesitate to ask. The small sda1 will not be used. _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Sun Jan 20, 2019 10:26 pm Post subject: |
|
|
D-Dub,
Save your kernel and initrd that are presently in /boot. They won't change and can be dropped into your newly formatted EFI System Partition.
-- edit --
Put the ee back in the MSDOS partition table or it will not boot in UEFI/GPT mode. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Last edited by NeddySeagoon on Sun Jan 20, 2019 10:31 pm; edited 1 time in total |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
|