How do I edit etc/fstab in terminal?

Asked by Ross Schoenauer

I type sudo gedit /etc/fstab in terminal and get error saying command not found. Using Ubuntu 7.04 What am I dooing wrong ?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Bhavani Shankar
Solved:
Last query:
Last reply:
Revision history for this message
shclim (shclim) said :
#1

Maybe you have a problem/bug in gedit? try to use another text editor, "nano" or "vi"

sudo vi /etc/fstab

Revision history for this message
Bhavani Shankar (bhavi) said :
#2

Use sudo nano /etc/fstab or gksudo gedit /etc/fstab

Revision history for this message
Ross Schoenauer (ross-s) said :
#3

Scott Hosking wrote:
> Your question #12050 on gnome-terminal in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/12050
>
> Status: Open => Answered
>
> Scott Hosking proposed the following answer:
> Maybe you have a problem/bug in gedit? try to use another text editor,
> "nano" or "vi"
>
> sudo vi /etc/fstab and get this information:
>
# /etc/fstab: static file system information.
#
# -- This file has been automaticly generated by ntfs-config --
#
# <file system> <mount point> <type> <options> <dump> <pass>

proc /proc proc defaults 0 0
# Entry for /dev/hda3 :
UUID=c7cc0866-581a-439a-bf23-a0a6184a1308 / ext3
defaults,errors=remount-ro 0 1
# Entry for /dev/hda5 :
UUID=fae5081c-09ea-412e-a3e4-43558a35ba6d none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
~

~

~

~

~

~

~

~

~

~

~

/dev

then /I enter: /dev/sda1/ /directory_to_mount/ ext3 default,user 0 1
and hit enter and get this info:

/# /etc/fstab: static file system information.
#
# -- This file has been automaticly generated by ntfs-config --
#
# <file system> <mount point> <type> <options> <dump> <pass>

proc /proc proc defaults 0 0
# Entry for /dev/hda3 :
UUID=c7cc0866-581a-439a-bf23-a0a6184a1308 / ext3
defaults,errors=remount-ro 0 1
# Entry for /dev/hda5 :
UUID=fae5081c-09ea-412e-a3e4-43558a35ba6d none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
~

~

~

~

~

~

~

~

~

~

~

/dev

with the curser un the /dev statment in #entry line, like I did a
search. The fstab does not change.

Thanks for the help.

I enter /dev/sda1/ /directory_to_mount/ ext3 default,user 0 1

Revision history for this message
Matt Mossholder (matt-mossholder) said :
#4

Ross,

    If you are unfamiliar with vi, you might want to use nano, as suggested earlier. While vi is common, and powerful, it isn't something to jump into without a reference handy :)

    The reason that the cursor moved under /dev like you did a search, is that you did... "/" in vi is the search key.

    --Matt

Revision history for this message
Ross Schoenauer (ross-s) said :
#5

Matt Mossholder wrote:
> Your question #12050 on gnome-terminal in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/12050
>
> Status: Open => Answered
>
> Matt Mossholder proposed the following answer:
> Ross,
>
> If you are unfamiliar with vi, you might want to use nano, as
> suggested earlier. While vi is common, and powerful, it isn't something
> to jump into without a reference handy :)
>
> The reason that the cursor moved under /dev like you did a search,
> is that you did... "/" in vi is the search key.
>
>
> --Matt
>
See terminal window below
> GNU nano 2.0.2 File: /etc/fstab Modified
>
> # /etc/fstab: static file system information.
> #
> # -- This file has been automaticly generated by ntfs-config --
> #
> # <file system> <mount point> <type> <options> <dump> <pass>
>
> proc /proc proc defaults 0 0
> # Entry for /dev/hda3 :
> UUID=c7cc0866-581a-439a-bf23-a0a6184a1308 / ext3 defaults,errors=remount-ro 0 1
> # Entry for /dev/hda5 :
> UUID=fae5081c-09ea-412e-a3e4-43558a35ba6d none swap sw 0 0
> /dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
> /dev/sda1/ /directory_to_mount/ ext3 default,user 0 1 {comment: I add this line and press enter and all that happens is the curser moves down one line. What am I doing wrong?}
>
> Thanks Ross
>
>
>
>
>
>
>
> ^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
> ^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text^T To Spell
>
>
>

Revision history for this message
Bhavani Shankar (bhavi) said :
#6

You have to press cntrl+x that will invoke the exit command.. Befofore exiting it will ask you to save the file Modified (if you have done so) and then press <enter> to go back to the terminal.. (pressing enter after entering a line in nano moves the cursor down by one line.)
Regards,
Bhavani Shankar.

Revision history for this message
Ross Schoenauer (ross-s) said :
#7

Bhavani Shankar wrote:
> Your question #12050 on gnome-terminal in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/12050
>
> Status: Open => Answered
>
> Bhavani Shankar proposed the following answer:
> You have to press cntrl+x that will invoke the exit command.. Befofore exiting it will ask you to save the file Modified (if you have done so) and then press <enter> to go back to the terminal.. (pressing enter after entering a line in nano moves the cursor down by one line.)
> Regards,
> Bhavani Shankar.
>
>
Thank you one and all, that worked. I am 78 years old and have been
using computers sense befor the dos days. I love Ubuntu and will never
go back to windows. All you people rock.

Revision history for this message
Best Bhavani Shankar (bhavi) said :
#8

Please tag this question as solved by clicking "This solved My problem" in the Right side corner of the answer. Cheers,
Bhavani Shankar.

Revision history for this message
Ross Schoenauer (ross-s) said :
#9

Thanks Bhavani Shankar, that solved my question.