Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: hiro on January 26, 2013, 03:44:39 PM

Title: can't umount /mnt/sdb1: Operation not permitted
Post by: hiro on January 26, 2013, 03:44:39 PM
mounting works fine as user tc, but unmounting not.

from fstab:
/dev/sdb1       /mnt/sdb1       vfat     noauto,users,exec,umask=000 0 0 # Added by TC

$ umount /mnt/sdb1/
umount: can't umount /mnt/sdb1: Operation not permitted
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: Pseudoman on January 27, 2013, 01:12:21 PM
I noticed that too, so I started prefixing umount with sudo.
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: beroje on January 27, 2013, 01:19:38 PM
tc@box:~$ sudo mount /dev/sda1
tc@box:~$ sudo mount /dev/sda3
tc@box:~$ sudo mount /dev/sda5
tc@box:~$ sudo umount /dev/sda1
tc@box:~$ sudo umount /dev/sda3
tc@box:~$ sudo umount /dev/sda5
tc@box:~$
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: hiro on January 27, 2013, 06:15:22 PM
I've looked into mtab and it seems the users flag is missing there. I know nothing about the technical details so I ask here. A bug or just some new kernel "feature"?
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: roberts on January 27, 2013, 06:53:47 PM
It would seem that busybox is ignoring its own configuration file, as in the past, it always worked.
sudo cat /etc/busybox.conf
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: hiro on January 27, 2013, 07:50:46 PM
oh, wow, yet an other place for this?
why isn't the users flag in fstab the only one to decide?
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: lverns on February 02, 2013, 01:06:19 PM
I'm also experiencing this same issue with Core 4.7.3
Code: [Select]
tc@box:~$mount /mnt/sdc1
tc@box:~$umount /mnt/sdc1
umount: can't umount /mnt/sdc1: Operation not permitted
tc@box:~$sudo cat /etc/busybox.conf
# /etc/busybox.conf: Busybox configuration file.
#
[SUID]
# Allow command to be run by anyone.
mount = s-x root.root
umount = s-x root.root
tc@box:~$cat /etc/fstab | grep sdc1
/dev/sdc1       /mnt/sdc1       vfat     noauto,users,exec,umask=000 0 0 # Added by TC
tc@box:~$ cat /etc/mtab | grep sdc1
/dev/sdc1 /mnt/sdc1 vfat rw,relatime,uid=1001,gid=50,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
tc@box:~$
I don't have any ext* partitions in this machine to test the umount command with. I'll post as soon as I get a chance.
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: hiro on February 02, 2013, 03:29:33 PM
how is the difference between fstab and mtab created?
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: lverns on February 02, 2013, 04:07:51 PM
how is the difference between fstab and mtab created?
I have no idea. I did a quick test and found that I can't umount ext* partitions either.

This issue isn't a big deal for me since I only run TinyCore for a few hours at a time. With such a short uptime, I rarely need to actually umount partitions, and I can always just use sudo since I'm in a low danger environment.

Oh, yeesh. I just realized that there is a newer version of Core available (v4.7.4). I'll have to upgrade to that and report back.
Cheers,
lverns
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: lverns on February 05, 2013, 04:56:14 PM
Okay, I've bumped up to 4.7.4 and the issue still exists.
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: hiro on February 14, 2013, 07:04:10 PM
the ondemand script seems to unmount without sudo also as I just got this:
$ ondemand sshfs-fuse.tcz
umount: can't umount /mnt/test: Operation not permitted
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: u54749 on February 15, 2013, 10:58:09 AM
I have the same problem with umount.  I have found the cause of the issue:  spurious group write permission on /etc/busybox.conf

~$ ls -l /etc/busybox.conf
-rw--w----    1 root     staff          140 Mar  4  2010 /etc/busybox.conf
~$ umount /mnt/sda3
umount: can't umount /mnt/sda3: Operation not permitted
~$ sudo chmod g-w /etc/busybox.conf
~$ ls -l /etc/busybox.conf
-rw-------    1 root     staff          140 Mar  4  2010 /etc/busybox.conf
~$ umount /mnt/sda3
~$

I propose to correct this in next version
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: hiro on February 15, 2013, 11:29:45 AM
Wow, right. It works. But I'm still puzzled about what busybox is doing there with special config files about this when there is a perfectly standardized way to do it with options in fstab.
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: tinypoodle on February 15, 2013, 11:49:45 AM
I have the same problem with umount.  I have found the cause of the issue:  spurious group write permission on /etc/busybox.conf
Good catch!   8)
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: tinypoodle on February 15, 2013, 11:54:05 AM
Wow, right. It works. But I'm still puzzled about what busybox is doing there with special config files about this when there is a perfectly standardized way to do it with options in fstab.
fstab can only ever affect items included.
There are a lot of usage cases of mount where fstab would not get involved.
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: hiro on February 15, 2013, 12:35:13 PM
Then you would still be able to use something like mount -o users, no?
At least that's my interpretation after many years of mounting stuff.
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: tinypoodle on February 15, 2013, 01:27:05 PM
Is your issue with the permissions of 'mount' or with the mechanism permissions of busybox applets are handled?
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: hiro on February 15, 2013, 02:17:43 PM
you're right tinypoodle, I mixed these two issues up.
Title: Re: can't umount /mnt/sdb1: Operation not permitted
Post by: roberts on February 15, 2013, 02:48:30 PM
I have the same problem with umount.  I have found the cause of the issue:  spurious group write permission on /etc/busybox.conf

~$ ls -l /etc/busybox.conf
-rw--w----    1 root     staff          140 Mar  4  2010 /etc/busybox.conf
~$ umount /mnt/sda3
umount: can't umount /mnt/sda3: Operation not permitted
~$ sudo chmod g-w /etc/busybox.conf
~$ ls -l /etc/busybox.conf
-rw-------    1 root     staff          140 Mar  4  2010 /etc/busybox.conf
~$ umount /mnt/sda3
~$

I propose to correct this in next version
+1 on the Good Catch.
Applied to 4.7.5