Hiding some windows partitions.

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
glore2002
Level 1
Level 1
Posts: 41
Joined: Sat Jul 12, 2008 11:36 am

Hiding some windows partitions.

Post by glore2002 »

Hello!

I am a computing teacher who tries to make computers at school dual boot (windows and Linux mint). For security reasons, I don't want students to be able to access that partition from Linux to avoid modifications and possible problems.

How can I decide which partitions can be seen and access from Linux and which not or which can be seen and use to copy files from but not modified by users?

Thanks in advance for your valuable help!

User avatar
WharfRat
Level 21
Level 21
Posts: 13496
Joined: Thu Apr 07, 2011 8:15 pm

Re: Hiding some windows partitions.

Post by WharfRat »

glore2002,

You won't be able to hide them, but you can prevent them from being mounted by not including any student in the 'sudo' group.

As for administrating the system, setup a password for the root account and 'su -' in a terminal for performing administrative tasks.

If you want the partition mounted read only use an fstab entry with the 'ro' option for those partitions you want to be able to access, but not modify.
ImageImage

User avatar
kukamuumuka
Level 16
Level 16
Posts: 6189
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: Hiding some windows partitions.

Post by kukamuumuka »

Edit the /etc/fstab file, make a mount points to the partitions and set the permissions. An example: Windows partition sda1

Code: Select all

sudo mkdir -p /CorDorE/windows
sudo chown root:root -R /CorDorE/windows
sudo chmod 600 /CorDorE/windows
Edit the /etc/fstab

Code: Select all

sudo nano /etc/fstab
## add the line
/dev/sda1 /CorDorE/windows ntfs root,ro 0 0
http://wiki.centos.org/TipsAndTricks/NTFS

User avatar
DataMan
Level 6
Level 6
Posts: 1234
Joined: Thu Dec 04, 2008 6:47 am
Location: Carmel, Midwest USA at /var/www
Contact:

Re: Hiding some windows partitions.

Post by DataMan »

Additionally, if the partitions are appearing on the desktop, change the mount point to a directory other than /media (i.e. /mnt).

-DataMan
Linux'd since 2005 Linux ID 422356 Ubuntu ID 15015

altair4
Level 19
Level 19
Posts: 9802
Joined: Tue Feb 03, 2009 10:27 am

Re: Hiding some windows partitions.

Post by altair4 »

glore2002 wrote:Hello!

I am a computing teacher who tries to make computers at school dual boot (windows and Linux mint). For security reasons, I don't want students to be able to access that partition from Linux to avoid modifications and possible problems.

How can I decide which partitions can be seen and access from Linux and which not or which can be seen and use to copy files from but not modified by users?

Thanks in advance for your valuable help!
I would suggest a combination of the posts above:

To "hide" a partition have it not automount and restrict a force mount to sudo:

[1] Create a mount point within the /mnt directory so it doesn't show up on the desktop:

Code: Select all

sudo mkdir /mnt/WinC
[2] Find the UUID number of the windows partition:

Code: Select all

sudo blkid -c /dev/null
[3] Add a line to the end of /etc/fstab that looks something like this:

Code: Select all

UUID=A27826107825E3AF /mnt/WinC ntfs defaults,noauto 0 0
Substitute the UUID number above with the one you found in step [2]
*** The WinC folder will not be visible on the desktop since it's in the /mnt directory.
*** The /mnt/WinC folder will be visible in the file manager but since it's not mounted ( that's what the noauto option does ) it will be empty.
*** An administrator ( a member of the sudo group ) will still be able to mount it should the need arise but only through the command line, like this:

Code: Select all

sudo mount /mnt/WinC
To mount another Windows partition ( say the D "drive ) read-only the line would look something like this:

Code: Select all

UUID=CA5AEFAB5AEF930D /media/WinD ntfs defaults,umask=222 0 0
*** The WinD folder will be visible since it's been mounted in the /media directory.
*** It will be read only because of the "umask=222" option. umask represents the permissions you want to remove from the default ( in ntfs that's 777 ) and a 2 removes write so you end up with a mounted partition with permissions of 555 - read only ( 777 - 222 ).

Side note: There is no need to do a chown or chmod on the mount point before the partition is mounted since it will be overridden by the mount itself. That's true for any filesystem.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

glore2002
Level 1
Level 1
Posts: 41
Joined: Sat Jul 12, 2008 11:36 am

Re: Hiding some windows partitions.

Post by glore2002 »

Thanks to all for such a valuable help! Now, time to give all these advices a try.

Great forum, great people :-)

Post Reply

Return to “Newbie Questions”