Results 1 to 9 of 9

Thread: edit fstab in recovery shell

  1. #1
    Join Date
    Apr 2011
    Beans
    8

    edit fstab in recovery shell

    Hey,
    I am stuck in recovery shell because I mistyped one line in the fstab file. I know what I did wrong but now I cant edit my fstab anymore. I can only enter recovery shell and thats it.
    sudo nano doesent work because it's a read only file / disk.
    So any idea is worth trying

  2. #2
    Join Date
    Aug 2006
    Beans
    13,178
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: edit fstab in recovery shell

    You get full root access in the recovery mode, so that
    Code:
    nano /etc/fstab
    should open the file for editing. No need for sudo because you are superuser in recovery already.

  3. #3
    Join Date
    Apr 2011
    Beans
    8

    Re: edit fstab in recovery shell

    I know, I have tried several times but when I exit it again its asks if I want to save, is say yes. But then it says cant safe, it is a read only file.
    I've tried to change any other file from the same disk but it says the same thing.

  4. #4
    Join Date
    Apr 2011
    Beans
    6

    Re: edit fstab in recovery shell

    Try using chmod (will it run in recovery shell properly?):

    Code:
    cd etc
    chmod a+w fstab
    Then try editing it. Just a thought.

  5. #5
    Join Date
    Aug 2006
    Beans
    13,178
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: edit fstab in recovery shell

    If every file is read only, it strongly implies that the file system is mounted as read only. If that is becasue of the change to fstab, you might be able to correct it by editing fstab from a live cd/usb. Another reason may be filesystem errors, in which case you should also use the cd/usb and run fsck.

  6. #6
    Join Date
    Apr 2011
    Beans
    8

    Re: edit fstab in recovery shell

    thanks for the reply's
    to bad it dident have any result
    Same problem over and over

    I even already tried with kernel, but then it puts me back into recovery shell :/

  7. #7
    Join Date
    Dec 2009
    Beans
    187

    Re: edit fstab in recovery shell

    Quote Originally Posted by Bolinga View Post
    I know, I have tried several times but when I exit it again its asks if I want to save, is say yes. But then it says cant safe, it is a read only file.
    I've tried to change any other file from the same disk but it says the same thing.
    When you boot in recovery mode, at the prompt (as root) type:

    Code:
    # mount -w -o  remount  /
    This will remount the file system in write mode, so you can edit the fstab file.

  8. #8
    Join Date
    Apr 2011
    Beans
    8

    Re: edit fstab in recovery shell

    HMmm...
    All of the above dident work :/
    But I managed to change my fstab bij starting ubuntu from the OS install cd.

    Rather weird that it is possible then :/
    soo thnxs

  9. #9
    Join Date
    Dec 2009
    Beans
    187

    Re: edit fstab in recovery shell

    Glad you got it working. The previous and the following commands worked fine for me, anyway assuming that /dev/sda1 is your main OS partition, you could have also tried:

    Code:
    # mount -w -o remount /dev/sda1 /
    Or the same thing, but written a bit differently:

    Code:
    # mount -o remount,rw /dev/sda1 /
    If your OS is on a different partition, then replace /dev/sda1 with the proper /dev/device_name. Check your /etc/fstab file.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •