LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2009, 07:32 PM   #1
jollibee
Member
 
Registered: Jul 2009
Distribution: Red Hat EL 5
Posts: 34

Rep: Reputation: 15
Unhappy Help Edit the /etc/fstab specifically the dump and fsck options


I made another mistake.

I thought I successfully mounted an external hard drive. But when I change /etc/fstab to make the mount permanent, I made a mistake in the 5th and 6th column (dump and fsck options). Now my computer doesn't want to go to the user-friendly thingy but wants "repair".

How can I edit /etc/fstab in the command-line window?

I put this wrong line in the /etc/fstab and I want to change it. How?

/dev/sdb1 /media/mynewdrive ext3 rw,acl,user_xattr 1 4

How can I edit? Thanks in advance.
 
Old 07-16-2009, 08:12 PM   #2
jollibee
Member
 
Registered: Jul 2009
Distribution: Red Hat EL 5
Posts: 34

Original Poster
Rep: Reputation: 15
Unhappy

Quote:
Originally Posted by jollibee View Post
I made another mistake.

I thought I successfully mounted an external hard drive. But when I change /etc/fstab to make the mount permanent, I made a mistake in the 5th and 6th column (dump and fsck options). Now my computer doesn't want to go to the user-friendly thingy but wants "repair".

How can I edit /etc/fstab in the command-line window?

I put this wrong line in the /etc/fstab and I want to change it. How?

/dev/sdb1 /media/mynewdrive ext3 rw,acl,user_xattr 1 4

How can I edit? Thanks in advance.
I was able to enter the editing mode in the command-line window (black one).

I change the dumb and fsck options from 1 4 to 0 2.

How do I exit this /etc/fstab file to go back to the root directory?

Please Help!
 
Old 07-16-2009, 08:30 PM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
That entirely depends on what editor you are using. How did you enter what you call "the editing mode"? What did you write?
 
Old 07-16-2009, 11:30 PM   #4
jollibee
Member
 
Registered: Jul 2009
Distribution: Red Hat EL 5
Posts: 34

Original Poster
Rep: Reputation: 15
Lightbulb

Quote:
Originally Posted by i92guboj View Post
That entirely depends on what editor you are using. How did you enter what you call "the editing mode"? What did you write?
Hi,

I got it!

To enter the file, I use vi editor:

# vi /etc/fstab

It enters the file. I was able to change column 5 and 6, i.e., 1 and 4 by putting the cursor under the number [4], hitting 'r' from keyboard and then change the number into [0] and so forth.

/dev/sdb1 /media/mynewdrive ext3 rw,acl,user_xattr 1 4

so this line change into:

/dev/sdb1 /media/mynewdrive ext3 rw,acl,user_xattr 0 0

then I was able to exit this /etc/fstab by typing ":x". This will save and exit the file.

In the process I created a lot of files:
/etc/.fstab.swp
/etc/.fstab.swj
/etc/.fstab.swl
/etc/.fstab.swm
/etc/.fstab.swn
/etc/.fstab.swo

so I delete the duplicate files one by one by:

# rm /etc/.fstab.sw* (do this command in all the duplicate files)

I check the revised file by this command:

# cat /etc/fstab

and it gives me the edited version.

# exit (Reboot the computer)

Last edited by jollibee; 07-16-2009 at 11:31 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run FSCK and error in FSTAB kc5hwb Ubuntu 5 04-12-2007 11:50 AM
dump command and /etc/fstab LinuxLover Linux - General 4 01-29-2006 02:13 AM
Edit boot options? ragnar86 Linux - Newbie 4 03-11-2005 03:45 AM
How do I edit /etc/fstab? linusownsme Linux - Software 9 03-05-2005 11:30 AM
Your /ect/fstab does not contain the fsck passno field LostinCode Mandriva 3 05-07-2004 03:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration