Hello - I am running OpenSuSE Leap 15.2 and am encountering a problem with doing an rbind mount on the root / directory that I cannot find a solution to. I run a SOHO network and only my wife and I are users. (She is NOT Linux savoy so not a threat! LOL) In my /etc/fstab file I mount the root / directory at /slash using the following configuration -
/slash none rbind,x-systemd.automount,x-systemd.idle-timeout=300 0 0
The trouble I am having occurs when I try to set up a relative link in a sub-directory that uses slash. So for example I have a directory at /srv/samba/etc as accessed and shown here -
marcslaptop:~ # cd /srv/samba/etc/ marcslaptop:/srv/samba/etc # ll total 20 lrwxrwxrwx 1 root root 20 Jun 11 09:17 dhcp.conf -> /etc/samba/dhcp.conf lrwxrwxrwx 1 root root 32 Jun 13 14:52 lmhosts -> ../../../slash/etc/samba/lmhosts lrwxrwxrwx 1 root root 33 Jun 12 22:21 smb.conf -> ../../../slash/etc/samba/smb.conf lrwxrwxrwx 1 root root 27 Jun 13 15:34 smbusers -> ../../../etc/samba/smbusers
and all is fine and works as expected. However if I cd to this same directory via the /slash mount things go to pot! -
marcslaptop:/srv/samba/etc # cd /slash/srv/samba/etc/ marcslaptop:/slash/srv/samba/etc # ll total 20 lrwxrwxrwx 1 root root 20 Jun 11 09:17 dhcp.conf -> /etc/samba/dhcp.conf lrwxrwxrwx 1 root root 32 Jun 13 14:52 lmhosts -> ../../../slash/etc/samba/lmhosts <-- Highlighted in red lrwxrwxrwx 1 root root 33 Jun 12 22:21 smb.conf -> ../../../slash/etc/samba/smb.conf <-- Highlighted in red lrwxrwxrwx 1 root root 27 Jun 13 15:34 smbusers -> ../../../etc/samba/smbusers
The color coding is missing but it shows that the links for lmhosts and smb.conf are broken. I can demonstrate this -
marcslaptop:/slash/srv/samba/etc # more smb.conf more: stat of smb.conf failed: Too many levels of symbolic links marcslaptop:/slash/srv/samba/etc # more lmhosts more: stat of lmhosts failed: Too many levels of symbolic links
I don't know if the relative links for lmhosts and smb.conf are broken because I cd via the /slash mount point or something else is haywired, but the error message telling me that there are "Too many levels of symbolic links" makes me think that an indefinite recursion loop is occurring somewhere. I can't grok why that would be the case, and after 5 days of Googling and reading man pages, I give up and hopefully a guru here has solved this or something similar and will be able to point me in the right direction and tell me how to get these links to work. I can't find any options for autofs, automount, cifs file systems etc that would solve this either. (Yes I am using cifs because there are Windoz systems on my SOHO network also and I want to be able to access the /slash share from them as well.) While this is NOT a complete or precise explanation for why I need these relative links to work via the /slash mount point, I want the /srv directory to contain all the links to various configuration files, for each service I run on each of my systems. This way I will be able to export a samba share for both /slash and /srv and use a tool like Beyond Compare to manage and maintain these files and keep them in sync when I update or make changes to a configuration file that should be propagated to each system on my network. Using relative links will allow me to access these configuration via the remote host's /slash mount and not via the local host's /slash mount. Thanks as always in advance for your time and efforts! Marc...
(I am sorry if this question gets posted more than once, I tried sending this to users@lists.opensuse.org and for some reason it did not get posted. So this time I am sending it to opensuse@opensuse.org since I saw that is where another poster successfully sent an email that got posted.) Hello - I am running OpenSuSE Leap 15.2 and am encountering a problem with doing an rbind mount on the root / directory that I cannot find a solution to. I run a SOHO network and only my wife and I are users. (She is NOT Linux savoy so not a threat! LOL) In my /etc/fstab file I mount the root / directory at /slash using the following configuration -
/slash none rbind,x-systemd.automount,x-systemd.idle-timeout=300 0 0
The trouble I am having occurs when I try to set up a relative link in a sub-directory that uses slash. So for example I have a directory at /srv/samba/etc as accessed and shown here -
marcslaptop:~ # cd /srv/samba/etc/ marcslaptop:/srv/samba/etc # ll total 20 lrwxrwxrwx 1 root root 20 Jun 11 09:17 dhcp.conf -> /etc/samba/dhcp.conf lrwxrwxrwx 1 root root 32 Jun 13 14:52 lmhosts -> ../../../slash/etc/samba/lmhosts lrwxrwxrwx 1 root root 33 Jun 12 22:21 smb.conf -> ../../../slash/etc/samba/smb.conf lrwxrwxrwx 1 root root 27 Jun 13 15:34 smbusers -> ../../../etc/samba/smbusers
and all is fine and works as expected. However if I cd to this same directory via the /slash mount things go to pot! -
marcslaptop:/srv/samba/etc # cd /slash/srv/samba/etc/ marcslaptop:/slash/srv/samba/etc # ll total 20 lrwxrwxrwx 1 root root 20 Jun 11 09:17 dhcp.conf -> /etc/samba/dhcp.conf lrwxrwxrwx 1 root root 32 Jun 13 14:52 lmhosts -> ../../../slash/etc/samba/lmhosts <-- Highlighted in red lrwxrwxrwx 1 root root 33 Jun 12 22:21 smb.conf -> ../../../slash/etc/samba/smb.conf <-- Highlighted in red lrwxrwxrwx 1 root root 27 Jun 13 15:34 smbusers -> ../../../etc/samba/smbusers
The color coding is missing but it shows that the links for lmhosts and smb.conf are broken. I can demonstrate this -
marcslaptop:/slash/srv/samba/etc # more smb.conf more: stat of smb.conf failed: Too many levels of symbolic links marcslaptop:/slash/srv/samba/etc # more lmhosts more: stat of lmhosts failed: Too many levels of symbolic links
I don't know if the relative links for lmhosts and smb.conf are broken because I cd via the /slash mount point or something else is haywired, but the error message telling me that there are "Too many levels of symbolic links" makes me think that an indefinite recursion loop is occurring somewhere. I can't grok why that would be the case, and after 5 days of Googling and reading man pages, I give up and hopefully a guru here has solved this or something similar and will be able to point me in the right direction and tell me how to get these links to work. I can't find any options for autofs, automount, cifs file systems etc that would solve this either. (Yes I am using cifs because there are Windoz systems on my SOHO network also and I want to be able to access the /slash share from them as well.) While this is NOT a complete or precise explanation for why I need these relative links to work via the /slash mount point, I want the /srv directory to contain all the links to various configuration files, for each service I run on each of my systems. This way I will be able to export a samba share for both /slash and /srv and use a tool like Beyond Compare to manage and maintain these files and keep them in sync when I update or make changes to a configuration file that should be propagated to each system on my network. Using relative links will allow me to access these configuration via the remote host's /slash mount and not via the local host's /slash mount. Thanks as always in advance for your time and efforts! Marc...
On 14/06/2021 16.52, Marc Chamberlin wrote:
(I am sorry if this question gets posted more than once, I tried sending this to users@lists.opensuse.org and for some reason it did not get posted. So this time I am sending it to opensuse@opensuse.org since I saw that is where another poster successfully sent an email that got posted.)
No. The first address is the correct one, the second is the old address. Mail lists were down the weekend. Your first mail will be somewhere - yes, it is, I see both mails. The first one was delayed an hour and a half. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On 14.06.2021 17:36, Marc Chamberlin wrote:
Hello - I am running OpenSuSE Leap 15.2 and am encountering a problem with doing an rbind mount on the root / directory that I cannot find a solution to. I run a SOHO network and only my wife and I are users. (She is NOT Linux savoy so not a threat! LOL) In my /etc/fstab file I mount the root / directory at /slash using the following configuration -
/slash none rbind,x-systemd.automount,x-systemd.idle-timeout=300 0 0
that cannot work, there is no device part. Nothing in this line says to mount /. Jun 14 20:24:23 leap15 systemd-fstab-generator[5338]: Mount point none is not a valid path, ignoring. Show full output of systemctl cat slash.automount systemctl cat slash.mount grep /slash /proc/self/mountinfo
The trouble I am having occurs when I try to set up a relative link in a sub-directory that uses slash. So for example I have a directory at /srv/samba/etc as accessed and shown here -
marcslaptop:~ # cd /srv/samba/etc/ marcslaptop:/srv/samba/etc # ll total 20 lrwxrwxrwx 1 root root 20 Jun 11 09:17 dhcp.conf -> /etc/samba/dhcp.conf lrwxrwxrwx 1 root root 32 Jun 13 14:52 lmhosts -> ../../../slash/etc/samba/lmhosts lrwxrwxrwx 1 root root 33 Jun 12 22:21 smb.conf -> ../../../slash/etc/samba/smb.conf lrwxrwxrwx 1 root root 27 Jun 13 15:34 smbusers -> ../../../etc/samba/smbusers
and all is fine and works as expected. However if I cd to this same directory via the /slash mount things go to pot! -
marcslaptop:/srv/samba/etc # cd /slash/srv/samba/etc/ marcslaptop:/slash/srv/samba/etc # ll total 20 lrwxrwxrwx 1 root root 20 Jun 11 09:17 dhcp.conf -> /etc/samba/dhcp.conf lrwxrwxrwx 1 root root 32 Jun 13 14:52 lmhosts -> ../../../slash/etc/samba/lmhosts <-- Highlighted in red lrwxrwxrwx 1 root root 33 Jun 12 22:21 smb.conf -> ../../../slash/etc/samba/smb.conf <-- Highlighted in red lrwxrwxrwx 1 root root 27 Jun 13 15:34 smbusers -> ../../../etc/samba/smbusers
The color coding is missing but it shows that the links for lmhosts and smb.conf are broken. I can demonstrate this -
marcslaptop:/slash/srv/samba/etc # more smb.conf more: stat of smb.conf failed: Too many levels of symbolic links marcslaptop:/slash/srv/samba/etc # more lmhosts more: stat of lmhosts failed: Too many levels of symbolic links
I don't know if the relative links for lmhosts and smb.conf are broken because I cd via the /slash mount point or something else is haywired, but the error message telling me that there are "Too many levels of symbolic links" makes me think that an indefinite recursion loop is occurring somewhere. I can't grok why that would be the case, and after 5 days of Googling and reading man pages, I give up and hopefully a guru here has solved this or something similar and will be able to point me in the right direction and tell me how to get these links to work. I can't find any options for autofs, automount, cifs file systems etc that would solve this either. (Yes I am using cifs because there are Windoz systems on my SOHO network also and I want to be able to access the /slash share from them as well.)
While this is NOT a complete or precise explanation for why I need these relative links to work via the /slash mount point, I want the /srv directory to contain all the links to various configuration files, for each service I run on each of my systems. This way I will be able to export a samba share for both /slash and /srv and use a tool like Beyond Compare to manage and maintain these files and keep them in sync when I update or make changes to a configuration file that should be propagated to each system on my network. Using relative links will allow me to access these configuration via the remote host's /slash mount and not via the local host's /slash mount. Thanks as always in advance for your time and efforts!
Marc...
On 6/14/21 10:28 AM, Andrei Borzenkov wrote:
Hello - I am running OpenSuSE Leap 15.2 and am encountering a problem with doing an rbind mount on the root / directory that I cannot find a solution to. I run a SOHO network and only my wife and I are users. (She is NOT Linux savoy so not a threat! LOL) In my /etc/fstab file I mount the root / directory at /slash using the following configuration -
/slash none rbind,x-systemd.automount,x-systemd.idle-timeout=300 0 0
On 14.06.2021 17:36, Marc Chamberlin wrote: that cannot work, there is no device part. Nothing in this line says to mount /. Thanks for replying Andrie, and that is a copy/paste error that I didn't catch. The actual line from fstab is -
/ /slash none rbind,x-systemd.automount,x-systemd.idle-timeout=300 0 0 Sorry for the confusion.
Jun 14 20:24:23 leap15 systemd-fstab-generator[5338]: Mount point none is not a valid path, ignoring.
Show full output of
systemctl cat slash.automount
OK can do - marcslaptop:/home/marc # systemctl cat slash.automount # /run/systemd/generator/slash.automount # Automatically generated by systemd-fstab-generator [Unit] SourcePath=/etc/fstab Documentation=man:fstab(5) man:systemd-fstab-generator(8) Before=local-fs.target [Automount] Where=/slash TimeoutIdleSec=5min
systemctl cat slash.mount marcslaptop:/home/marc # systemctl cat slash.mount # /run/systemd/generator/slash.mount # Automatically generated by systemd-fstab-generator
[Unit] SourcePath=/etc/fstab Documentation=man:fstab(5) man:systemd-fstab-generator(8) [Mount] Where=/slash What=/ Type=none Options=rbind,x-systemd.automount,x-systemd.idle-timeout=300
grep /slash /proc/self/mountinfo marcslaptop:/home/marc # grep /slash /proc/self/mountinfo
50 97 0:45 / /slash rw,relatime shared:29 - autofs systemd-1 rw,fd=37,pgrp=1,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=18624 732 50 259:4 / /slash rw,relatime shared:1 - ext4 /dev/nvme0n1p4 rw 733 732 0:22 / /slash/sys rw,nosuid,nodev,noexec,relatime shared:2 - sysfs sysfs rw 734 733 0:7 / /slash/sys/kernel/security rw,nosuid,nodev,noexec,relatime shared:3 - securityfs securityfs rw 735 733 0:26 / /slash/sys/fs/cgroup ro,nosuid,nodev,noexec shared:4 - tmpfs tmpfs ro,mode=755 736 735 0:27 / /slash/sys/fs/cgroup/unified rw,nosuid,nodev,noexec,relatime shared:5 - cgroup2 cgroup rw 737 735 0:28 / /slash/sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime shared:6 - cgroup cgroup rw,xattr,name=systemd 738 735 0:32 / /slash/sys/fs/cgroup/rdma rw,nosuid,nodev,noexec,relatime shared:7 - cgroup cgroup rw,rdma 739 735 0:33 / /slash/sys/fs/cgroup/net_cls,net_prio rw,nosuid,nodev,noexec,relatime shared:8 - cgroup cgroup rw,net_cls,net_prio 740 735 0:34 / /slash/sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime shared:9 - cgroup cgroup rw,perf_event 741 735 0:35 / /slash/sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime shared:10 - cgroup cgroup rw,freezer 742 735 0:36 / /slash/sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime shared:11 - cgroup cgroup rw,hugetlb 743 735 0:37 / /slash/sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:12 - cgroup cgroup rw,memory 744 735 0:38 / /slash/sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:13 - cgroup cgroup rw,cpu,cpuacct 745 735 0:39 / /slash/sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime shared:14 - cgroup cgroup rw,blkio 746 735 0:40 / /slash/sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime shared:15 - cgroup cgroup rw,pids 747 735 0:41 / /slash/sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,devices 748 735 0:42 / /slash/sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:17 - cgroup cgroup rw,cpuset 749 733 0:29 / /slash/sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:18 - pstore pstore rw 750 733 0:30 / /slash/sys/firmware/efi/efivars rw,nosuid,nodev,noexec,relatime shared:19 - efivarfs efivarfs rw 751 733 0:31 / /slash/sys/fs/bpf rw,nosuid,nodev,noexec,relatime shared:20 - bpf none rw 752 733 0:8 / /slash/sys/kernel/debug rw,relatime shared:30 - debugfs debugfs rw 753 733 0:46 / /slash/sys/fs/fuse/connections rw,relatime shared:32 - fusectl fusectl rw 754 732 0:6 / /slash/dev rw,nosuid shared:21 - devtmpfs devtmpfs rw,size=16396560k,nr_inodes=4099140,mode=755 755 754 0:23 / /slash/dev/shm rw,nosuid,nodev shared:22 - tmpfs tmpfs rw 756 754 0:24 / /slash/dev/pts rw,nosuid,noexec,relatime shared:23 - devpts devpts rw,gid=5,mode=620,ptmxmode=000 757 754 0:21 / /slash/dev/mqueue rw,relatime shared:26 - mqueue mqueue rw 758 754 0:43 / /slash/dev/hugepages rw,relatime shared:27 - hugetlbfs hugetlbfs rw,pagesize=2M 759 732 0:25 / /slash/run rw,nosuid,nodev shared:24 - tmpfs tmpfs rw,mode=755 760 732 0:5 / /slash/proc rw,nosuid,nodev,noexec,relatime shared:25 - proc proc rw 761 760 0:44 / /slash/proc/sys/fs/binfmt_misc rw,relatime shared:28 - autofs systemd-1 rw,fd=33,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=18618 762 732 0:45 / /slash/slash rw,relatime shared:29 - autofs systemd-1 rw,fd=37,pgrp=1,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=18624 763 732 259:6 / /slash/SuSE15.0 rw,relatime shared:31 - ext4 /dev/nvme0n1p6 rw,data=ordered 764 732 259:3 / /slash/windows/win10 rw,nosuid,nodev,relatime shared:33 - fuseblk /dev/nvme0n1p3 rw,user_id=0,group_id=0,allow_other,blksize=4096 765 732 8:3 / /slash/home rw,relatime shared:34 - ext4 /dev/sda3 rw 766 732 8:4 / /slash/boot/efi rw,relatime shared:35 - vfat /dev/sda4 rw,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 767 732 8:1 / /slash/windows/data rw,nosuid,nodev,relatime shared:36 - fuseblk /dev/sda1 rw,user_id=0,group_id=0,allow_other,blksize=4096 768 732 8:5 / /slash/srv rw,relatime shared:37 - ext4 /dev/sda5 rw,data=ordered 769 732 0:47 / /slash/mnt/samba/all rw,relatime shared:209 - autofs /srv/autofs/etc/auto.smb rw,fd=7,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=33681 770 732 0:48 / /slash/mnt/samba/SuSE/bigbang rw,relatime shared:214 - autofs /srv/autofs/auto.bigbang.samba rw,fd=13,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=33818 771 732 0:49 / /slash/mnt/nfs/bigbang rw,relatime shared:219 - autofs /srv/autofs/auto.bigbang.nfs rw,fd=19,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=33920 772 732 0:50 / /slash/mnt/samba/misc rw,relatime shared:224 - autofs /etc/auto.misc rw,fd=25,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=33691 773 732 0:51 / /slash/mnt/samba/SuSE/darkstar rw,relatime shared:229 - autofs /srv/autofs/auto.darkstar.samba rw,fd=31,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=33696 774 732 0:52 / /slash/mnt/nfs/darkstar rw,relatime shared:234 - autofs /srv/autofs/auto.darkstar.nfs rw,fd=37,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=33711 775 732 0:53 / /slash/mnt/samba/Win10/quantum rw,relatime shared:239 - autofs /srv/autofs/auto.quantum.Win10 rw,fd=43,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=33718 776 732 0:54 / /slash/mnt/nfs/quantum rw,relatime shared:244 - autofs /srv/autofs/auto.quantum.nfs rw,fd=49,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=32460 777 732 0:55 / /slash/mnt/samba/SuSE/quasar rw,relatime shared:249 - autofs /srv/autofs/auto.quasar.samba rw,fd=55,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=32467 778 732 0:56 / /slash/mnt/nfs/quasar rw,relatime shared:254 - autofs /srv/autofs/auto.quasar.nfs rw,fd=61,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=33723 779 732 0:57 / /slash/mnt/samba/Win10/nova rw,relatime shared:259 - autofs /srv/autofs/auto.nova.Win10 rw,fd=67,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=33733 780 732 0:58 / /slash/mnt/samba/SuSE/nova rw,relatime shared:264 - autofs /srv/autofs/auto.nova.samba rw,fd=73,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=31577 781 732 0:59 / /slash/mnt/nfs/nova rw,relatime shared:269 - autofs /srv/autofs/auto.nova.nfs rw,fd=79,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=32477 782 732 0:60 / /slash/mnt/samba/Win10/wa7pxwARES rw,relatime shared:274 - autofs /srv/autofs/auto.wa7pxwARES.Win10 rw,fd=90,pgrp=2101,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=32487 1636 759 0:63 / /slash/run/user/1000 rw,nosuid,nodev,relatime shared:722 - tmpfs tmpfs rw,size=3281304k,mode=700,uid=1000,gid=100 1666 1636 0:64 / /slash/run/user/1000/gvfs rw,nosuid,nodev,relatime shared:735 - fuse.gvfsd-fuse gvfsd-fuse rw,user_id=1000,group_id=100 1915 1636 0:65 / /slash/run/user/1000/doc rw,nosuid,nodev,relatime shared:858 - fuse.portal portal rw,user_id=1000,group_id=100 613 770 0:61 / /slash/mnt/samba/SuSE/bigbang/srv rw,relatime shared:279 - cifs //bigbang/srv rw,vers=3.1.1,cache=strict,username=Marc,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.10.50,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1 That last command produced a lot of output, and apparently some line wrapping is going on. Sorry it is showing a lot of info from my entire network! HTHs and again thanks for taking the time to help me. I will leave the rest of my email in-tack for now... Marc...
The trouble I am having occurs when I try to set up a relative link in a sub-directory that uses slash. So for example I have a directory at /srv/samba/etc as accessed and shown here -
marcslaptop:~ # cd /srv/samba/etc/ marcslaptop:/srv/samba/etc # ll total 20 lrwxrwxrwx 1 root root 20 Jun 11 09:17 dhcp.conf -> /etc/samba/dhcp.conf lrwxrwxrwx 1 root root 32 Jun 13 14:52 lmhosts -> ../../../slash/etc/samba/lmhosts lrwxrwxrwx 1 root root 33 Jun 12 22:21 smb.conf -> ../../../slash/etc/samba/smb.conf lrwxrwxrwx 1 root root 27 Jun 13 15:34 smbusers -> ../../../etc/samba/smbusers and all is fine and works as expected. However if I cd to this same directory via the /slash mount things go to pot! -
marcslaptop:/srv/samba/etc # cd /slash/srv/samba/etc/ marcslaptop:/slash/srv/samba/etc # ll total 20 lrwxrwxrwx 1 root root 20 Jun 11 09:17 dhcp.conf -> /etc/samba/dhcp.conf lrwxrwxrwx 1 root root 32 Jun 13 14:52 lmhosts -> ../../../slash/etc/samba/lmhosts <-- Highlighted in red lrwxrwxrwx 1 root root 33 Jun 12 22:21 smb.conf -> ../../../slash/etc/samba/smb.conf <-- Highlighted in red lrwxrwxrwx 1 root root 27 Jun 13 15:34 smbusers -> ../../../etc/samba/smbusers
The color coding is missing but it shows that the links for lmhosts and smb.conf are broken. I can demonstrate this -
marcslaptop:/slash/srv/samba/etc # more smb.conf more: stat of smb.conf failed: Too many levels of symbolic links marcslaptop:/slash/srv/samba/etc # more lmhosts more: stat of lmhosts failed: Too many levels of symbolic links I don't know if the relative links for lmhosts and smb.conf are broken because I cd via the /slash mount point or something else is haywired, but the error message telling me that there are "Too many levels of symbolic links" makes me think that an indefinite recursion loop is occurring somewhere. I can't grok why that would be the case, and after 5 days of Googling and reading man pages, I give up and hopefully a guru here has solved this or something similar and will be able to point me in the right direction and tell me how to get these links to work. I can't find any options for autofs, automount, cifs file systems etc that would solve this either. (Yes I am using cifs because there are Windoz systems on my SOHO network also and I want to be able to access the /slash share from them as well.)
While this is NOT a complete or precise explanation for why I need these relative links to work via the /slash mount point, I want the /srv directory to contain all the links to various configuration files, for each service I run on each of my systems. This way I will be able to export a samba share for both /slash and /srv and use a tool like Beyond Compare to manage and maintain these files and keep them in sync when I update or make changes to a configuration file that should be propagated to each system on my network. Using relative links will allow me to access these configuration via the remote host's /slash mount and not via the local host's /slash mount. Thanks as always in advance for your time and efforts!
Marc...
-- *"The Truth is out there" - Spooky* *_ _ . . . . . . _ _ . _ _ _ _ . . . . _ . . . . _ _ . _ _ _ . . . . _ _ . _ . . _ . _ _ _ _ . _ . _ . _ . _ . * Computers: the final frontier. These are the voyages of the user Marc. His mission: to explore strange new hardware. To seek out new software and new applications. To boldly go where no Marc has gone before! (/This email is digitally signed. My public key for sending encrypted email to me can be found at - https://keys.openpgp.org/search?q=marc@marcchamberlin.com or just ask me for it and I will send it to you as an attachment. If you don't understand, no worries, just ignore it and/or ask me to explain it further./)
On 14.06.2021 23:17, Marc Chamberlin wrote:
On 6/14/21 10:28 AM, Andrei Borzenkov wrote:
Hello - I am running OpenSuSE Leap 15.2 and am encountering a problem with doing an rbind mount on the root / directory that I cannot find a solution to. I run a SOHO network and only my wife and I are users. (She is NOT Linux savoy so not a threat! LOL) In my /etc/fstab file I mount the root / directory at /slash using the following configuration -
/slash none rbind,x-systemd.automount,x-systemd.idle-timeout=300 0 0
On 14.06.2021 17:36, Marc Chamberlin wrote: that cannot work, there is no device part. Nothing in this line says to mount /. Thanks for replying Andrie, and that is a copy/paste error that I didn't catch. The actual line from fstab is -
/ /slash none rbind,x-systemd.automount,x-systemd.idle-timeout=300 0 0
With this line I cannot even shutdown system - it hangs on shutdown attempting to unmount filesystems. ...
grep /slash /proc/self/mountinfo marcslaptop:/home/marc # grep /slash /proc/self/mountinfo
50 97 0:45 / /slash rw,relatime shared:29 - autofs systemd-1 rw,fd=37,pgrp=1,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=18624
This is your original mount from /etc/fstab ...
762 732 0:45 / /slash/slash rw,relatime shared:29 - autofs systemd-1 rw,fd=37,pgrp=1,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=18624
And this mount is duplicate created by mount --rbind. ..
marcslaptop:/srv/samba/etc # cd /slash/srv/samba/etc/ marcslaptop:/slash/srv/samba/etc # ll total 20 lrwxrwxrwx 1 root root 20 Jun 11 09:17 dhcp.conf -> /etc/samba/dhcp.conf lrwxrwxrwx 1 root root 32 Jun 13 14:52 lmhosts -> ../../../slash/etc/samba/lmhosts <-- Highlighted in red lrwxrwxrwx 1 root root 33 Jun 12 22:21 smb.conf -> ../../../slash/etc/samba/smb.conf <-- Highlighted in red lrwxrwxrwx 1 root root 27 Jun 13 15:34 smbusers -> ../../../etc/samba/smbusers
The color coding is missing but it shows that the links for lmhosts and smb.conf are broken.
If you count parent directory references /slash/srv/samba/etc/../../.. => /slash so you symlink is equivalent to /slash/slash/etc/samba/smb.conf Now in your case /slash/slash is automount which attempts to mount / again which likely results in ELOOP error you observed. If you simply do "mount -o rbind / /slash" (without automount) then /slash/slash directory will be empty (surprise) and link will be broken as well. Just remove "slash/" from symlink target. And no, I do not understand what you are trying to do and why you need this absolutely weird tree structure.
participants (3)
-
Andrei Borzenkov
-
Carlos E. R.
-
Marc Chamberlin