Results 1 to 5 of 5

Thread: Corrupted fstab

  1. #1
    Join Date
    Aug 2012
    Beans
    2

    Corrupted fstab

    I accidentally copied over five million lines of gibberish to my fstab file. After, also accidentally, rebooting, the hard drive won't mount and I'm stuck in a terminal. When running fsck it aborts, saying that the buffer limit is reached at just above 5100000. Can someone help me reset fstab?
    I'm using 12.04 64 bit.

  2. #2
    Join Date
    Oct 2011
    Location
    ZZ9 Plural Z Alpha
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Corrupted fstab

    Try booting from a live CD, mount the root partition, and run

    Code:
    less etc/fstab
    When you're in the mounted partition, it can give you an idea if it is salvageable (i.e., if it just has a bunch of gibberish appended to it).
    Last edited by cortman; August 24th, 2012 at 07:35 PM.

  3. #3
    Join Date
    Sep 2011
    Beans
    1,531

    Re: Corrupted fstab

    Wow. Can you use a live CD to run fsck?
    Last edited by Ms. Daisy; August 24th, 2012 at 07:23 PM. Reason: doh! ninja'd by cortman!

  4. #4
    Join Date
    Jul 2005
    Location
    England
    Beans
    13,598

    Re: Corrupted fstab

    The default fstab ion 12.04 looks like
    Code:
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    # / was on /dev/sda1 during installation
    UUID=01b9131d-43fe-4b4e-be2b-b319de5a898a /               ext4    errors=remount-ro 0       1
    # swap was on /dev/sda5 during installation
    UUID=1bfd912d-b6b6-4a68-9aaf-4139513772ec none            swap    sw              0       0
    /dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
    but with your own/dev/sdx# names and UUIDs for the various partitions, and probably no final line for a floppy disk (shown in red).

    If you have a separate /home partition you may need extra lines in the format
    Code:
    # /home was on /dev/sda2 during installation
    UUID=e2554df2-7e16-4864-97c9-834d8bebecda /home           ext4    defaults        0       2
    again with your own UUID for/home.

    You can find your own UUIDs from a live system by running
    Code:
    sudo blkid -c /dev/null
    and it may be worth trying your own UUID version of this fstab, if you can't edit out the gibberish that you added with a live CD, as suggested by cortman.

    I don't think running fsck from a live system will help as there is no filesystem corruption to worry about, just an incorrect fstab which is not allowing the system to boot.
    Last edited by ajgreeny; August 24th, 2012 at 08:35 PM.
    DISTRO: Xubuntu 12.04-64bit --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  5. #5
    Join Date
    Aug 2012
    Beans
    2

    Re: Corrupted fstab

    Thanks all! I've got it back up and everything seems to be working fine.

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
  •