Find the answer to your Linux question:
Results 1 to 7 of 7
how do I save an amendment that I have made to the /etc/fstab file?...
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    4

    Smile how do I save an amendment that I have made to the /etc/fstab file?

    how do I save an amendment that I have made to the /etc/fstab file?

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568
    Have you edited fstab using vi editor? If you then use : x command in command mode to save and exit the file.

    For more on vi editor : -- run command,
    vimtutor
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  3. #3
    Just Joined!
    Join Date
    Mar 2010
    Posts
    4

    Talking

    Quote Originally Posted by Lakshmipathi View Post
    Have you edited fstab using vi editor? If you then use : x command in command mode to save and exit the file.

    For more on vi editor : -- run command,
    Thank you, I'll try that now.

  4. #4
    Just Joined!
    Join Date
    Mar 2010
    Posts
    4
    Quote Originally Posted by Lakshmipathi View Post
    Have you edited fstab using vi editor? If you then use : x command in command mode to save and exit the file.

    For more on vi editor : -- run command,

    Do you think you could tell me step by step how to run the x comand in vi
    I'm a newbie

  5. #5
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568
    # indicates comments
    $ indicate commands run on shell

    For example,
    I will open a file called file.txt
    $vi file.txt
    #Now you are into vi editor -
    #press "i" - you can see it saying something like insert mode is on.
    # then type somthing into it
    #now save and quit press "Esc" key and press : and press x and Enter
    #it should get back to shell
    $cat file.txt
    #should display the file content.

    There is an easy tutor program called "vimtutor" try it I like vimtutor
    Remember you need to have root access to edit fstab, always take a backup before editing important system files like fstab.
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    You must have root privileges to save changes in /etc/fstab.
    Execute su - command to gain root privileges. You can use nano editor to edit file.
    Code:
    su -
    nano /etc/fstab
    Press Ctrl+X, Y and hit Enter key to save file.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Linux User
    Join Date
    Sep 2008
    Location
    UK
    Posts
    353
    Everything in /etc is only editable by a root account. To make changes you have to edit it as root user.
    So as devils casper says, open a terminal and type su and give the root password.
    Then type nano (or gedit or any other text editor of choice)/etc/fstab.
    You will find that you can also open nautilus as a normal user and drag and drop the file onto a gedit window if this makes it easier for you..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •