0

I wanted to change my fstab file to be able to solve "Error mounting" (I tried to delete the last line of fstab file)

# /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>
# / was on /dev/sda5 during installation
UUID=8a97edce-fb5d-4dfb-8843-1d6a8f40c8ed / ext4 errors=remount-ro 0 1
# /home was on /dev/sda7 during installation
UUID=20c4aa72-06e1-47eb-acae-2ca0a53ebc93 /home ext4 defaults 0 2
# swap was on /dev/sda6 during installation
UUID=638f2aee-806c-4845-bb1b-3bff47728184 none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
#/dev/sdb1 /media/usb0 auto rw,user,noauto 0 0

But now I need "permissions to save the file." How to do it?

2 Answers2

2

You can do this only as root. If you use vi as editor, try sudo vi /etc/fstab

dr0i
  • 250
  • 2
  • 11
0

The previous answer is your best bet, but you only need root access to change the file in /etc.

So you can copy the file to your home directory cp /etc/fstab ~, edit the copy to your hearts content and then you'll need superuser privileges to copy it back, if your system doesn't use sudo then use the su command:

$ su
Password: <your password here>
# cp fstab /etc/fstab
# exit

Keep in mind that in su mode the ~ represents root's home directory and not yours which is why the above example assumes that the current directory is the one with your edited fstab file in it.

Mike Lippert
  • 1,385