Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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.
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.
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
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.
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
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.