0

I tried to restore Grub using Life-CD, but some error popped up during the process. Now I want to boot Linux manually. I enter the following commands:

grub>

ls

(hd0) (hd0,gpt1) (hd0,gpt2) (hd0,gpt3)

set root=(hd0,1)

linux (hd0,2)/vmlinuz-6.15.0-20-generic root=/dev/sda1 ro

initrd (hd0,2)/initrd.img-6.15.0-20-generic

boot

A lot of letters fly by. There is an error at the end: /dev/sda1 - Invalid argument As a result, I get the BusyBox command line.

What am I doing wrong?

New contributor
Saimon Bigman is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
5
  • that is probably written in the last letters of what flew by. My guess here, simply on the amount of questions asked, is that /dev/sda1 is not a readable root volume, be it due to being the wrong partition, or be it due to a damaged file system. But it can be a whole host of things that we can't diagnose without seeing the actual errors you're getting (it feels a bit surprising you didn't include these!). Please edit your question to include the last messages that are printed, which typically tell you what did not work. Also include information on your Linux distro. It's a very old kernel! Commented Nov 17 at 11:56
  • 2
    Another bit of perspective: haven't used the shell fallback of my linux systems in decades. It's much easier to just boot from a bootable USB drive and fix things from there. Commented Nov 17 at 11:59
  • For a newer user Boot-Repair is a better option. I still use it to run its report to document my system, so I know what is where. Lets see details on your configuration. Please copy & paste the pastebin link to the BootInfo summary report ( do not post report), do not run the auto fix till reviewed. Use often updated ppa version with your USB installer or any working install over somewhat older ISO or run update in ISO to make it current. help.ubuntu.com/community/Boot-Repair & sourceforge.net/p/boot-repair/home/Home Commented Nov 17 at 14:41
  • "I tried to restore Grub using Life-CD" - there's an underlying issue here. Why did you need to restore grub in the first place? What had happened to require this? Commented Nov 17 at 15:44
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Nov 18 at 3:52

1 Answer 1

0

Dropping into BusyBox generally means the initramfs could not access the root filesystem. In other words, the root=/dev/sda1 part of your GRUB commands might not be correct, or your root filesystem might be damaged.

The GRUB commands you entered indicate that the second partition on your disk is probably the /boot filesystem, as the vmlinuz-<kernel version> and initrd.img-<kernel version> files are within the root directory of that partition.

Given that, the GRUB command set root=(hd0,1) is most likely not correct, but it might not be needed at all, so it probably won't do any harm. You could try using set root=(hd0,2) instead, for the sake of completeness, but it probably won't have any significant effect.

If your system boots in native UEFI-style and has Secure Boot enabled, then GRUB won't have to (and in fact cannot) load additional modules, as all the functionality will be built into the main grubx64.efi boot file. As your linux and initrd GRUB command lines have been specified with absolute GRUB-style pathnames, the set root= command should be completely unnecessary and could be omitted.

Since your disk seems to have GPT partitioning, it seems likely that your system might be using UEFI-style boot process. If that's true, then the first partition on your disk is likely to be the EFI System Partition (ESP for short), which would mean the Linux root filesystem would have to be the third partition.

GRUB will see all disks and SSDs as (hdN), whether they're SATA or NVMe. But the Linux kernel will normally see SATA storage devices as /dev/sdX (where X is a letter) and NVMe storage as /dev/nvmeNn1 (where N is a number). With/dev/sdX devices, the partition number comes immediately after the device letter; with NVMe devices, there is a letter p inserted after the whole-disk device name and before the partition number.

If you have a modern system (especially a laptop), your storage device is very likely a NVMe device.

Try changing the root=/dev/sda1 part of your GRUB commands to root=/dev/sda3 or root=/dev/nvme0n1p3.

If this allows you to get into the normal Linux environment, the easiest way to make the fix persistent is probably to reinstall GRUB with commands like:

sudo grub2-install /dev/sda 

for SATA storage, or

sudo grub2-install /dev/nvme0n1 

for NVMe storage respectively.

If this advice won't help, more information is needed: try running lsblk -o +fstype or cat /proc/partitions in the BusyBox prompt. These commands should reveal the sizes and ideally the filesystem types of each partition. If you can tell us that, more accurate advice can be provided.

The last 10 or so lines from the "lot of letters that fly by" might also include some useful error messages; please read them and copy any significant-looking error messages here.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.