help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: determining root mounting point from GRUB command line prior to boot


From: David Balažic
Subject: Re: determining root mounting point from GRUB command line prior to boot
Date: Tue, 28 May 2019 12:28:42 +0200

No. The device names are depending on two things:
 - the kernel (they enumerate the devices)
 - the file names in the /dev folder (they can be dynamically created)

You can "ls" the /dev folder, but not more.

With enough knowledge you could correctly guess the name, but I doubt there
is a 100% workking solution.

Regards,
David


On Tue, 28 May 2019 at 00:16, Blue Upsilon via Help-grub <address@hidden>
wrote:

> thanks Steve;  but this does not solve my problem.
> to be more clear this is what i do when i boot:
> ======
> grub> set root=(hd0,gpt4)
> grub> linux /vmlinuz root=/dev/nvme0n1p4
> grub> initrd /initrd.img
> grub> boot
> ======
>
> this works;
> but line #2  can be problematic in some cases.
> say i'm booting from an external disk backup.
> then in line 2,    i don't know what to set root equal to.
> if I do:     ls  /dev    then it does not show the various
> sda1,sdb2,nvme0n1p4; etc etc.
>
> the only way i see these is:   say i don't set a root=...  argument,
>  then the boot FAILS,     and i get to BusyBox  with an initramfs command
> line.
> in this command line,  if i do    ls /dev      THEN  i do see the various
>  /dev/nvme0n1p4,   etc etc....
> but,  is there a way to see these in GRUB command line?   that way i can
> know what to set the root arg equal to.......
>
> Cheers,
> Blue
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Monday, May 27, 2019 9:28 PM, Steve <address@hidden> wrote:
>
> > type
> > ls
> > it will list all partitions and drives
> >
> > On Mon, 27 May 2019 at 19:26, Blue Upsilon via Help-grub <
> address@hidden> wrote:
> >
> >> Hi there,
> >>
> >> I use Ubuntu 18.04.
> >> When I boot from GRUB command line, is there a way to determine what
> the root mounting point will be, before booting?
> >>
> >> i.e., say I know that my partition that has Ubuntu is  (hd0,gpt4).
> >> so then I do:     set root=(hd0,gpt4)
> >> and then I happen to know that the correct root mounting point is
>  /dev/nvme0n1p4
> >> so then I know to do:    linux /vmlinuz root=/dev/nvme0n1p4
> >> and then i do     initrd /initrd.img     and  boot
> >>
> >> but like what if i don't know ahead of time that    /dev/nvme0n1p4   is
> what I need?
> >> (this problem comes up when:   say i'm booting from a backup external
> disk, and i don't know whether it will be /dev/sdb2  or whatever.... etc..)
> >>
> >> Thanks,
> >> Blue Upsilon
> >> _______________________________________________
> >> Help-grub mailing list
> >> address@hidden
> >> https://lists.gnu.org/mailman/listinfo/help-grub
> _______________________________________________
> Help-grub mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-grub
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]