Skip to main content

Update grub using dracut

Fixing grub using dracut

Last kernel update was not successful to me. Centos can not boot with next messages: 

[  180.098802] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts
[  180.610167] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts
[  181.121619] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts
[  181.633093] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts
[  182.144831] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts
[  182.656146] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts
[  183.167306] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts
[  183.678755] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts
 Of course simples way  is creating  linux  usb stick  and fix it. But dracut shell is present and  look likes I can do a lot using it.
First step is mounting   root  and boot partitions.  Dracut has  fdisk, lvm,  vi and  few commands for file system navigation.  I think i dont need a more.  First step is detecting  root partition:

drucat# fdisk -l  | more

Диск /dev/sda: 73,4 ГБ, 73369497600 байтів, 143299800 секторів
Одиниці = секторів з 1 * 512 = 512 байтів
Розмір сектора (логічного/фізичного): 512 байтів / 512 байтів
Розмір введення-виведення (мінімальний/оптимальний): 512 байтів / 512 байтів
Тип мітки диска: dos
Ідентифікатор диска: 0x000c76c3

Пристрій Завант  Початок     Кінець     Блоків  Ід  Система
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   143298559    71136256   8e  Linux LVM
I have boot partition and root somewhere inside Linux LVM. vgscan command is not accessible, but it is possible to do most of this task using lvm:
 lvm vgscan
  Reading all physical volumes.  This may take a while...
    Found volume group "centos" using metadata type lvm2
I have noticed that LVM directory is not created under /dev/ and rerun vgscan:
vgscan --mknodes -v
and activate partitions:
lvm lvchange  -ay /dev/centos/root
lvm lvchange  -ay /dev/centos/swap

lvm lvscan
  ACTIVE            '/dev/centos/swap' [6,84 GiB] inherit
  ACTIVE            '/dev/centos/root' [40,95 GiB] inherit
after this it is possible to mount root and chroot into it:
mkdir /drive
mount /dev/centos/root /drive
mount /dev/sda1 /drive/boot   
mount -o bind /proc /drive/proc
mount -o bind /sys /drive/sys
mount -o bind /dev /drive/dev
chroot /drive
After this, you have access to your system and can fix it easily. In my case issue was related to the wrong option in grub.cfg and start without delay

Comments

Popular posts from this blog

Small script for one of the plarium game

few notes about google games. Goggle informed that access to the all games be closed after June, 30. I played "Pirates: Tides of fortune" and decided to limit my game time using small script. Detail is below. Some history First internet games were updated network games only. 15 years ago internet connection requires a lot of money and nobody had a problem with lagging of the other players. Usually games uses personal communication protocol. Warbirds, Aces High and Eve online use this way. Next part use a browser and trivial HTTP protocol. One of the popular game in this area is travian . Travian player uses browser and every browser (PC, cell phone, tablet) can be used for playing. Of course, popularity of the game is related to graphics. Trivial HTTP does not have good power in this and other technology is used for this side. One of them is Flash . Unfortunately flash requires a lot of CPU : "Pirates" was near to froze at my old celeron with ...

Mac, emacs and new python3.10

Mac, emacs and new python3.10   I've deceided to upgrade my python to the new Python 3.10 and upgrade my IDE based on Emacs too.  Upgrading python to version 3.10  A installing python 3.10  is really simple task using a homebrew:  MacBook-Pro-Hohlov:call-me skhohlov$ brew search python ==> Formulae app-engine-python gst-python python-launcher python-tk@3.9 python@3.8 pythran boost-python ipython python-markdown python-yq python@3.9 ✔ jython boost-python3 micropython python-tabulate python@3.10 reorder-python-imports cython bpython ptpython python-tk@3.10 python@3.7 wxpython ==> Casks awips-python awip...