LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-16-2013, 07:47 AM   #1
jdackle
Member
 
Registered: Apr 2010
Distribution: Debian, LMDE
Posts: 46

Rep: Reputation: 11
How to get a fuse-posixovl partition mounted at bootup?


Briefly:

This works on a running system:
Code:
sudo mount -t ntfs /dev/sdb1 /media/Users
sudo mount.posixovl /media/Users -- -o allow_other
But how can I get the same result using /etc/fstab to get that mount started when the system boots up?
(I suppose the most obvious answer will be similar to the one where you'd ask: How can I get those two lines condensed into a single mount command (NO pipes et al! )).
 
Old 11-20-2013, 02:07 AM   #2
jdackle
Member
 
Registered: Apr 2010
Distribution: Debian, LMDE
Posts: 46

Original Poster
Rep: Reputation: 11
After further investigation and testing, it seems to me (and I am by no means an expert, so please do take this with a grain of salt!) that mount.posixovl is incoherent in relation to standard Linux mount command invocation.

I did some testing with the options on /etc/fstab and the 'mount -a' command. Actually, the first odd thing came from issuing 'mount -av'.
But first things first. The concerning lines in my /etc/fstab were:
Code:
UUID=B892DAA092DA6304	/media/.Users	ntfs-3g	defaults,rw,locale=en_US.UTF-8	0	0
/media/.Users	/media/.Users	posixovl	rw,nosuid,relatime,user_id=0,group_id=0,default_permissions,allow_other	0	0
Issuing 'mount -av' results:
Code:
/sbin/mount.posixovl: invalid option -- 'v'
Usage: /sbin/mount.posixovl [-F] [-S source] mountpoint [-- fuseoptions]
As you can see, there is no '-v' option in the /etc/fstab line, so... What if you tried 'mount -a'? Results:
Code:
/sbin/mount.posixovl: invalid option -- 'o'
Usage: /sbin/mount.posixovl [-F] [-S source] mountpoint [-- fuseoptions]
Ha! The -v option was being passed to mount.posixovl by the mount -av command... Well, we won't need it on the /etc/fstab run at bootup... But now we have mount.posixovl complaining about a -o switch that doesn't appear in either /etc/fstab nor in the mount -a invocation?
I did a couple other (silly) tests ("random tries" would describe them better) but in the end I think the problem is just that the standard behaviour of the mount command and the /etc/fstab file is to pass whatever the options on the /etc/fstab standard location for them might be as a "mount -o [said_options]" to the mount helper (mount.posixovl in this case). In other words:
Code:
mount.posixovl /media/.Users -o [whatsoever_/etc/fstab_options]
In fact, one of my silly tests was to not give it any options in the /etc/fstab file and, not surprisingly, mount.posixovl still complained about it. That's, I conclude, because mount will always pass '-o' to its helper, even if it has no options to pass. mount.posixovl's '--' prefix to the -o option won't help in this scenario, as they will be passed as '-o -- -o'!
My regular ext4 partitions, as well as non-overlayed ntfs-3g ones (which get listed as fuseblk in my /proc/mounts, hence FUSE mounts) display no complaints about the options passed to them by /etc/fstab nor by mount directly, so I assume this is non-standard handling of parameters by mount.posixovl. To be noted, its -S and -F won't work with mount -a either as that's non-standard syntax too.
A pitty really, in an otherwise excelent program. I'll try and file a bug report against it later.

In the meantime, I did get myself a workaround!
I grabbed "my" /etc/init.d/fuse script (by Adam CÚcile) and changed it to have a new SysV init script (should still work under Systemd or Upstart, I believe) which I called jda-posixovl, which merely automatically does what I could already manually do on the console: mounts the POSIX overlay on the filesystem I need it on.
It's kind o a dirty hack, specially the error codes handling and the fact it mounts only one specific filesystem, whereas it could potentially look for any other non-POSIX mounted filesystem and apply the overlay to them. Possibly, even a daemon could be created to do that automatically to every non-POSIX filesystem that would happen to be mounted after bootup (USB pen-drives et al) - but this is way beyond my "programming" skills...
Still, it works for my current purposes. And, as such, might be useful to someone else as well; so I'm attaching it to this post. To use it, you'll need to remove the '.txt' extension, make it executable, move it to /etc/init.d and run your distro's init.d scripts updater; for Debian-based distros, that's:
Code:
sudo update-rc.d jda-posixovl defaults
Should you have any suggestions or improvements on it, I would very much appreciate it you share them back.

And, as I did solve my immediate issue, I'm marking this topic as solved.

EDIT: On my system, jda-posixovl got automatically placed into /etc/rcS.d (startup runlevel) as S22jda-posixovl, hence correctly after S21fuse and S11mountall.sh.
In rc0.d (poweroff runlevel) and rc6.d (reboot), it was placed as K01jda-posixovl, alphabetically after K01fuse (ideally it would be placed before but other than a possible warning return code for the posixovl mount to already have been unmounted, no probs AFAICT) and before K05umountnfs.sh, which is very important as the actual filesystem over which posixovl was mounted must be unmounted itself afterwards. The caveat is that both unmounts (posixovl and the base non-POSIX filesystem) are unmounted by the same exact command:
Code:
umount [original_mount_point]
Hence, unmounting through umountfs.sh might unmount the posix filesystem and if only after calling jda-posixovl, the original filesystem might not be unmounted because the overlay the script looks for would not be mounted anymore (there might be some sanity check in the generic unmounter, double-checking the unmount occurred, but I don't know)! AFAICT, update-rc.d set it up correctly for me. But should you use my script, you should make sure your generic unmount-all-filesystems is run after jda-posixovl, for safe-keeping.
DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Attached Files
File Type: txt jda-posixovl.txt (2.4 KB, 30 views)

Last edited by jdackle; 11-20-2013 at 04:20 PM. Reason: Concerns about possible mis-placement of the script in the rc?.d directories et al.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba: Permission denied only when mounting fuse partition iternity Linux - Server 0 06-08-2011 07:56 AM
FTP connections mounted via FUSE extension curlftpfs not unmounting with Nautilus FireLizzard Linux - Software 2 03-13-2010 02:37 PM
Is the disk partition mounted or not mounted? Kenarkies Linux - Kernel 3 01-16-2010 02:06 AM
HAL daemon does not reconize a mounted partition as mounted 888m Slackware 4 07-30-2007 12:58 PM
Fedora, Fuse, on boot windows partition mount beep-beep Linux - General 3 01-22-2007 02:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:02 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration