3

I have the following line in /etc/fstab:

none  /home/hydra/tmp  tmpfs  user,noauto,size=1000M,uid=1001,gid=1001  0  0

I can do mount ~/tmp as user hydra and it gets mounted ok. The only problem is that even thought it gets added to /proc/mounts, it does not get added to /etc/mtab. When I try a umount ~/tmp (again as hydra) it complains:

umount: /home/hydra/tmp is not mounted (according to mtab)

And when I try -f or -n, it complains that I am not root.


Some more info on the system that manifests this problem:

On sudo umount /home/hydra/tmp, the fs gets unmounted (I think I needed to used -f too)

  • Debian version is testing
  • mount --version -> mount from util-linux 2.19.1 (with libblkid and selinux support)
  • ls -l /etc/mtab -> -rw-r--r-- 1 root root 921 Nov 14 09:08 /etc/mtab
  • cat /proc/mounts | grep rootfs -> rootfs / rootfs rw 0 0
  • /home, /home/hydra nor /home/hydra/tmp are symbolic links
Kostas
  • 150
  • 1
  • 6
  • What happens when you run this as root? – Pricey Nov 11 '11 at 16:11
  • i think you have columns switched around in /etc/fstab. and what's the none for in the first column? tmpfs /home/hydra/tmp user,noauto,size=1000M,uid=1001,gid=1001 0 0 that's how i normally see it – matt Nov 11 '11 at 16:11
  • Oh and by the way, having an entry in `/etc/fstab` makes no difference to the `mount` command afaik? (i.e. it isn't required) If you wanted to mount a new addition to `/etc/fstab`, use `mount -a` – Pricey Nov 11 '11 at 16:13
  • @matt No, vrinek's syntax is correct. The first column is the device name, it's ignored for non-device-backed filesystems such as `tmpfs`. vrinek: what version of Debian are you running? What version of the `mount` package? What does `ls -l /etc/mtab` show? Is `/` mounted read-only? Is `/home` or `/home/hydra` or `/home/hydra/tmp` a symbolic link (with that tmpfs unmounted, what does `readlink -f /home/hydra/tmp` show)? – Gilles 'SO- stop being evil' Nov 11 '11 at 18:48
  • @PriceChild An entry in `/etc/fstab` is required if you want to call `mount` as a non-root user. – Gilles 'SO- stop being evil' Nov 11 '11 at 18:50
  • Hint: Many distributions now choose to replace `/etc/mtab` with a symlink pointing to `/proc/self/mounts` to avoid such kinds of problems. – u1686_grawity Nov 11 '11 at 19:04
  • @Gilles (and @PriceChild) I added the info you requested on the question – Kostas Nov 14 '11 at 08:31

0 Answers0