How to boot from grub shell manually

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

How to boot from grub shell manually

Postby janpihlgren » Aug 20th, '19, 09:06

I has copied a Mageia6 hdd to a new hdd with Gparted.
Then I done i switch the orginal hdd to the new hdd.
When I started my Laptop again with the new hdd I got this promt:
GRUB>
asking for a command.
But I have no idea of what command I shall use to boot to Mageia6.
My Laptop is a ThinkPad W701.
Last edited by doktor5000 on Aug 20th, '19, 18:35, edited 1 time in total.
Reason: adjusted subject
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden

Re: What GRUB-command?

Postby doktor5000 » Aug 20th, '19, 18:34

How did you copy with gparted? gparted is a partitioning tool, not something used to copy stuff around between disks. And what did you copy in particular?

Regarding your question, seems grub has not been installed into the MBR of the new disk or you didn't transfer over the MBR.
You need to boot manually and then install grub into the MBR. For that see e.g.
https://askubuntu.com/questions/929833/ ... -from-grub
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: How to boot from grub shell manually

Postby jiml8 » Aug 20th, '19, 19:31

To copy a hard drive and have it be bootable, use dd.
Code: Select all
dd if=/dev/sda of=/dev/sdb bs=1M

This assumes your existing hard drive is /dev/sda and your new one is /dev/sdb.

You then will have to look at /etc/fstab and probably fix it up. If your fstab file identifies disks by their UUID (which is the Mageia default...I personally always replace this with recognition by disk label because it is easier) then you will have to either change the UUID of the boot disk in the fstab (and also in the initrd...see "man dracut"... or change the UUID of the new drive to be the same as the old drive.

To change the drive UUID, use tune2fs.
Code: Select all
tuen2fs -U <uuid you want to assign> /dev/sdb1

which assumes that you are still booted from /dev/sda1 and setting up /dev/sdb to be an image of it.

You then could resize partitions as needed using gparted, and when you power down and remove the old drive, the system should boot cleanly into the new drive.
jiml8
 
Posts: 1253
Joined: Jul 7th, '13, 18:09

Re: How to boot from grub shell manually

Postby janpihlgren » Aug 21st, '19, 06:18

I'm ashamed :oops: :oops:
I did a big misstake when I wrote the name of the program. :oops: :oops:
I apologized .
The program I used was Clonezilla-live-2.62-15-amd64
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden

Re: How to boot from grub shell manually

Postby banjo » Aug 24th, '19, 04:45

I got into that bind when I screwed up my graphics driver..... and grub was using the graphics menu. It would not boot past the grub> command line. I had to boot the computer without a grub menu so that I could change the grub menu to "text" so that I could boot the computer to fix the graphics driver.... to get the grub menu to boot the computer. Now, when I install a new Mageia, I set the grub menu to "text" to avoid this strange loop.

Anyway, here is what I did to get the computer to boot.

    Find out the names of the partitions using the ls command.
    Find out the names of the kernels using the ls (boot partition) command.
    Manually set the grub variables, root, linux, and initrd...... choosing a kernel from the boot partition.
    Issue the boot command
See the example in the image below.

BootImage.jpg
Boot command sequence
BootImage.jpg (212.05 KiB) Viewed 1202 times


That sequence of commands caused a manual boot that failed out of xorg because of the bad graphics driver, but it did boot to a command line. Here is the magic in text.

Code: Select all
grub> ls
(hd0)(hd0,msdos8)(hd0,msdos7)(hd0,msdos6)(hd0,msdos5)(hd0,msdos1)
grub> ls (hd0,msdos7)/boot
.... shows all of the kernels and initrd images ....
grub> set root=(hd0,msdos7)
grub> linux /boot/vmlinuz-4.19.12-desktop-2.mga7
grub> initrd /boot/initrd-4.19.12-desktop-2.mga7.img
grub> boot

Since I installed Mageia 7 root directory on sda7 (msdos7) that is the one that I booted from. I have two systems installed on that disk, which is why the root directory was not sda1 (msdos1). If I had booted from msdos7 I would have booted Mageia 6.

I had to do a Ctrl-Alt-F5 to get it to show the command line login after booting.
Log in as root. At that point it is possible to edit the boot parameters etc. to try to fix the problem. The editor vim works OK in the console.

Banjo
(_)=='=~
If only the best bird sang, the forest would be a very quiet place.
User avatar
banjo
 
Posts: 445
Joined: May 4th, '11, 03:50
Location: Reading, Massachusetts


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron