LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 12-12-2015, 04:05 AM   #1
bucovaina78
Member
 
Registered: Oct 2004
Location: Belgium / Antwerp
Distribution: Debian
Posts: 287

Rep: Reputation: 33
automount mountpoints disappearing


Or edit thread subject: add "not appearing at all" at the end of the title.
Hi all,

I'm playing around with automounter in Debian Jessie but I'm seeing some unexpected behaviour I can't quiet understand.

I have a few hard disks that I connect with a backplane to my workstation. So my setup would be to automount them and refer to them with UUID's since the device mapping sometimes changes.

So far so good but upon every exit of autofs, I see all the subdirectories under the main /media/backplane mount point disappearing. Also after a reboot I no longer see them. I can work around it by manually stopping autofs, recreating the sub directory (/media/backplane/raidbackup-a) and restarting autofs, then it works. But like that, there's not much auto in automounter ... .

Another strange thing, I rebooted in single user mode and low and behold, I can see the sub directories . Applying an immutable flag to them also did not help. I get the feeling automount is mounting some sort of file system over /media/backplane which could explain why directories get lost. But not why they are not created by automount. (OK, while writing this and copy-pasting /etc/mtab here, it seems to me like that's exactly what autofs is doing :-) )

Things I have tried so far:

* leaving out the UUID referrer so that I put /dev/md0 in the last field of /etc/auto.backplane.
* rebooting in the stock Debian kernel (I've compiled a stripped down kernel 4.3.0 myself)
* chown-ed the /media/backplane directory to my unprivileged user account
* made /etc/auto.master refer to a new directory /backplane in the root directory instead of /media/backplane. If the /backplane in root does not exist, it's not created when I start autofs, when I created it manually, it does not generate sub mount points.

But to no avail. I don't see what I'm doing wrong here.

/etc/auto.master:

Code:
/media/backplane     /etc/auto.backplane
/etc/auto.backplane:

Code:
backup		-fstype=ext4		:/dev/disk/by-uuid/de3dc8cc-ac19-46a6-9f4a-ec9e2019e0b4
bigdisk-a	-fstype=ext4		:/dev/disk/by-uuid/728744b8-8636-45b9-81da-63d9a544deb9
bigdisk-b	-fstype=ext4		:/dev/disk/by-uuid/4a3ad6e7-649e-40e4-ab18-ef7083b9ef8f
raidbackup-a	-fstype=ext4		:/dev/disk/by-uuid/2e724ec2-a254-4fc1-b5d1-c03f39488aa2
Debug output:
Code:
root@ganeymedes:/home/user# /etc/init.d/autofs stop
[ ok ] Stopping autofs (via systemctl): autofs.service.
root@ganeymedes:/home/wannes# automount -f -d -v
Starting automounter version 5.0.8, master map /etc/auto.master
using kernel protocol version 5.02
lookup_nss_read_master: reading master file /etc/auto.master
parse_init: parse(sun): init gathered global options: (null)
spawn_mount: mtab link detected, passing -n to mount
spawn_umount: mtab link detected, passing -n to mount
lookup_read_master: lookup(file): read entry /media/backplane
lookup_read_master: lookup(file): read entry +dir:/etc/auto.master.d
lookup_nss_read_master: reading master dir /etc/auto.master.d
lookup(dir): dir map /etc/auto.master.d missing or not readable
lookup(file): failed to read included master map dir:/etc/auto.master.d
lookup_read_master: lookup(file): read entry +auto.master
lookup_nss_read_master: reading master files auto.master
parse_init: parse(sun): init gathered global options: (null)
lookup(file): failed to read included master map auto.master
master_do_mount: mounting /media/backplane
automount_path_to_fifo: fifo name /var/run/autofs.fifo-media-backplane
lookup_nss_read_map: reading map file /etc/auto.backplane
parse_init: parse(sun): init gathered global options: (null)
spawn_mount: mtab link detected, passing -n to mount
spawn_umount: mtab link detected, passing -n to mount
remount_active_mount: trying to re-connect to mount /media/backplane
mounted indirect on /media/backplane with timeout 300, freq 75 seconds
remount_active_mount: re-connected to mount /media/backplane
st_ready: st_ready(): state = 0 path /media/backplane

^Cdo_notify_state: signal 2
master_notify_state_change: sig 2 switching /media/backplane from 1 to 5
st_prepare_shutdown: state 1 path /media/backplane
expire_proc: exp_proc = 139991209486080 path /media/backplane
expire_cleanup: got thid 139991209486080 path /media/backplane stat 0
expire_cleanup: sigchld: exp 139991209486080 finished, switching from 5 to 7
st_shutdown: state 5 path /media/backplane
umount_multi: path /media/backplane incl 0
umount_autofs_indirect: ask umount returned busy /media/backplane
umount_autofs_indirect: mount point /media/backplane is in use
automount_path_to_fifo: fifo name /var/run/autofs.fifo-media-backplane
failed to remove dir /media/backplane: Device or resource busy
shut down path /media/backplane
autofs stopped
root@ganeymedes:/home/user#
The relative part of the mounts as reported by /etc/mtab
Code:
/etc/auto.backplane /media/backplane autofs rw,relatime,fd=-1,pgrp=1272,timeout=300,minproto=5,maxproto=5,indirect 0 0
PS: An alternative would be to create an entry in /etc/fstab and use the "nobootwait" option, but that would not automatically mount disks after I have booted my workstation like USB-drives, so that would be a workaround but not an ideal one.

Last edited by bucovaina78; 12-12-2015 at 05:15 AM.
 
Old 12-12-2015, 05:29 AM   #2
bucovaina78
Member
 
Registered: Oct 2004
Location: Belgium / Antwerp
Distribution: Debian
Posts: 287

Original Poster
Rep: Reputation: 33
I commented out the directive:
Code:
+dir:/etc/auto.master.d/
Since the directory does not exist and autofs seems to bork on it somehow. Also I added a newline to the end of /etc/auto.backplane as suggested here in a note.

Still, does not work.

Code:
root@ganeymedes:/etc# automount -f -v -d
Starting automounter version 5.0.8, master map /etc/auto.master
using kernel protocol version 5.02
lookup_nss_read_master: reading master file /etc/auto.master
parse_init: parse(sun): init gathered global options: (null)
spawn_mount: mtab link detected, passing -n to mount
spawn_umount: mtab link detected, passing -n to mount
lookup_read_master: lookup(file): read entry /backplane
lookup_read_master: lookup(file): read entry +auto.master
lookup_nss_read_master: reading master files auto.master
parse_init: parse(sun): init gathered global options: (null)
lookup(file): failed to read included master map auto.master
master_do_mount: mounting /backplane
automount_path_to_fifo: fifo name /var/run/autofs.fifo-backplane
lookup_nss_read_map: reading map file /etc/auto.backplane
parse_init: parse(sun): init gathered global options: (null)
spawn_mount: mtab link detected, passing -n to mount
spawn_umount: mtab link detected, passing -n to mount
mounted indirect on /backplane with timeout 300, freq 75 seconds
st_ready: st_ready(): state = 0 path /backplane
 
Old 12-12-2015, 05:48 AM   #3
bucovaina78
Member
 
Registered: Oct 2004
Location: Belgium / Antwerp
Distribution: Debian
Posts: 287

Original Poster
Rep: Reputation: 33
And here's what happens if I manually create a subdirectory "argentastick" in /backplane (/backplane/argentastick, that is.

After having done the above, if I CTRL-C and autofs shuts down, I change nothing, restart automount as shown below, I no longer see /backplane/argentastick.


Code:
root@ganeymedes:/etc# automount -f -v -d
Starting automounter version 5.0.8, master map /etc/auto.master
using kernel protocol version 5.02
lookup_nss_read_master: reading master file /etc/auto.master
parse_init: parse(sun): init gathered global options: (null)
spawn_mount: mtab link detected, passing -n to mount
spawn_umount: mtab link detected, passing -n to mount
lookup_read_master: lookup(file): read entry /backplane
master_do_mount: mounting /backplane
automount_path_to_fifo: fifo name /var/run/autofs.fifo-backplane
lookup_nss_read_map: reading map file /etc/auto.backplane
parse_init: parse(sun): init gathered global options: (null)
spawn_mount: mtab link detected, passing -n to mount
spawn_umount: mtab link detected, passing -n to mount
remount_active_mount: trying to re-connect to mount /backplane
mounted indirect on /backplane with timeout 300, freq 75 seconds
remount_active_mount: re-connected to mount /backplane
st_ready: st_ready(): state = 0 path /backplane

handle_packet: type = 3
handle_packet_missing_indirect: token 2, name argentastick, request pid 2037
attempting to mount entry /backplane/argentastick
lookup_mount: lookup(file): looking up argentastick
lookup_mount: lookup(file): argentastick -> -fstype=auto,async,nodev,nosuid,umask=000		:/dev/disk/by-uuid/0071-BB6A
parse_mount: parse(sun): expanded entry: -fstype=auto,async,nodev,nosuid,umask=000		:/dev/disk/by-uuid/0071-BB6A
parse_mount: parse(sun): gathered options: fstype=auto,async,nodev,nosuid,umask=000
parse_mount: parse(sun): dequote(":/dev/disk/by-uuid/0071-BB6A") -> :/dev/disk/by-uuid/0071-BB6A
parse_mount: parse(sun): core of entry: options=fstype=auto,async,nodev,nosuid,umask=000, loc=:/dev/disk/by-uuid/0071-BB6A
sun_mount: parse(sun): mounting root /backplane, mountpoint argentastick, what /dev/disk/by-uuid/0071-BB6A, fstype auto, options async,nodev,nosuid,umask=000
do_mount: /dev/disk/by-uuid/0071-BB6A /backplane/argentastick type auto options async,nodev,nosuid,umask=000 using module generic
mount_mount: mount(generic): calling mkdir_path /backplane/argentastick
mount_mount: mount(generic): calling mount -t auto -s -o async,nodev,nosuid,umask=000 /dev/disk/by-uuid/0071-BB6A /backplane/argentastick
spawn_mount: mtab link detected, passing -n to mount
mount_mount: mount(generic): mounted /dev/disk/by-uuid/0071-BB6A type auto on /backplane/argentastick
dev_ioctl_send_ready: token = 2
mounted /backplane/argentastick
st_expire: state 1 path /backplane
expire_proc: exp_proc = 140325011539712 path /backplane
expire_proc_indirect: expire /backplane/argentastick
1 remaining in /backplane
expire_cleanup: got thid 140325011539712 path /backplane stat 3
expire_cleanup: sigchld: exp 140325011539712 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /backplane
 
Old 12-12-2015, 06:33 AM   #4
bucovaina78
Member
 
Registered: Oct 2004
Location: Belgium / Antwerp
Distribution: Debian
Posts: 287

Original Poster
Rep: Reputation: 33
Adding --ghost to the main directories as an option in /etc/auto.master fixed this.

I assumed autofs would create directories for the maps, mounted or not. Apparently that's not true. This lead me to see empty directories. Also <Tab> completion does not work. The thing that made me realize this is to manually type the entire directory. All of a sudden, the directory appeared to be there. My /etc/auto.master looks something like this now:

Code:
/media/backplane       auto.backplane       --ghost
It's the --ghost option that made autofs behave in the way I expect it to be handy in my situation.
 
  


Reply

Tags
autofs, automount, automounter


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
Unable to Automount ISO image unless automount is running in foreground! swests Linux - General 4 05-22-2009 12:47 AM
CentOS 5.2 Automount isos in fstab \other methods that work?automount iso Frankly3D Linux - General 6 07-13-2008 12:34 PM
NFS issues - mountpoints within mountpoints Gort32 Linux - General 1 08-12-2006 11:01 AM
Are these good mountpoints cheetahman SUSE / openSUSE 9 04-14-2005 11:21 AM
Linux 7.1 mountpoints Wolfie2001 Linux - Newbie 4 10-11-2001 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

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