boot problem in linux

78,484

Solution 1

In dracut emergency shell:

Dracut offers a shell for interactive debugging in the event dracut fails to locate your root filesystem. To enable the shell:

  1. Add the boot parameter ''rd.shell'' to your bootloader configuration file (e.g. /etc/grub.conf)

rhgb = redhat graphical boot - This is a GUI mode booting screen with most of the information hidden while the user sees a rotating activity icon spining and brief information as to what the computer is doing.

quiet = hides the majority of boot messages before rhgb starts. These are supposed to make the common user more comfortable. They get alarmed about seeing the kernel and initializing messages, so they hide them for their comfort.

rd.shell=This will present a shell should dracut be unable to locate your root device

  1. Remove the boot arguments ''rhgb'' and ''quiet'' A sample /etc/grub.conf bootloader configuration file is listed below.

default=0

timeout=5

serial --unit=0 --speed=9600

terminal --timeout=5 serial console

title Fedora (2.6.29.5-191.fc11.x86_64)

root (hd0,0)

kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell

initrd /dracut-2.6.29.5-191.fc11.x86_64.img

  1. If system boot fails, you will be dropped into a shell as seen in the example below.

    No root device found Dropping to debug shell. sh: can't access tty; job control turned off

  2. Use this shell prompt to gather the information requested above (see the section called “All bug reports”).

5.Accessing the root volume from the dracut shell From the dracut debug shell, you can manually perform the task of locating and preparing your root volume for boot. The required steps will depend on how your root volume is configured. Common scenarios include:

• A block device (e.g. /dev/sda7)

• A LVM logical volume (e.g. /dev/VolGroup00/LogVol00)

• An encrypted device (e.g. /dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83)

• A network attached device (e.g. netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.fedoraproject:for.all)

6.The exact method for locating and preparing will vary. However, to continue with a successful boot, the objective is to locate your root volume and create a symlink /dev/root which points to the file system. For example, the following example demonstrates accessing and booting a root volume that is an encrypted LVM Logical volume.

Inspect your partitions using parted
  1. You recall that your root volume was a LVM logical volume. Scan and activate any logical volumes

lvm vgscan

lvm vgchange -ay

  1. You should see any logical volumes now using the command blkid:

    blkid

    /dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4"

    /dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member"

    /dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS"

    /dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3"

    /dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap"

9.With the root volume available, you may continue booting the system by exiting the dracut shell

exit

Solution 2

Step1: Type journalctl

Step2: Find the error

Step3: run

xfs_repair -L /dev/dm-0

Step4: run

xfs_repair -d  /dev/dm-0
Share:
78,484

Related videos on Youtube

DILSHATH
Author by

DILSHATH

Updated on September 18, 2022

Comments

  • DILSHATH
    DILSHATH over 1 year

    I have unfortunately format drive /dev/sda2. So all the /root,/home,swap LVM no longer exists. Because of this my server is unable to work properly.

    it shows only

    dracut#>Dracut Error:
    
    
    
    
    [ OK ] Reached target Paths.
    [ OK ] Reached target Basic System.
    dracut-initqueue[372]: Warning: Could not boot.
    [ OK ] Started Show Plymouth Boot Screen.
    [ OK ] Reached target Paths.
    [ OK ] Reached target Basic System.
    dracut-initqueue[372]: Warning: Could not boot.
    dracut-initqueue[372]: Warning: /dev/centos/root does not exist.
    dracut-initqueue[372]: Warning: /dev/centos/swap does not exist.
    dracut-initqueue[372]: Warning: /dev/mapper/centos-root does not exist.
    Starting Dracut Emergency Shell...
    Warning: /dev/centos/root does not exist
    Warning: /dev/centos/swap does not exist
    Warning: /dev/mapper/centos-root does not exist
    
    Generating "/run/initramfs/rdsosreport.txt"
    
    Entering emergency mode. Exit the shell to continue.
    Type "journalctl" to view system logs.
    You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot
    after mounting them and attach it to a bug report.
    
    • Tim Kennedy
      Tim Kennedy about 8 years
      i don't understand. are you saying for formatted a drive that already was in use? and overwrote the partition table, thereby wiping out your existing data?
    • DILSHATH
      DILSHATH about 8 years
      I try to format that disk /dev/sda2 by using fdisk
    • Арсений Черенков
      Арсений Черенков about 8 years
      welcome to U&L ! Have you any backup ?
    • DILSHATH
      DILSHATH about 8 years
      no..I am new to Linux platform. can you please explain me somewhat clearly
    • Praveen Reddy Julakanti
      Praveen Reddy Julakanti almost 4 years
      I got same problem while using centos on virtual box. and I fixed it by changing the windows hyper-V features. then it started normally
  • DILSHATH
    DILSHATH about 8 years
    It will work under dracut emergency shell?
  • jsbillings
    jsbillings about 8 years
    Maybe? You'd be better off booting off a LiveCD with LVM tools.
  • DILSHATH
    DILSHATH almost 8 years
    i just used this below two commands in:lvm vgscan and lvm vgchange -ay
  • DILSHATH
    DILSHATH almost 8 years
    now its working normally. Thank you for your help :)
  • Yaroslav Nikitenko
    Yaroslav Nikitenko over 6 years
    "locate your root volume and create a symlink /dev/root which points to the file system" I symlinked that (actually, I had a problem with /dev/mapper/live-rw), but 'A start job is running for (that device)' still shows and doesn't load.
  • QNester
    QNester about 4 years
    @DILSHATH thank you so much, it works excellent for me