Linux - NewbieThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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
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
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.