LINUX.ORG.RU
ФорумAdmin

Размонтирование USB накопителя


0

0

Ситуация такая:

По user'ом может монтироваться USB flash. При попытке размонтировать соответствующий накопитель выдается сообщение

umount: only root can unmount /dev/sda1 from /media/flash

Файл /etc/fstab

/dev/sda1 /media/flash vfat rw,noauto,user,codepage=866,iocharset=koi8-r 0 0

При монтировании в файле /etc/mtab не делается записи о user'e. Такое же сообщение возникает, если смонтировать с правами root, а затем пытаться размонтировать под user'ом. При указании опции users все работает нормально.

В чем проблема? Почему параметр "user" не обрабатывается правильно?

Система Debian GNU/Linux 3.1

Команда "ОТБОЙ!" Нашлось решение! =)

Дело было вот в чем: файл /etc/mtab был символической ссылкой на /proc/mounts.

Далее внимательно читаем `man mount` - и находим ответ:

When the proc filesystem is mounted (say at /proc), the files /etc/mtab and /proc/mounts have very similar contents. The former has somewhat more information, such as the mount options used, but is not necessarily up-to-date (cf. the -n option below). It is possible to replace /etc/mtab by a symbolic link to /proc/mounts, and especially when you have very large numbers of mounts things will be much faster with that symlink, but some information is lost that way, and in particular working with the loop device will be less convenient, and using the "user" option will fail.

вот эта фраза все говорит: using the "user" option will fail.

Соответственно удаляем ссылку и создаем заново /etc/mtab

armageddon
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.