Jump to content

[SOLVED] grub2 swap brak zmiany UUID (edit: oraz /boot do osobnej partycji)


Recommended Posts

Witam

Zapragnąłem osobnej partycji `/boot` (o tym może inny post). "Zcisnąłem" duży `SWAP` z 24 na 15GB. Partycja wciąż jest `sda4`, ale `UUID` się zmienił.

Zmieniam ten `UUID` na nowy w `/etc/default/grub` w linii: GRUB_CMDLINE_LINUX... [ln1]

Wykonuję: `grub2-mkconfig -o /boot/grub2/grub.cfg` [cmd1]

Restart i zatrzymuje się na wykonywaniu: `Job dev-disk-by...`

Muszę wyłączyć i włączyć ponownie. Przechodzę do edycji gruba podczas startu i tam usuwam: `resume=UUID=xxxxxxxx`. Startuje normalnie.

Ciekawostka. W `/etc/default/grub` w podanej wyżej linii [ln1] kasuję `quiet` i ponownie [cmd1] i `quiet` znika.

Jak podmienić ten UUID na stałe?

Pozdrawiam

Radek Głębicki

Link to comment
Share on other sites

To może spróbuj, zamiast ręcznie zmieniać UUID w grubieuzyć polecenia grubby

sudo grubby --remove-args=resume=UUID=xxx --update-kernel=ALL

i jak wszystko będzie działać prawidłowo to dodaj je ponownie

sudo grubby --args=resume=UUID=xxx --update-kernel=ALL

 

Link to comment
Share on other sites

Jeszcze nie wiem co, ale coś się zmieniło na Fedorze i w Redhacie 9. Ten cały /etc/default/grub już nie o wszystkim decyduje. Grubby robi jakoś, że te zmiany są zapisywane tam, gdzie trzeba.

Pewnie idą w stronę statycznego /etc, gdzie tylko się da.

Link to comment
Share on other sites

`grubby --info-ALL`

pokazuje, że wszystkie `resume` ustawione są na właściwy `UUID`

Która komenda zapisuje GRUBa? Czy już nie trzeba (zapis gdzieś do bootloadera?), a GRUB sobie sięga na partycję (boot) i stamtąd pobiera to co wyświetla?

Link to comment
Share on other sites

Ok, znalazłem przyczynę. W `fstab` wcześniej dodałem też nową partycję `boot`. Skopiowałem tam `boot` z tego w `/` (root - oryginalnego). Operacje były przeprowadzane na tym `/boot` z innej partycji. Tknęło mnie jak czytałem czy zmieniłem `SWAP` w `fstab`. Pomyślałem, że `boot` też już tam dodałem. Startuje już z właściwym `swap`.

A teraz pociągnę ten wątek.  Wciąż w `GRUB` jak przerywam start i edytuję to przed `/boot` dla `linux` i `initrd` jest ($root). Zmieniam ręcznie na (hd0,5) i działa używając nowej partycji `/boot` która jest na `/dev/sda5`. Jak dla `gruba` wymusić, że `boot` jest teraz na innej partycji?

 

Link to comment
Share on other sites

28 minut temu, Radosław napisał:

A teraz pociągnę ten wątek.  Wciąż w `GRUB` jak przerywam start i edytuję to przed `/boot` dla `linux` i `initrd` jest ($root). Zmieniam ręcznie na (hd0,5) i działa używając nowej partycji `/boot` która jest na `/dev/sda5`. Jak dla `gruba` wymusić, że `boot` jest teraz na innej partycji?

Z manuala grubby podejrzewam, że to będzie właściwa opcja

--boot-filesystem=bootfs
The grub boot loader expects file paths listed in it's configuration path to be relative to the top of the filesystem they are on, rather then relative to the current root filesystem. By default grubby searches the list of currently mounted filesystems to determine this. If this option is given grubby acts as if the specified filesystem was the filesystem containing the kernel (this option is designed primarily for testing).

Ewentualnie może pomóc dodanie do /etc/default/grub zmiennej GRUB_DEVICE_UUID

Link to comment
Share on other sites

w manualu  u mnie dla grubby nie mam tej opcji --boot-filesystem

a w manualu gruba2 dla GRUB_DEVICE_UUID jes to dla root

Poproszę o inny zestaw podpowiedzi ;-D

a tak wygląda część z grub2-mkconfig
 

Cytuj

### BEGIN /etc/grub.d/10_linux ###
insmod part_gpt
insmod ext2
set root='hd0,gpt5'                                                               
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5
 --hint='hd0,gpt5'  d7a62396-2f29-4cfe-944a-f17010da2c94
else
  search --no-floppy --fs-uuid --set=root d7a62396-2f29-4cfe-944a-f17010da2c94
fi
insmod part_gpt
insmod ext2
set boot='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=boot --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5
 --hint='hd0,gpt5'  d7a62396-2f29-4cfe-944a-f17010da2c94
else
  search --no-floppy --fs-uuid --set=boot d7a62396-2f29-4cfe-944a-f17010da2c94
fi

# This section was generated by a script. Do not modify the generated file - all changes
# will be lost the next time file is regenerated. Instead edit the BootLoaderSpec files.
#

# The blscfg command parses the BootLoaderSpec files stored in /boot/loader/entries and
# populates the boot menu. Please refer to the Boot Loader Specification documentation
# for the files format: https://systemd.io/BOOT_LOADER_SPECIFICATION/.

# The kernelopts variable should be defined in the grubenv file. But to ensure that menu
# entries populated from BootLoaderSpec files that use this variable work correctly even
# without a grubenv file, define a fallback kernelopts variable if this has not been set.
#
# The kernelopts variable in the grubenv file can be modified using the grubby tool or by
# executing the grub2-mkconfig tool. For the latter, the values of the GRUB_CMDLINE_LINUX
# and GRUB_CMDLINE_LINUX_DEFAULT options from /etc/default/grub file are used to set both
# the kernelopts variable in the grubenv file and the fallback kernelopts variable.
if [ -z "${kernelopts}" ]; then
 set kernelopts="root=UUID=371a47ed-91ce-4d2b-ad2d-2c5156df35a3 ro resume=UUID=3cdc0c49-a078-4d39-8633-af3ab83093da rhgb quiet "
fi

insmod blscfg
blscfg
### END /etc/grub.d/10_linux ###

 

Zielone dobrze? Czerwone dlaczego set=root wskazuje na nową partycję boot?

Link to comment
Share on other sites

  • 2 weeks later...

Ok, działa z osobnej partycji `boot`. Musiałem zmienić w `/boot/loader/entries/` w plikach z liniami "linux" i "initramfs" z "/boot/...."  do "/..."  czyli usunąłem `/boot`. W menu GRUB wciąż jest ($root), ale bez "/boot". I mam pewność, że działa bo zmieniłem oryginalny /boot na /boot2, a system startuje więc korzysta z partycji `/dev/sda5` czyli partycji `boot`. Trochę pokręcone, ale może komuś coś pomoże.

Link to comment
Share on other sites

  • Radosław changed the title to [SOLVED] grub2 swap brak zmiany UUID (edit: oraz /boot do osobnej partycji)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...