WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Unable to umount bind-mount  (Read 5987 times)

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Unable to umount bind-mount
« on: September 17, 2018, 11:09:17 AM »
In '/opt/bootlocal.sh', I add the following to '/etc/fstab' and create the directory '/mnt/.crypt/'.
Code: [Select]
/dev/sda9    /mnt/.crypt    ext4    noauto,users,exec    0 0
/mnt/.crypt/crypt    /home/tc/crypt    ext4    noauto,users,exec,bind 0 0
Mounting either one as regular user does work fine; however, unmounting the bind-mounted directory '/home/tc/crypt/' fails with "Operation not permitted.". The order of unmounting (device or the bind-mount) does  not matter. Unmounting with "sudo" works fine.

The only reference I  have found to anything similar was from 2013 in the Tinycore forum. Something about the group permission of '/etc/busybox.conf', though in my case they are fine as stated there.
Code: [Select]
-rw------- 1 root root 140 Jun 15  2015 /etc/busybox.conf

Anybody got any ideas? I need the mount points in scripts where I using sudo has proven cumbersome as far as I recall.

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Re: Unable to umount bind-mount
« Reply #1 on: September 17, 2018, 03:31:55 PM »
BTW, this happens on dCore-bionic:2018.08.10.22.24 which makes me realize that I am on the wrong forum. Sorry! However, I suspect this is not particular to this specific release. Can anybody verify on dCore-bionic64 for example?

Here is the relevant part of '/etc/mtab' with all mounts on the device in question. I have also mounted '/mnt/sda9' as prepared in '/etc/fstab' by TC at boot time.
Code: [Select]
/dev/sda9 /mnt/sda9 ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
/dev/sda9 /mnt/.crypt ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
/dev/sda9 /home/tc/crypt ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
This is what happens either what order I try:
Code: [Select]
$ umount /home/tc/crypt
umount: /home/tc/crypt: umount failed: Operation not permitted.
$ umount /mnt/sda9
$ umount /home/tc/crypt
umount: /home/tc/crypt: umount failed: Operation not permitted.
$ umount /mnt/.crypt
$ umount /home/tc/crypt
umount: /home/tc/crypt: umount failed: Operation not permitted.
The final state of '/etc/mtab' is
Code: [Select]
/dev/sda9 /home/tc/crypt ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
The device sda9 contains an Ext4 filesystem with encryption enabled but not decrypted in all these steps. So I think that does not play a role here. I shall double-check later, though.

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Re: Unable to umount bind-mount (solved)
« Reply #2 on: September 18, 2018, 05:34:56 AM »
Puzzle solved! It was '/bin/umount' that did not play according to the rules. Somehow that must have been loaded by some extension and overruled Busybox umount. Using '/bb/umount' works as expected.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Unable to umount bind-mount
« Reply #3 on: September 19, 2018, 08:52:14 PM »
Hi sm8ps.  Do you see the same  behavior when using standard Core in regards to the Busybox mount/umount and the mount/umount from util-linux.tcz? 


Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Re: Unable to umount bind-mount
« Reply #4 on: September 20, 2018, 09:50:21 AM »
I do not have any TinyCore installation to compare to, sorry. I am a strict dCore follower.  :)