View Full Version : [SOLVED] Why can't I edit fstab?
manwood
May 26th, 2010, 10:14 PM
I have just setup a dual boot with windows 7 and ubuntu 10.04. The windows partitions have been mounted and appear in the places menu and on the desktop. I want to remove them - I definitely don't want to be accidentally tampering with windows partitions outside of windows. So.. I tried just unmounting them, but get an error. I have tried commenting out the relevant lines in fstab, but I cannot save the file as I don't have permissions - why do I not? I'm admin surely? How can I edit this file?
Thanks
-humanaut-
May 26th, 2010, 10:16 PM
sudo nano /etc/fstab
that should do the trick.
drs305
May 26th, 2010, 10:19 PM
Looks like it's time to dust off this classic:
https://help.ubuntu.com/community/RootSudo
Even though you may be the only person using the computer, to change system files you have to gain temporary privileges to do so. The above post describes this aspect of Linux.
TheStroj
May 26th, 2010, 10:21 PM
Exactly as -humanaut- said. You must edit file as root. For easier editing you can also do 'sudo gedit /etc/fstab'
GSF1200S
May 26th, 2010, 10:25 PM
sudo nano /etc/fstab
that should do the trick.
Just to add to this comment: you can substitute 'nano' for any text editor of your choice. Technically, for root priveledges when running a GUI application, you would use gksu:
gksu gedit /etc/fstab
nano is a command line based editor that aims to be simple to use. The above commands basically equate to the following:
sudo nano /etc/fstab
as super-user (root) do >> open application nano >> to location /etc/fstab.
Maybe you already know all this, but perhaps it will help someone :)
lil0tik
May 26th, 2010, 10:27 PM
And, just to add a touch more...
You'll need to "sudo [favorite text editor] [filename]" for any file that is not in your home directory.
fooman
May 26th, 2010, 10:28 PM
Exactly as -humanaut- said. You must edit file as root. For easier editing you can also do 'sudo gedit /etc/fstab'
to expand a little on that: when using a graphical file editor as root, you should use gksudo:
gksudo gedit /etc/fstabsave regular sudo for command line editing (like nano).
an expalnation is in the link that drs305 posted above (see: graphical sudo).
EDIT: sorry, already posted above by GFS1200S ...i type sooo slow.
bodhi.zazen
May 26th, 2010, 11:02 PM
sudo nano /etc/fstab
that should do the trick.
For the lazy typer :twisted:
sudo -e /etc/fstab
manwood
May 26th, 2010, 11:12 PM
Thanks for the quick and helpful responses guys, great stuff :)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.