LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   WARNING: Bad format on line 10 of /etc/fstab (https://www.linuxquestions.org/questions/linux-newbie-8/warning-bad-format-on-line-10-of-etc-fstab-48164/)

thetwin 03-04-2003 01:35 AM

WARNING: Bad format on line 10 of /etc/fstab
 
Hello

after unsuccessfully trying to install a second hard drive, I am getting these errors even though I have removed the drive and all references to it in /etc/fstab. At first I could not even boot the system as it kept dropping me to a shell with

Repair filesystem 1 #

Now I am able to boot the machine but I am getting these errors

WARNING: Bad format on line 10 of /etc/fstab
WARNING: Bad format on line 11 of /etc/fstab

twice in the boot sequence, first after "checking root filesystem" and then same 2 messages after "checking filesystems"

I have double checked /etc/fstab and cannot see any errors

I am unsure of how to repair this and any help would be appreciated.

Cheers

MasterC 03-04-2003 01:46 AM

Show us your /etc/fstab :)

Cool

thetwin 03-04-2003 02:10 AM

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/fd0 /mnt/floppy auto noauto,owner kudzu 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner kudzu,ro 0
0

exactly like that

Cheers

MasterC 03-04-2003 02:37 AM

Bring that last '0' up one row. Although that's nine, let's see what happens. Also, do you have a copy of what it looked like before?

Anyway, now it should look like this (after moving up the 0):
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/fd0 /mnt/floppy auto noauto,owner kudzu 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner kudzu,ro 0 0

:)

Cool

thetwin 03-04-2003 02:44 AM

Thanks, I'll give that a try. I was worried I did something when it kept dropping me to the line.

Repair filesystem 1 #

Being kinda new I did not know what to type and am still unsure of how I got back in. I think by typing login. Very frustrating and most of the places I search refer to full RH installs and this one is a firewall so I tried not to install anything not needed..anywhoo onward and upward. Still a blast to play with.

Cheers

thetwin 03-04-2003 02:47 AM

oops
 
Sorry forgot to answer the question, No I don't have a copy but after last night I will try to back up everything I can.

:newbie: :o

membrax 03-04-2003 02:54 AM

"Repair filesystem 1 #"

Got the same message later, one or two days ago.

Type "fsck /dev/hda1" without the quotes of course
It'll then check the integrity of your files and some kind of stuff.

When finished, do the same for /dev/hda2
... and maybe any other partition :
/dev/hda3
/dev/hda4

... or any other drive :
/dev/hdb1
/dev/hdb2

Give it a try, will fix some defect 'inodes"

Have fun,

thetwin 03-04-2003 04:16 PM

hmmm when I try to run fsck /dev/hda1 I get this kinda ominus warning

WARNING: Bad format on line 10 of /etc/fstab
WARNING: Bad format on line 11 of /etc/fstab

/dev/hda1 is mounted

WARNING!!! Running e2fsck on a mounted filesystem may cause SEVERE filesystem damage

Do you really want to continue y/n

:confused:

MasterC 03-04-2003 04:18 PM

NO...

Do not run fsck on a mounted partition. Either boot up with a rescue disc or another distro, or knoppix and run it with that if you choose.

So moving the 0 didn't help then?

Cool

Q*Bert 03-04-2003 04:21 PM

Sorry to butt in, but thetwin you really need to look at a book for this stuff, as there are some underlying concepts you need to know such as how the linux boots up etc.

You won't be dissappointed by investing in a good book - I still have all of my linux books and I use at least one of them at least once a day!

membrax 03-04-2003 04:27 PM

I used the command fsck /dev/hda1 which was a mounted partition, and (hopefully it seems) it ran nicely.

But if MasterC tells not to do it, just one advice : DO NOT DO IT.

Everyone knows that the advices coming from MasterC are always more than worthy. So I suggest to follow his advice. :D

trickykid 03-04-2003 04:30 PM

Quote:

Originally posted by Q*Bert
Sorry to butt in, but thetwin you really need to look at a book for this stuff, as there are some underlying concepts you need to know such as how the linux boots up etc.

You won't be dissappointed by investing in a good book - I still have all of my linux books and I use at least one of them at least once a day!

I don't know about you but this is a legitimate question and not that common. I would understand telling him to get a book or search if he was asking how to list files in a directory or copy files, something very basic. But we shouldn't tell members to just read a book to get their answer, that is not what this site is for, especially on a question like this.

lynch 03-04-2003 04:35 PM

You can also run fsck by rebooting from the CLI:
shutdown -rF now
It will run fsck for you upon reboot.
lynch

trickykid 03-04-2003 04:35 PM

If your familiar with vi try bringing up the file by typing vi /etc/fstab, it should look something like this:
Code:

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/fd0 /mnt/floppy auto noauto,owner kudzu 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner kudzu,ro 0 0
~
~
~

