Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: mbzadegan on October 17, 2012, 01:47:59 AM

Title: Disable HDD Detection ?
Post by: mbzadegan on October 17, 2012, 01:47:59 AM
Hi,
Is any way to disable HDD Drive detection while booting tinycore ?
I want to detect only my TinyCore USB Flash memory when i boot tiny core and don't want to detect MY HDD drives .

Title: Re: Disable HDD Detection ?
Post by: hiro on October 17, 2012, 06:40:59 AM
bootcode for this is nofstab
Title: Re: Disable HDD Detection ?
Post by: mbzadegan on October 17, 2012, 07:27:02 AM
i tested nofstab on booting kernel append line but nothing changed !
with ( or without ) nofstab , I could access to my HDD while i booting from USB Flash Memory.
Title: Re: Disable HDD Detection ?
Post by: hiro on October 17, 2012, 08:45:25 AM
Could be because of these udev rules. I would say this makes it a bug.
Perhaps rebuildfstab should also check if NOFSTAB is set.

/etc/udev/rules.d/98-tc.rules:ACTION=="add",      SUBSYSTEM=="block",   RUN+="/bin/sh -c '/usr/sbin/rebuildfstab'"
/etc/udev/rules.d/98-tc.rules:ACTION=="remove",   SUBSYSTEM=="block",   RUN+="/bin/sh -c '/usr/sbin/rebuildfstab'"
Title: Re: Disable HDD Detection ?
Post by: curaga on October 17, 2012, 10:09:54 AM
No such thing. Even if nofstab skips the convenience filters, you can still access the device yourself.
Title: Re: Disable HDD Detection ?
Post by: Rich on October 17, 2012, 10:15:17 AM
Hi mbzadegan
Maybe if you explain why you are trying to do this, someone could suggest a suitable solution.
Title: Re: Disable HDD Detection ?
Post by: curaga on October 17, 2012, 03:09:59 PM
@hiro: Those rules aren't there if you boot with nofstab.
Title: Re: Disable HDD Detection ?
Post by: mbzadegan on October 31, 2012, 03:31:59 AM
Is any way to solve my problem ?
For security , i want to disable HDD detection while i booting from tinycore USB PenDrive and access to Internet . 8)
Title: Re: Disable HDD Detection ?
Post by: hiro on October 31, 2012, 04:39:17 AM
still not clear how this could ever work in a really "secure" way.
best solution is to take out all HDDs.
Title: Re: Disable HDD Detection ?
Post by: Rich on October 31, 2012, 08:35:00 AM
Hi mbzadegan
So, you want browser access only in a GUI with no access to HDD.
You could have your bootlocal replace  /usr/bin/mnttool  and  /usr/bin/aterm  with empty scripts to disable them.
That should prevent the drives from being mounted by a user which would prevent them from being accessed.
Title: Re: Disable HDD Detection ?
Post by: tinypoodle on October 31, 2012, 08:45:57 AM
That should prevent the drives from being mounted by a user which would prevent them from being accessed.

There are various ways to access drives without ever invoking mount ;)
Title: Re: Disable HDD Detection ?
Post by: tinypoodle on October 31, 2012, 08:47:07 AM
Short from disconnecting hardware, recompiling the kernel so it lacks the hardware support seems like an option.
Title: Re: Disable HDD Detection ?
Post by: mbzadegan on October 31, 2012, 09:13:45 AM
You could have your bootlocal replace  /usr/bin/mnttool  and  /usr/bin/aterm  with empty scripts to disable them.
OK , But i don't find /usr/bin/mnttool and when I removed /usr/bin/aterm , still i could mount /dev/sda1 as my first HDD partition !!
I want to users could not mount HDD Partitions when they boot tinycore and access to internet ( such as light web kiosk ) 8)
Title: Re: Disable HDD Detection ?
Post by: Rich on October 31, 2012, 09:55:30 PM
Hi mbzadegan
Quote
still i could mount /dev/sda1 as my first HDD partition !!
How? Using the Mount icon? Replacing  /usr/bin/mnttool  should disable that.
Through the Terminal icon? Was it still functional? Some other method?
Title: Re: Disable HDD Detection ?
Post by: mbzadegan on November 01, 2012, 11:37:43 AM
i could not find /usr/bin/mnttool and only i remove /usr/bin/aterm but still i could mount with general mount command !!
#mount /dev/sda1 /hdd
Maybe it's a BUG ? :-[

Title: Re: Disable HDD Detection ?
Post by: Rich on November 01, 2012, 12:58:07 PM
Hi mbzadegan
OK, but you still did not tell me how you executed the command. Did you use a terminal or some other means?
Title: Re: Disable HDD Detection ?
Post by: mbzadegan on November 01, 2012, 02:32:01 PM
hi Dear Rich,
yes ofcourse . i used terminal.
Title: Re: Disable HDD Detection ?
Post by: hiro on November 01, 2012, 04:00:52 PM
perhaps you should stop smoking crack and taking acid at the same time?

or simply delete the prn you have on that hard drive...
Title: Re: Disable HDD Detection ?
Post by: Rich on November 03, 2012, 09:21:57 PM
Hi mbzadegan
Quote
I want to users could not mount HDD Partitions when they boot tinycore and access to internet ( such as light web kiosk )
The simplest way to achieve this is to deny the user access to tools that allow them to mount a drive. That means
the user should not be given access to any type of terminal programs or other programs that allow you to mount
a drive. You should also make sure your boot loader does not allow a user to enter a boot code, such as  text,
since that would give them access to the console. Based on the information you have given so far, that is the
best advice I can offer you.
Title: Re: Disable HDD Detection ?
Post by: genec on November 04, 2012, 10:09:48 AM
bootcode for this is nofstab

Any idea where this is documented?  It doesn't appear to be on the FAQ page with other bootcodes and there doesn't appear to be any central bootcode page on the wiki.
Title: Re: Disable HDD Detection ?
Post by: coreplayer2 on November 04, 2012, 12:52:21 PM
Not exactly documentation but...

reading the code in /etc/init.d/tc-config explains it's use
Title: Re: Disable HDD Detection ?
Post by: gerald_clark on November 04, 2012, 03:32:36 PM
That won't stop you from mounting drives at the command line.