[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: |
Nathan Stratton Treadway |
Subject: |
Re: determining root mounting point from GRUB command line prior to boot |
Date: |
Tue, 28 May 2019 09:21:29 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Mon, May 27, 2019 at 22:16:29 +0000, Blue Upsilon via Help-grub 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.
To avoid needing to know the /dev/XXX device name ahead of time, many
linux distros now support specifying the root= parameter via a boot-time
search argument.
For example, my Ubuntu Bionic box uses
linux /boot/vmlinuz-4.15.0-50-generic
root=UUID=eba1a816-77e8-11e8-898b-b8aeeddbdbb5 ro
and thus can find the desired root filesystem no matter what /dev/XXX
file it happens to get assigned on a particular startup cycle.
For manually typing in something in to a Grub prompt,
root=LABEL=.... would probably be easier to use than the UUID.
But you'll need to check the docs for your distro to see what it
supports....
Nathan
----------------------------------------------------------------------------
Nathan Stratton Treadway - address@hidden - Mid-Atlantic region
Ray Ontko & Co. - Software consulting services - http://www.ontko.com/
GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt ID: 1023D/ECFB6239
Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239