Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 16 of 16

Thread: boot error

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11

    Quote Originally Posted by dbennett View Post
    Part 6... I FORGOT TO MENTION BEFORE, TO BE SAFE, YOU SHOULD BACK UP FSTAB BEFORE EDITING. TO DO THIS TYPE `cp/etc/fstab /etc/fstab.old'

    YOU MAY BE VERY CONFUSED USING NANO, VIM OR EVEN VI, I SUGGEST YOU DO SOME READING ON HOW TO USE THEM FIRST OR YOU'LL BE VERY FRUSTRATED TRYING TO TYPE WITH IT.

    Once you are comfortable with the editor, go into insert mode, and replace the /dev/by-uuid/xxxx-yyyy-zzzz-etcetcetc for each mount point with the /dev/sdX# you found for it. Do this for all filesystems listed in fstab. You probably have a swap partition listed, don't worry about that for now, it may slow your next boot, but it shouldn't be necessary to boot.

    So for instance you'll see a line like:
    /dev/by-uuid/adcdef-12345-fedcba-54321 /Home rw

    Say you previously identified /Home to be located on (sda,gpt4) in grub, you would change the line to:

    /dev/sda4 /Home rw

    Make sure to leave any trailing blank lines at the end of the document and do not change the mount targets (like /Home) just change the mount points (like /dev/sda4). If there was an extra partition (besides the EFI/boot partition) that you found in grub on the same drive, you can try making that swap, otherwise, just wait until you boot into you desktop to worry about that.

    When you are done changing the mountpoints for all the filesystems, hit the escape sequence to exit input mode and then hit the sequence to save/overwrite and exit.

    Sent from my SM-N960U using Tapatalk
    Part 7...

    Once everything is saved, reboot by typing `shutdown -r now'.

    When you end up back in grub, make the same edit you made before your last boot, except this time keep the "ro" and don't add "rw". Again press ctrl-x to boot.

    If you didn't mess anything up, and you didn't incorrectly identify the filesystems, the system should now boot without issue. You may notice a failed mount for your swap partition if you didn't fix that before, which may hang for 2 minutes, but it should then allow boot.

    Once you're logged in, you should now edit the grub configuration file so the system boosts on its own without needing a manual edit each time.

    To do this, go to /boot (you can do this in file explorer), in /boot you should find a folder called grub and in there a grub.cfg file. Open that with your standard text editor and make the change you just made prior to boot.

    You will also want to correct the swap mount point if you did not do so before. You can easily find the swap partition by opening gdisks (gnome) or whatever your native disk manager is for your DE or open gparted. You can now see a graphical representation of all your drives. Select the different drives until you find the one that has a partition labeled swap. Make note of its sdX# ID. You can edit /etc/fstab with the graphical text editor. Just correct the mount point for swap in fstab and save.



    Sent from my SM-N960U using Tapatalk

  2. #12
    Quote Originally Posted by dbennett View Post
    Part 7...

    Once everything is saved, reboot by typing `shutdown -r now'.

    When you end up back in grub, make the same edit you made before your last boot, except this time keep the "ro" and don't add "rw". Again press ctrl-x to boot.

    If you didn't mess anything up, and you didn't incorrectly identify the filesystems, the system should now boot without issue. You may notice a failed mount for your swap partition if you didn't fix that before, which may hang for 2 minutes, but it should then allow boot.

    Once you're logged in, you should now edit the grub configuration file so the system boosts on its own without needing a manual edit each time.

    To do this, go to /boot (you can do this in file explorer), in /boot you should find a folder called grub and in there a grub.cfg file. Open that with your standard text editor and make the change you just made prior to boot.

    You will also want to correct the swap mount point if you did not do so before. You can easily find the swap partition by opening gdisks (gnome) or whatever your native disk manager is for your DE or open gparted. You can now see a graphical representation of all your drives. Select the different drives until you find the one that has a partition labeled swap. Make note of its sdX# ID. You can edit /etc/fstab with the graphical text editor. Just correct the mount point for swap in fstab and save.



    Sent from my SM-N960U using Tapatalk
    PART 8...

    FINAL NOTES:

    You're now all set, but there's a caveat...

    From my experience, systems which loose tract of UUID once, tend to do so often and many times for seemingly no reason. Even inserting a flash drive could mess them up. While putting in a flash drive might mess up the sdX# ID, that would only be if you booted with a flash drive present, and I've found that systems that mix up UUIDs generally keep decent track of drive letters. Partition numbers will only change if you re-partition a disk, so try to avoid that and be prepared to edit fstab manually again if you do so.

    Take a backup of fstab again now that it's fixed (open a shell and type `cp /etc/fstab /etc/fstab.good). You can no longer set grub to use drive letter IDs- it will always default to UUIDs. This means if you do a full-upgrade (via apt/apt-get/dnf/yum full-upgrade/dist-upgrade), or a standard upgrade of grub your fstab (sometimes) and grub.cfg (almost always) will break again. The best way of fixing this is simply by copying that /etc/fstab.good to /etc/fstab after any upgrade and then manually making that small edit to the grub.cfg file after each upgrade (you can't save the old grub.cfg version and use it after an upgrade because the kernel version of loads will likely change.) To avoid other boot problems, if you need to say use a flash drive, insert the flash drive after boot has completed.

    There are other ways to try and fix boot problems. Some distros have a `fixboot' command as part of the recovery shell, but I've found that to rarely work in the case of incorrect UUIDs. Finally, if working with the emergency shell is too much for you, you can always boot to a live USB of any distribution and then follow the same steps to fix fstab. You'll still need to identify which partitions are which, but if booted to a live distro, you can use the GUI like gparted or udisks to mount all the file systems and then identify them (what is what) that way, rather than using the grub2CLI.

    Sent from my SM-N960U using Tapatalk

  3. #13
    Quote Originally Posted by dbennett View Post
    PART 8...

    FINAL NOTES:

    You're now all set, but there's a caveat...

    From my experience, systems which loose tract of UUID once, tend to do so often and many times for seemingly no reason. Even inserting a flash drive could mess them up. While putting in a flash drive might mess up the sdX# ID, that would only be if you booted with a flash drive present, and I've found that systems that mix up UUIDs generally keep decent track of drive letters. Partition numbers will only change if you re-partition a disk, so try to avoid that and be prepared to edit fstab manually again if you do so.

    Take a backup of fstab again now that it's fixed (open a shell and type `cp /etc/fstab /etc/fstab.good). You can no longer set grub to use drive letter IDs- it will always default to UUIDs. This means if you do a full-upgrade (via apt/apt-get/dnf/yum full-upgrade/dist-upgrade), or a standard upgrade of grub your fstab (sometimes) and grub.cfg (almost always) will break again. The best way of fixing this is simply by copying that /etc/fstab.good to /etc/fstab after any upgrade and then manually making that small edit to the grub.cfg file after each upgrade (you can't save the old grub.cfg version and use it after an upgrade because the kernel version of loads will likely change.) To avoid other boot problems, if you need to say use a flash drive, insert the flash drive after boot has completed.

    There are other ways to try and fix boot problems. Some distros have a `fixboot' command as part of the recovery shell, but I've found that to rarely work in the case of incorrect UUIDs. Finally, if working with the emergency shell is too much for you, you can always boot to a live USB of any distribution and then follow the same steps to fix fstab. You'll still need to identify which partitions are which, but if booted to a live distro, you can use the GUI like gparted or udisks to mount all the file systems and then identify them (what is what) that way, rather than using the grub2CLI.

    Sent from my SM-N960U using Tapatalk
    I know this is complicated, especially if your not used to the shell, but if you plan to use linux, you'll need to learn the shell anyway.

    This will be a great crash course on learning how to interact with the shell. Remember linux is CaSe SeNsItIvE, and 95% of commands are all lowercase.

    I highly suggest reading through this completely first, and trying to understand what you are doing (rather than just following a procedure) before starting.

    Try to understand what it is your doing at each step.

    You could try fixboot or one of those " automated recovery boot tools" but not only will they most likely fail (or work through a single reboot then fail), but if you can get the hang of this, then you'll be able to fix issues like this in 5 minutes, be able to diagnose problems if they occur and won't be back at square one if a problem occurs again.

    Also be careful with so-called boot recovery or filesystem repair tools, as they can often end up making your system permanently unbootable- as there's no one-size-fits-all to linux boot issues. You can try `fixboot' but if you'r distro doesn't have it, or it fails, this is a surefire way to get your system booted.

    Grub2 also has a tool (built in to some distros- but not likely a part of the recovery shell, so it won't help unless you can boot a live distro that has it- however, I have NEVER had any success with it and found it to only have ever further complicated issues).

    IF YOU NEED ANY HELP, FEEL FREE TO ASK QUESTIONS, BUT IF YOU TRY AND TAKE THE EASY WAY OUT WITH AN AUTOMATED REPAIR TOOL AND IT MAKES YOUR SITUATION WORSE, I'M AFFRAID I'LL BE UNABLE TO HELP.

    Sent from my SM-N960U using Tapatalk

  4. $spacer_open
    $spacer_close
  5. #14
    Quote Originally Posted by harsin989 View Post
    anything can be helpfull

    Sent from my SM-G610F using Tapatalk
    I answered your question and gave you a general way to fix it, but upon looking at the pictures again (the part that's hard to make out at the top), I think you may have more than one issue. And more importantly, you need to change one thing on order to be able to do anything...

    When you get to grub (the bootloader where you can select the OS), move the arrow keys up/down to stop the timeout. If you have an entry with "recovery" in the name, select that (it may be under an "advanced options for..." menu.) If you do not, you need to at least edit the main entry. Hover over/use the arrow keys to highlight it (the recovery entry, if that is nonexistent, then the main entry) click "e" on the keyboard to edit it. If there is a line ending in something like silent ro (or quiet ro, ro quiet, ro silent or just ro, get rid of the quiet or silent and change ro to rw. Then hit [ctrl]-x to boot. That should unlock your root account. If this is a proprietary device with a modified kernel to prevent root access, you're pretty screwed. You'll need to do a fresh install- wiping out all data. Hopefully that's not the case.

    Once you can log in as root, follow the on screen instructions to display the boot log (with journalctl). You may first want to see if your recovery shell has an sshd. If so, before doing journalctl, but after logging in, type sshd [enter]. If it doesn't say command not found, then you have ssh. If it didn't daemonize (bring you back to be able to enter more commands), hit [ctrl]-c. Then type ifconfig and hit enter. See if you have a DHCP IP address. If not type "ifconfig eth0 add 192.168.xxx.yyy) where xxx and yyy are within your network. Set the subnet and gateway similarly. Type ifconfig -h if you need help. Once you know the ip, start the sshd again. (Type sshd and hit enter. Then use a different linux computer or Windows with a program like putty or a Mac using bash SSH. Then follow the journalctl instructions to open the log remotely. That way you can cooy/paste it's output instead of taking hard to read pics. You can even use an SSH app for your phone and do it from there.

    Sent from my SM-N960U using Tapatalk

  6. #15
    Quote Originally Posted by harsin989 View Post
    anything can be helpfull

    Sent from my SM-G610F using Tapatalk
    You should be able to figure out how to SSH in once the daemon is up and running and you know the ip. The default port will be 22. If you can't get the network up or something, then just try to take as clear pics as possible. You'll also likely need to use a pager like less or more `journalctl -xb | more' / `journalctl -xb | less' or it'll all shoot through the screen too fast to see.

    Sent from my SM-N960U using Tapatalk

  7. #16
    -->
    Quote Originally Posted by dbennett View Post
    Continued...

    What you are seeing is a dropdown to an emergency recovery shell. This occurs when the system cannot boot normally.

    Log in to the recovery shell with the root account.

    Use the shell to diagnose and repair:
    #mount
    (Check the output to see if anything is mounted) you may see the temporary filesystem (tempfs) or the ramdisk as the only drive mounted. If you can see the "root" filesystem mounted successfully (on /), that's good, skip ahead to the *)

    If the root fs is not mounted, then you will need to fix that in grub.

    To do that, reboot, when you get to the grub bootloader (assuming that's what you're using), move the arrow on the keyboard to stop it from automatically booting. Select the main boot entry for linux and hit "e" on the keyboard to edit. You will see 2 lines at the end, one is the initrd and the other is linux... you should see the "set=root /UUID-blahblahblah / ro quiet" or something like that. That entry is incorrect.

    To fix it, you need to find the actual root location. Hit "ctrl-c" on the keyboard to open the command line. Type `ls' to show the drives and partitions. If you know what your root filesystem drive looks like (number of partitions), use context clues to try and figure out what your root partition may be. Otherwise continue typing `ls (sdX,gpt#)'. If you are not booting EFI, then it will be mbr not gpt, the X is the lowercase drive letter (ex. sdb<--) the # is the partition number. Don't type the `' but keep the (,) part.

    Sent from my SM-N960U using Tapatalk
    I made this tutorial very generic, on purpose, so it could apply to anyone who should come across it.

    In your specific case, it appears /dev/sda is home to all your partitions (for finding and identifying them step).

    But it also looks as if your filesystem may be corrupted (note the "gggggggg" before the "/etc..." and the "ignoring bad line starting with modprobe" this can often happen after an extension if you did not run fsck afterwards to check and repair, especially if you tried to force an extension an online partition.

    This is the consequence of typing arbitrary commands with su privileges- without understanding what specifically they are doing.

    That is why I have been very detailed here to explain why you need to perform each step.

    Sent from my SM-N960U using Tapatalk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •