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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-18-2012, 02:33 PM
|
#1
|
|
Member
Registered: Feb 2011
Posts: 30
Rep:
|
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
|
|
|
|
11-18-2012, 02:57 PM
|
#2
|
|
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,856
|
I'm not sure but you could try to put the complete path between quotes Markus
|
|
|
|
11-18-2012, 02:58 PM
|
#3
|
|
Moderator
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 12,120
|
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.
|
|
|
|
11-18-2012, 06:30 PM
|
#4
|
|
Member
Registered: Aug 2009
Distribution: CentOS
Posts: 689
|
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.
|
11-23-2012, 04:06 AM
|
#5
|
|
Member
Registered: Feb 2011
Posts: 30
Original Poster
Rep:
|
with quotes
Quote:
Originally Posted by TobiSGD
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 
|
|
|
|
11-23-2012, 04:09 AM
|
#6
|
|
Member
Registered: Feb 2011
Posts: 30
Original Poster
Rep:
|
octal codes
Quote:
Originally Posted by rknichols
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
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:51 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|