LinuxQuestions.org
Help answer threads with 0 replies.
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 11-18-2012, 03:33 PM   #1
vincix
Member
 
Registered: Feb 2011
Posts: 47

Rep: Reputation: 0
editing fstab - mount point with spaces


I am trying to make my Centos linux to automount a ntfs partition and I want to mount point to be made of two words, such as:
/media/two\ words
The problem is that when I edit fstab with vim, the rest of the text (ntfs-3g rw etc.) is highlighted in red automatically and, of course, the partition isn't mounted automatically. Is there any way I can escape this other than with a simple backslash?

Thanks
 
Old 11-18-2012, 03:57 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,974

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
I'm not sure but you could try to put the complete path between quotes
Code:
"/media/two words"
Markus
 
Old 11-18-2012, 03:58 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,623
Blog Entries: 2

Rep: Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078Reputation: 4078
Have you tried it with "/media/two words" instead.
I can't really see why you would do something like that, it is inconvenient and leads to a lot of potential error cases.
And IMHO it is just bad style on a Linux/Unix machine.
 
Old 11-18-2012, 07:30 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,565

Rep: Reputation: 659Reputation: 659Reputation: 659Reputation: 659Reputation: 659Reputation: 659
You should be able to use "\nnn" octal escapes for problem characters. Those escapes are used in /etc/fstab, /etc/mtab, and /proc/mounts, which is why there is a wrapper fstab-decode to facilitate running programs that need fields from those files as arguments.
Code:
/dev/whatever  /media/two\040words  auto  defaults  0 0

Last edited by rknichols; 11-18-2012 at 07:38 PM. Reason: Bad quote mark
 
1 members found this post helpful.
Old 11-23-2012, 05:06 AM   #5
vincix
Member
 
Registered: Feb 2011
Posts: 47

Original Poster
Rep: Reputation: 0
with quotes

Quote:
Originally Posted by TobiSGD View Post
Have you tried it with "/media/two words" instead.
I can't really see why you would do something like that, it is inconvenient and leads to a lot of potential error cases.
And IMHO it is just bad style on a Linux/Unix machine.
It's not that I really want to do it - of course I can choose a single-worded mount point - I want to understand how linux interprets this and why seemingly it doesn't allow for two or more words.

I've tried using quotes, but vim highlights the rest of the sentence in red (beginning with rw,umask etc.). So that doesn't seem the right syntax.

Any other suggestions? Can't this be done? If it can't, I won't insist, obviously
 
Old 11-23-2012, 05:09 AM   #6
vincix
Member
 
Registered: Feb 2011
Posts: 47

Original Poster
Rep: Reputation: 0
octal codes

Quote:
Originally Posted by rknichols View Post
You should be able to use "\nnn" octal escapes for problem characters. Those escapes are used in /etc/fstab, /etc/mtab, and /proc/mounts, which is why there is a wrapper fstab-decode to facilitate running programs that need fields from those files as arguments.
Code:
/dev/whatever  /media/two\040words  auto  defaults  0 0
I think I had ignored your comment undeservedly So 040 octal code represents space, you're saying?

Ok, I'll try that and get right back to you.

Later edit:
Well, that really worked Thanks indeed, that was a really good idea!

The initial reason for editing this was that I had chosen the dropbox folder in a ntfs partition, which had a mounting point made of up two words (that was the name of the partition given in Windows). The problem was that every time I needed to mount it in gnome (centos) manually - the pattern was already given, I went to places, etc. - and dropbox gave an error, it didn't find the respective folder. And I wanted to have the partition mounted before dropbox started without changing the mountpoint. Of couse I could have reconfigured dropbox, but that was the whole idea. To solve the problem without "disturbing" dropbox.

Thanks, it's been a real odyssey :P

Last edited by vincix; 11-23-2012 at 05:16 AM. Reason: problem solution
 
  


Reply

Tags
fstab, ntfs3g


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
Redhat Linux 4.8 error -mount: mount point /oracle does not exist for new /etc/fstab entries bellnarm Linux - Server 1 11-23-2011 06:09 AM
[SOLVED] fstab, space in mount point/directory names? batfastad Linux - Newbie 2 11-25-2010 03:42 AM
Help editing fstab to mount hard drives ChootarLaal Ubuntu 22 03-08-2008 03:43 PM
smbfs, fstab, spaces in the folder i want to mount. Problems! JapanFred Linux - Networking 1 12-29-2005 04:27 PM
Editing fstab to mount devices? apachedude Suse/Novell 7 12-03-2004 05:35 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration