Tiny Core Base > TCB Tips & Tricks

preventing certain drives from appearing in mounttool

(1/1)

jamtat:
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

Juanito:
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..

jamtat:
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

jamtat:

--- Quote from: Juanito on December 30, 2011, 10:02:27 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..

--- End quote ---
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

H.Lunke:

--- Quote from: jamtat on December 31, 2011, 09:13:35 AM ---So, is there no way to exclude certain drives from appearing under mounttool?

--- End quote ---

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.

Navigation

[0] Message Index

Go to full version