My pc is booting in to emergency mode: failed to mount /media/cdrom

9,098

This happen because your system, for some reason, attached /dev/sr0 to the /etc/fstab file. You need to disable this entry.

  • Boot your computer by recovery mode and go to root option;
  • type mount -o remount, rw / to allow write-permissions to / folder;
  • Edit /etc/fstab and comment line that references to /dev/sr0;
  • Save this file and reboot your system.
Share:
9,098

Related videos on Youtube

pavan
Author by

pavan

Updated on September 18, 2022

Comments

  • pavan
    pavan almost 2 years

    When I power on my PC, I get this error message:

    After logging in, type "journalctl -xb" to view system logs
    'systemctl 1 reboot' to reboot, 'systemctl 1 default' 
    or ^D to try again to boot into default mode.
    

    The output of journalctl -xb is as follows

    text including failed to mount /media/cdrom in red

    Where it is in red color I think it is the cause for the emergency mode.

    I am new to Ubuntu. I am using Ubuntu 16.04.

    The output of cat /etc/fstab is as follows:

    fstab contents with syntax highlighting - appears to be vim, not output of cat file as stated

    When I run the command vim /etc/fstab I got this message.

    325: ATTENTION
    Found a swap file by the name "/etc/.fstab.swp"
    owned by: root   dated: Tue Sep 12 18:39:36 2017
    file name: /etc/fstab
    modified: YES
    user name: root   host name: pavan-desktop
    process ID: 4439
    [not usable on this computer]
    
    While opening file "/etc/fstab"
                 dated: Mon Sep 11 19:21:36 2017
    
    
    (1) Another program may be editing the same file.  If this is the case,
        be careful not to end up with two different instances of the same
        file when making changes.  Quit, or continue with caution.
    
    (2) An edit session for this file crashed.
        If this is the case, use ":recover" or "vim -r /etc/fstab"
        to recover the changes (see ":help recovery").
        If you did this already, delete the swap file "/etc/.fstab.swp"
        to avoid this message.
    
    Swap file "/etc/.fstab.swp" already exists!
    [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
    
    Swap file "/etc/.fstab.swp" already exists!
    [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
    
    Swap file "/etc/.fstab.swp" already exists!
    [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort: 
    
    • Redbob
      Redbob over 6 years
      It seems your /etc/fstab file has cdrom on it, so it is depending on existing cdrom to complete boot operation. Could you post it? Type root password after the prompt, so type cat /etc/fstaband upload here.
    • pavan
      pavan over 6 years
      I uploaded the output of the command cat /etc/fstab above in the description.
    • Redbob
      Redbob over 6 years
      OK. comment the last line you have (put a # at beginning of /dev/sr0... line), save this file and reboot your computer.
    • pavan
      pavan over 6 years
      How to save it? I have opened vim /etc/fstab file I did as you said but after pressing shift+wq it not saving.
    • pavan
      pavan over 6 years
      While I am opening vim /etc/fstab i am getting some message the image of output in the description.
    • Redbob
      Redbob over 6 years
      That output suggests your file is read-only mode. You need to mount -o remount, rw / before open vim, to give write permissions to /etc/fstab. Don't bother, you need to save this change.
    • pavan
      pavan over 6 years
      Please can you explain me in step by step process