Results 1 to 10 of 11

Thread: read-only root and can't edit fstab

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Beans
    6

    read-only root and can't edit fstab

    I don't know how it happened, but I was unable to boot into Ubuntu 9.1 today because the file system is now read only. When I check fstab, it shows "ro" but I can't change it because it's on a read only file system. I tried umounting the root then remounting with read/write access, but I was unable to umount the root. I also tried booting with a live CD, but all I can find is the root.disk file, I can't see any of the file structure. That's probably just how it is supposed to be, but I'm new to Linux so I found it strange.

    Can anyone suggest another method to either change the disk to read/write besides this?
    sudo umount /
    mount -o remount,rw /

    The other option would be to somehow mount the disk image while using a live CD so that I can get to the fstab file and (hopefully) edit it.

    Thanks for any suggestions.

  2. #2
    Join Date
    Nov 2007
    Beans
    586
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: read-only root and can't edit fstab

    You won't be able to unmount "/" when you are using it to boot; you will have to make your changes using a LiveCD/bootable pendrive. The default options for "/" (fstab file) are "errors=remount-ro", so it only mounts read-only when erros are present, try running a file system check (booting from LiveCD, without mounting it) with e2fsck (change your device accordingly):
    Code:
    $ e2fsck /dev/sda1

  3. #3
    Join Date
    Apr 2010
    Beans
    6

    Re: read-only root and can't edit fstab

    Thanks for the suggestion. When I run a live CD and use the command you suggested, I get:
    "Superblock invalid, tring backup blocks...
    Bad magic number in super block while trying to open /dev/sda1
    The superblock could not be read or does not describe a correct ext2 file system..."

    When I look at GParted, the two file systems are both NTFS. I have a root.disk image file under /ubuntu/disks that is the size of the file system created when I originally installed ubuntu.

    The disk has been failing (bad sectors) for months, so that maybe that's related to this problem, but I think it's probably something I changed without knowing when I was looking at the partitions before the problem started.

    Is there a way I could mount that image file to get to the files while using the live CD? I really don't understand how ubuntu is residing on an NTFS partition... but again, I am a linux newbie.

    Thanks

  4. #4
    Join Date
    Feb 2008
    Location
    Greece
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Exclamation Re: read-only root and can't edit fstab

    You don't describe your exact situation well enough for someone to be able to help you.
    Did you install Ubuntu with Wubi or is it a native install?
    What type of filesystem did you originally specify when you first installed Ubuntu?
    What exactly is this image file you want to mount?Is it a backup?If yes how you acquired it(what tools did you use?)
    Anyway a good place to start would be to start from Live CD as you did and type :

    Code:
    sudo fdisk -l
    to see all available partitions in your hard drive.
    and then run a sudo fsck /dev/sdxx according to what partition the previous command will point out as being your root partition.
    Also if you are able to mount eventually your / partition it would be nice to show us the /etc/fstab file and the output of the blkid command though I doubt it it's a fstab problem rather being a hard disk failure as you also suspect...

  5. #5
    Join Date
    Apr 2010
    Beans
    6

    Re: read-only root and can't edit fstab

    I apologize for my ignorance here. I'll try to give some background:

    I tried sudo fdisk -l and get the following results:

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 18650 149806093+ 7 HPFS/NTFS
    /dev/sda2 18651 19457 648227+ 7 HPFS/NTFS

    I installed from a live CD and I honestly don't recall what file system I setup at the time. Since neither of these partitions are ext3, maybe that means I used Wubi (though I never remembered seeing that term until you posted it).

    As for the image file, I guess I'm trying to understand what's going on when I boot into Ubuntu and where that directory structure resides. When I attempt to boot normally and end up at a terminal after the GUI load fails and has several error messages about a read only file system.

    The fstab file says this :
    UUID=19E45XXXXXXXXXXXX /host ntfs-3g defaults 0 0
    UUID=2CXXXXXXXXXXXXXXX / ntfs-3g users,ro 0 0

    Thanks
    (not actually X's, but I'm assuming that isn't important)

    I've copied all the files I care about to a backup drive, so I might just do a new installation, but now I'm not sure how to even do that as the live CD didn't give me the option of installing without formatting the drive.

  6. #6
    Join Date
    Jun 2006
    Location
    Texas
    Beans
    3,930
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: read-only root and can't edit fstab

    You have a WUBI (inside windows) install. Sorry - have not used it - it been said - easiest way to install Linux and the hardest to fix when things go wrong.

    Perhaps this will help WubiGuide - Ubuntu Wiki

    think this might be the section you want
    https://wiki.ubuntu.com/WubiGuide#Ho...on%27t%20boot?
    Last edited by louieb; April 20th, 2010 at 04:49 AM.
    UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn
    SystemRescueCd | Dual Boot | psychocats | FAQ

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
  •