Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Deleted everything in /etc/fstab , help?

  1. #1
    Join Date
    Mar 2013
    Beans
    7

    Question Deleted everything in /etc/fstab , help?

    Hello,

    I did something very stupid as I know very little about Ubuntu. I tried to add a rule to /etc/fstab but ended up deleting everything (and I think I saved it to). Now, when I go back and check the file I see that it's empty. I still didn't reboot, I am typing this thread from my system at this very moment. Can someone tell me how to undo the changes I made, or does someone know about a way of changing the file back? I still didn't reboot, so I think that there has to be a way of reading all my mounted partitions and add them to fstab, or am I wrong?

    Can someone please reply? Thank you in advance.

  2. #2
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Deleted everything in /etc/fstab , help?

    Can you post the output of the following commands please and I'll get back to you with a correct fstab file.
    Code:
    mount
    sudo blkid -c /dev/null
    Cheesemill

  3. #3
    Join Date
    Mar 2013
    Beans
    7

    Re: Deleted everything in /etc/fstab , help?

    This is the output generated:

    /dev/sda3 on / type ext4 (rw,errors=remount-ro)
    proc on /proc type proc (rw,noexec,nosuid,nodev)
    sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
    none on /sys/fs/fuse/connections type fusectl (rw)
    none on /sys/kernel/debug type debugfs (rw)
    none on /sys/kernel/security type securityfs (rw)
    udev on /dev type devtmpfs (rw,mode=0755)
    devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
    tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
    none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
    none on /run/shm type tmpfs (rw,nosuid,nodev)
    /dev/sda4 on /media/sda4 type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permis sions,blksize=4096)
    gvfs-fuse-daemon on /home/someone/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=someone)
    /dev/sda2 on /media/System type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,b lksize=4096)



    Although I have to say that I don't see another partition ntfs named Data in this information. I have a dual boot with Windows 7.
    Thank you for your help!

  4. #4
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Deleted everything in /etc/fstab , help?

    Can you post the output of the second command I asked for as well please.
    Cheesemill

  5. #5
    Join Date
    Mar 2013
    Beans
    7

    Re: Deleted everything in /etc/fstab , help?

    The second command gives me no output. Nothing happens?

    Edit:
    Sorry my bad, I should run it as root of course.

    This is first output:
    /dev/sda3 on / type ext4 (rw,errors=remount-ro)
    proc on /proc type proc (rw,noexec,nosuid,nodev)
    sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
    none on /sys/fs/fuse/connections type fusectl (rw)
    none on /sys/kernel/debug type debugfs (rw)
    none on /sys/kernel/security type securityfs (rw)
    udev on /dev type devtmpfs (rw,mode=0755)
    devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
    tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
    none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
    none on /run/shm type tmpfs (rw,nosuid,nodev)
    /dev/sda4 on /media/sda4 type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permis sions,blksize=4096)
    gvfs-fuse-daemon on /home/someone/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=someone)
    /dev/sda2 on /media/System type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,b lksize=4096)

    second output:
    /dev/sda1: UUID="620AD03B0AD00DC3" TYPE="ntfs"
    /dev/sda2: LABEL="System" UUID="B282D56882D53219" TYPE="ntfs"
    /dev/sda3: UUID="2d48f0a4-2b3b-4a33-b612-8f2e217794fb" TYPE="ext4"
    /dev/sda4: LABEL="Data" UUID="1820EEF620EEDA30" TYPE="ntfs"
    Last edited by mocroboy; March 25th, 2013 at 11:38 PM.

  6. #6
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Deleted everything in /etc/fstab , help?

    How about just...
    Code:
    sudo blkid
    Or if that still doesn't work can you post the output of...
    Code:
    sudo lsblk -f
    Cheesemill

  7. #7
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Deleted everything in /etc/fstab , help?

    OK then, this should do you...
    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>
    UUID=2d48f0a4-2b3b-4a33-b612-8f2e217794fb	/		ext4	errors=remount-ro		0	1
    You don't appear to have a swap partition, is this correct?
    Cheesemill

  8. #8
    Join Date
    Mar 2013
    Beans
    7

    Re: Deleted everything in /etc/fstab , help?

    That's true, I don't. The problems began when I was trying to add a swap file . How can I edit the file? Can I do it with gedit, because with the terminal everything went wrong? And shouldn't there be something like the names of all my partitions in your fstab?

  9. #9
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Deleted everything in /etc/fstab , help?

    You can edit your fstab using gedit with the command...
    Code:
    gksudo gedit /etc/fstab
    The best method to refer to partitions is by using their UUID instead of using /dev/sda3 as UUID's are guaranteed not to change, whereas the device name can change between reboots. You could use the partition label instead, but you don't have one for your /dev/sda3 partition.
    Cheesemill

  10. #10
    Join Date
    Mar 2013
    Beans
    7

    Re: Deleted everything in /etc/fstab , help?

    Edit:
    Ok, now I understand. But would my drives automatically mount when I only paste your solution? I mean, would my other partitions be recognized when using your solution? I was thinking about the following, but can't tell what should be at the question marks?:

    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>
    
    UUID=620AD03B0AD00DC3                                                                           ntfs                  ????????                     ?                    ?
    UUID=B282D56882D53219                                          /media/system           ntfs                 ??????                          ?                    ?
    UUID=2d48f0a4-2b3b-4a33-b612-8f2e217794fb     /                                     ext4                errors=remount-ro     0                    1
    UUID=1820EEF620EEDA30                                         /media/sda4               ntfs                  ????                              ?                    ?
    Sorry, I know I'm terrible with editing
    Last edited by mocroboy; March 26th, 2013 at 12:16 AM.

Page 1 of 2 12 LastLast

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
  •