WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: preventing certain drives from appearing in mounttool  (Read 4366 times)

Offline jamtat

  • Jr. Member
  • **
  • Posts: 58
preventing certain drives from appearing in mounttool
« on: December 31, 2011, 12:53:37 AM »
For my little lab computer set-up it is desirable to have a somewhat hobbled version of mounttool. That's because while I do need for users to be able to, for example, mount a CD or a thumb drive they might bring in, I do NOT want them to be able to unmount one particular drive--the main hard drive on which TC is installed (/dev/sda1 in this case). I'm assuming mounttool takes its information as to what drives are in the system from /etc/fstab; is that correct? My main question in this thread, though, is whether there's any way to keep drives from being present under mounttool. Can anyone suggest a way to ensure that /dev/sda1 is not presented as one of the mount/unmount choices when mounttool runs?

Thanks,
James

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: preventing certain drives from appearing in mounttool
« Reply #1 on: December 31, 2011, 01:02:27 AM »
Not perhaps an answer to your question, but if you have, for example, extensions loaded from your main hard drive, mnttool will not let you unmount it anyway..

Offline jamtat

  • Jr. Member
  • **
  • Posts: 58
Re: preventing certain drives from appearing in mounttool
« Reply #2 on: December 31, 2011, 11:20:42 AM »
It'll be a relief if it's the case that you're not allowed to unmount the drive, even though it appears to be an option there. I'll go and double-check that it works that way . . .

Thanks,
James

Offline jamtat

  • Jr. Member
  • **
  • Posts: 58
Re: preventing certain drives from appearing in mounttool
« Reply #3 on: December 31, 2011, 12:13:35 PM »
Not perhaps an answer to your question, but if you have, for example, extensions loaded from your main hard drive, mnttool will not let you unmount it anyway..
Ok, I checked this on my test installation and you are, of course, correct: although sda1 appears there, I'm unable to unmount it using mounttool. Which is good and bad. Good because my lab's users can't wreak havoc by mistakenly unmounting the main HD. Bad because, if the entry appears and seems to offer a choice which is not actually valid, it can cause confusion for non-technical users about how mounttool works. So I can live with the way things operate, though I still would like to be able to exclude certain (non-working) options from the application so as to reduce confusion/intimidation for my users. So, is there no way to exclude certain drives from appearing under mounttool?

Thanks,
James

Offline H.Lunke

  • Newbie
  • *
  • Posts: 9
Re: preventing certain drives from appearing in mounttool
« Reply #4 on: February 08, 2012, 12:38:47 PM »
So, is there no way to exclude certain drives from appearing under mounttool?

I have looked for such an option as well, because clicking on the "fd0" button in mnttool without a floppy drive available gave me a hanging process "sh -c sudo mount /dev/fd0".
mnttool uses the script "/usr/bin/mountables.sh" to construct the list out of "/etc/fstab" and writes the data to temporary file "/tmp/mountables".

So changing line 9 of named script as follows excludes the floppy-button from being presented:
<   echo "$DEVICE"~"$LABEL" >> "$LIST"
---
>   [ ${DEVICE:0:2} != "fd" ] && echo "$DEVICE"~"$LABEL" >> "$LIST"

Tinycore is keen on reverting modifications like this on reboot, so to keep it permanent the script should be added to the personal backup filelist. But be warned, this might conflict with future changes in case of an upgrade.
Paradise is exactly like where you are right now -
only much, much better. [Laurie Anderson, Language is a virus]