I'm trying to add a long list of mount options in my fstab, and break the entry over 2 lines, as it goes off screen.
Taking this as an example:
# This works # #/dev/hda9 # original settings # LABEL=downloads /downloads ext3 defaults 1 2
# This doesn't work # #/dev/hda9 # new options LABEL=downloads /downloads \ ext3 defaults 1 2
Using the '' character at the end of the line in the above example gives the following error message at boot time:
Mounting local filesystems: mount: unknown filesystem type '' mount point defaults does not exist.
Is it possible to make multiple line entries like this in fstab, or not?
Kind Regards,
Keith Roberts
----------------------------------------------------------------- Websites: http://www.karsites.net http://www.php-debuggers.net http://www.raised-from-the-dead.org.uk
All email addresses are challenge-response protected with TMDA [http://tmda.net] -----------------------------------------------------------------
Keith Roberts wrote:
I'm trying to add a long list of mount options in my fstab, and break the entry over 2 lines, as it goes off screen.
Taking this as an example:
# This works # #/dev/hda9 # original settings # LABEL=downloads /downloads ext3 defaults 1 2
# This doesn't work # #/dev/hda9 # new options LABEL=downloads /downloads \ ext3 defaults 1 2
Using the '' character at the end of the line in the above example gives the following error message at boot time:
<snip> Just a thought: go into vi, cursor down to the line, and hit $, and see where the actual end of the line is. If there's whitespace *after* the , it won't work.
mark
On Wed, 5 Jan 2011, m.roth@5-cent.us wrote: *snip*
# This doesn't work # #/dev/hda9 # new options LABEL=downloads /downloads \ ext3 defaults 1 2
Using the '' character at the end of the line in the above example gives the following error message at boot time:
<snip> Just a thought: go into vi, cursor down to the line, and hit $, and see where the actual end of the line is. If there's whitespace *after* the \, it won't work.
No there's not Mark.
Just 0x0A
Keith
----------------------------------------------------------------- Websites: http://www.karsites.net http://www.php-debuggers.net http://www.raised-from-the-dead.org.uk
All email addresses are challenge-response protected with TMDA [http://tmda.net] -----------------------------------------------------------------
On Wed, 5 Jan 2011, Keith Roberts wrote:
I'm trying to add a long list of mount options in my fstab, and break the entry over 2 lines, as it goes off screen.
The fstab(5) man page mentions comments but no line-break mechanism.
I suspect your best friend in this case is a widescreen terminal emulator. :-)
On Wed, 2011-01-05 at 19:16 +0000, Keith Roberts wrote:
I'm trying to add a long list of mount options in my fstab, and break the entry over 2 lines, as it goes off screen.
$ man fstab /line
Each filesystem is described on a separate line;
Regards, Leonard.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Leonard den Ottolander Sent: Wednesday, January 05, 2011 3:39 PM To: CentOS mailing list Subject: Re: [CentOS] fstab multiple line entries?
On Wed, 2011-01-05 at 19:16 +0000, Keith Roberts wrote:
I'm trying to add a long list of mount options in my fstab,
and break
the entry over 2 lines, as it goes off screen.
$ man fstab /line
Each filesystem is described on a separate line;
This is ambiguous as it stands; many tools understand 'line continuation' by a '\n' meaning multiple human-readable-lines treated as a single input line, however it appears fstab (meaning the tools that read it) do not promise to abide this continue-the-previous-line tradition.
Perhaps http://linux.die.net/man/3/getmntent has useful info, but the man pages are about as ambiguous on this detail as anything I've seen. "The proper way to read records from fstab is to use the routines getmntent(3)" is about as ... as ...
For further mudification, see http://www.linux-faqs.com/man/htmlman3/getmntent.3.html Zealously masochistic types can ref http://docs.sun.com/app/docs/doc/821-1465/getmntent-3c?l=en&n=1&a=vi... as well.
Nobody gives a clear answer to your question, so I suppose any flavor of Linux can do any thing it pleases, and can alternate whether it does or does not honor the '\n' tradition on alternate releases. ******************************************************************* This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept for the presence of computer viruses. www.Hubbell.com - Hubbell Incorporated**
On 1/5/2011 2:58 PM, Brunner, Brian T. wrote:
On Wed, 2011-01-05 at 19:16 +0000, Keith Roberts wrote:
I'm trying to add a long list of mount options in my fstab,
and break
the entry over 2 lines, as it goes off screen.
$ man fstab /line
Each filesystem is described on a separate line;
This is ambiguous as it stands; many tools understand 'line continuation' by a '\n' meaning multiple human-readable-lines treated as a single input line, however it appears fstab (meaning the tools that read it) do not promise to abide this continue-the-previous-line tradition.
I think it is more common for a '' at the end of line to escape the usual meaning of the newline and have it interpreted as white space, but I don't know if fstab is parsed that way. Usually the convention only matters if you are going to mail the content or send it through other mechanisms that likely to reformat it.
But, there is a more basic problem if the editor used to make this change doesn't wrap to the next screen line so you can edit without introducing a newline into the content. I thought they've all done that for decades.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Les Mikesell Sent: Wednesday, January 05, 2011 4:20 PM To: centos@centos.org Subject: Re: [CentOS] fstab multiple line entries?
On 1/5/2011 2:58 PM, Brunner, Brian T. wrote:
On Wed, 2011-01-05 at 19:16 +0000, Keith Roberts wrote:
I'm trying to add a long list of mount options in my fstab,
and break
the entry over 2 lines, as it goes off screen.
$ man fstab /line
Each filesystem is described on a separate line;
This is ambiguous as it stands; many tools understand 'line continuation' by a '\n'
I think it is more common for a '' at the end of line to
I did mis-type that, sorry.
I don't know if fstab is parsed that way.
Docs are ambiguous on this point.
But, there is a more basic problem if the editor used to make this change doesn't wrap to the next screen line so you can edit without introducing a newline into the content. I thought they've all done that for decades.
OP wants to use 1+ lines joined by '' to be read as one line by mount(8) et amice so that horizontal scrolling and automagic wrapping aren't needed. Multiple lines of wrapped text are an ugly read. ******************************************************************* This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept for the presence of computer viruses. www.Hubbell.com - Hubbell Incorporated**
On Wed, 5 Jan 2011, Brunner, Brian T. wrote:
To: CentOS mailing list centos@centos.org From: "Brunner, Brian T." BBrunner@gai-tronics.com Subject: Re: [CentOS] fstab multiple line entries?
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Leonard den Ottolander Sent: Wednesday, January 05, 2011 3:39 PM To: CentOS mailing list Subject: Re: [CentOS] fstab multiple line entries?
On Wed, 2011-01-05 at 19:16 +0000, Keith Roberts wrote:
I'm trying to add a long list of mount options in my fstab,
and break
the entry over 2 lines, as it goes off screen.
$ man fstab /line
Each filesystem is described on a separate line;
This is ambiguous as it stands; many tools understand 'line continuation' by a '\n' meaning multiple human-readable-lines treated as a single input line, however it appears fstab (meaning the tools that read it) do not promise to abide this continue-the-previous-line tradition.
Perhaps http://linux.die.net/man/3/getmntent has useful info, but the man pages are about as ambiguous on this detail as anything I've seen. "The proper way to read records from fstab is to use the routines getmntent(3)" is about as ... as ...
For further mudification, see http://www.linux-faqs.com/man/htmlman3/getmntent.3.html Zealously masochistic types can ref http://docs.sun.com/app/docs/doc/821-1465/getmntent-3c?l=en&n=1&a=vi... as well.
Nobody gives a clear answer to your question, so I suppose any flavor of Linux can do any thing it pleases, and can alternate whether it does or does not honor the '\n' tradition on alternate releases.
No, it looks like mount does not recognise the '' character as an escape character.
Thanks for all the replies to my question.
I'll just have to put things all on one line.
Kind Regards,
Keith
----------------------------------------------------------------- Websites: http://www.karsites.net http://www.php-debuggers.net http://www.raised-from-the-dead.org.uk
All email addresses are challenge-response protected with TMDA [http://tmda.net] -----------------------------------------------------------------
On Wed, 5 Jan 2011, Leonard den Ottolander wrote: *snip*
$ man fstab /line
Each filesystem is described on a separate line;
Yes. Thankyou Leonard.
Maybe mount needs coding to recognise some sort of escape character, similar to the way bash does?
Keith
----------------------------------------------------------------- Websites: http://www.karsites.net http://www.php-debuggers.net http://www.raised-from-the-dead.org.uk
All email addresses are challenge-response protected with TMDA [http://tmda.net] -----------------------------------------------------------------
On Wed, Jan 05, 2011 at 09:39:06PM +0100, Leonard den Ottolander wrote:
On Wed, 2011-01-05 at 19:16 +0000, Keith Roberts wrote:
I'm trying to add a long list of mount options in my fstab, and break the entry over 2 lines, as it goes off screen.
$ man fstab /line
Each filesystem is described on a separate line;
eg. Don't break the lines. Let them wrap.
////jerry
Regards, Leonard.
-- mount -t life -o ro /dev/dna /genetic/research
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos