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

Upgrade postgres 9.4 to 9.6 at Debian linux

I'm using virtual server based on Debian Linux for some my free projects.  One of them is based on Postgres with PostGIS extension.   This windy rainy day is a good time for executing some upgrade. Also I would like to add partman extension for partituoning.
Checking new version. Update package list :
aptitude update Get: 1 http://ftp.debian.org/debian jessie-updates InRelease [145 kB] Get: 2 http://security.debian.org stretch/updates InRelease [62.9 kB] Get: 3 http://security.debian.org jessie/updates InRelease [63.1 kB]
 Check for new version:


dpkg-query -l postgresql* Desired=Unknown/Install/Remove/Purge/Hold| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)||/ Name Version Ar…

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 512M…

Small python script for monitoring MySQL performance

I have few services which use MySQL as database server. I would like to have information about load in PNG  image  or  in Cacti app.
MySQL   has  performance information at 'SHOW STATUS' command.

Values  which  are monitored : 
 threads_running, threads_connected, thread_cached, slow_queries
 Of course,  it is really easy to add more variables.

Connection to MySQL is accomplished by MySQLdb  module. Typical example of usage is below :
import MySQLdb mydb = MySQLdb.connect(host = 'hostname', user = 'username', password = 'secret', database = 'mysatabase' ) mycursor = mydb.cursor() mycursor.execute('SQL command') sqlresult = cur.fetchall()
Storing data in rrd file is aviable via rrdtools package. This one is present in debian and Centos OS. example of creating file is below: import rrdtool rrdtool.create("myfile.rrd" , "DS:value1:datatype:hea…