What you would be looking for is the ~ at the end. Are there any lines below the last /dev/cdrom.... that don't have a ~, which would look something like this:
Code:

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/fd0 /mnt/floppy auto noauto,owner kudzu 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner kudzu,ro 0 0


~
~

If so, try placing your block cursor as far down as you can go where there aren't any ~ and press dd to delete the lines. This might be the cause of your system recognizing lines that aren't really there with possibly a character that is not visible in the plain text file. Not sure if this will work, but you can always try renaming your old fstab file and rebuilding it, copying the contents you have in the old one to a new one..

Let us know!

acid_kewpie 03-04-2003 04:41 PM

either everyone else or I am missing somethign here:

/dev/cdrom /mnt/cdrom iso9660 noauto,owner kudzu,ro 0 0

should read

/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0

thetwin 03-04-2003 04:57 PM

Thanks for the responses, moving the 0 didn't do it and I think once I finish backing up some files I will try to redo /etc/fstab
completely and see what that does. Machine starts fine and is running however the error message still appears on boot. I will also try the fsch command with the rescue disk.

Q*Bert, you are right, my knowledge of the underlying principles in Linux are somewhat lacking..that is why I am using Linux and playing with Linux and asking questions about Linux. Books only are helpful to a certain degree and not everyone learns the same way. Some people can gather more from doing and asking than reading..and I figured all that out without a Masters degree :)

Texicle 03-04-2003 05:00 PM

Acid_kewpie, you beat me to it. I was also going to suggest actually looking in the /etc/fstab file to make sure there were no blank lines following the cdrom line. I didn't, however, notice the missing comma though. I'll keep a sharper eye out next time. Thanks for posting that follow-up. :D

Q*Bert 03-04-2003 05:27 PM

Quote:

Originally posted by thetwin
Books only are helpful to a certain degree and not everyone learns the same way. Some people can gather more from doing and asking than reading..and I figured all that out without a Masters degree :)
First off, a masters degree won't tell you much with what you want to know about computing. It's a research degree which means they choose what you study - the title of my masters was "Assessment of the Lyee set of tools for the development of an anxiety management system". Fascinating huh? Certainly not what you'd want to study and nothing to do with Linux unfortunately.

If none of the previous suggestions worked, I looked in my book "Red Hat Certified Engineer Linux Study Guide", Maine, Rafferty, Rogers et al, which 2000 does tell me that one of the main reasons the fstab will drop you down to a shell even when the system was cleanly unmounted, is that one of the filesystems specified in the third column of the fstab was the wrong fs type.

Are you sure the root partition is ext3 not ext2 ?

Q*Bert

thetwin 03-04-2003 05:54 PM

Got it. Trickykid was right and as soon as I opened VI I saw the missing tildes.. dd'ed those bastards and saved and rebooted and nio error messages and system is back to normal. I never use vi but I may try to start using it. Generally pico does the trick. Other than vi being much more flexible is there any reason not using pico to edit files?

Thanks to all that helped... 1 more thing learned...7 billion 4 hundred and 12 to go :)

Cheers

MasterC 03-04-2003 08:42 PM

Quote:

Originally posted by acid_kewpie
either everyone else or I am missing somethign here:

/dev/cdrom /mnt/cdrom iso9660 noauto,owner kudzu,ro 0 0

should read

/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0

Damnit... :)

Nice catch ;)

Also nice catch Drew, I wouldn't have thought of that one...

As far vi versus pico, pico will work for general editing. I prefer to edit my config files with vi, and all other general editing (of my html files and generic text files) with pico. However, you can make it work with config files as well, but vi(m) just works so much better without tricking it into working.

Good Luck, and have fun linuxing :)

thetwin 03-04-2003 09:38 PM

uhhh, I have been using pico to edit all files, am I supposed to be doing something different when using pico to edit say dhcpd.conf or such files. I just assumed that if you are editing a file the editor that you use is unimportant as long as the syntax is okay.

Cheers

trickykid 03-04-2003 09:56 PM

What can I say, I ROCK.. !! hehe..

MasterC 03-05-2003 12:55 AM

Quote:

Originally posted by thetwin
uhhh, I have been using pico to edit all files, am I supposed to be doing something different when using pico to edit say dhcpd.conf or such files. I just assumed that if you are editing a file the editor that you use is unimportant as long as the syntax is okay.

Cheers

Nah, you are usually ok, as long as the file isn't as strict as say /etc/fstab is. Vi just has a bit (especially the color version) more of a helping hand, and is the end all/do all editor. Pico allows alot of "slop" where vim requires you to actually know what you are doing, or it will show you it's wrong (well sorta, sorry, bad with words and analogies right now).

For the most part, you will be fine using Pico, however, if it's a very specific file, with very rigid params, you'd be better off using vi(m). If you are editing scripts, or if you are editing system config files that have scripts in them as a rule of thumb you should use vi. If you are editing free text fields, or a simple syntax config file, then pico should suffice.

Cool


All times are GMT -5. The time now is 07:08 PM.