LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 02:33 PM   #1
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
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, 02:57 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
I'm not sure but you could try to put the complete path between quotes
Code:
"/media/two words"
Markus
 
Old 11-18-2012, 02:58 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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, 06:30 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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 06:38 PM. Reason: Bad quote mark
 
1 members found this post helpful.
Old 11-23-2012, 04:06 AM   #5
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
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, 04:09 AM   #6
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
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 04:16 AM. Reason: problem solution
 
  


Reply

Tags
fstab, ntfs3g



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 05:09 AM
[SOLVED] fstab, space in mount point/directory names? batfastad Linux - Newbie 2 11-25-2010 02:42 AM
Help editing fstab to mount hard drives ChootarLaal Ubuntu 22 03-08-2008 02:43 PM
smbfs, fstab, spaces in the folder i want to mount. Problems! JapanFred Linux - Networking 1 12-29-2005 03:27 PM
Editing fstab to mount devices? apachedude SUSE / openSUSE 7 12-03-2004 04:35 AM

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

All times are GMT -5. The time now is 05:26 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