Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Set partitions to hide or read only

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
Alex_80
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

[Solved] Set partitions to hide or read only

#1 Post by Alex_80 »

I wish that some partitions were hidden and others were read only, moreover I wish that these settings can't be edited by other users (except of course root user).

For do this, have I only in "fstab" file in "etc" folder to comment (or delete) lines relatives to partitions that I wish are hides and I set options to "ro" to lines relatives to partitions that I wish are read only?
Last edited by Alex_80 on 2010-04-08 12:08, edited 2 times in total.

User avatar
ComputerBob
Posts: 1181
Joined: 2007-11-30 04:49
Location: The Mountains of the Sunshine State
Been thanked: 1 time

Re: Set partitions to hide or read only

#2 Post by ComputerBob »

Alex_80 wrote:I wish that some partitions were hidden and others were read only, moreover I wish that these settings can't be edited by other users (except of course root user).

For do this, have I only in "fstab" file in "etc" folder to comment (or delete) lines relatives to partitions that I wish are hides and I set options to "ro" to lines relatives to partitions that I wish are read only?
If they ever boot from a Linux LiveCD, they'd still be able to mount/edit/delete those partitions.
ComputerBob - Making Geek-Speak Chic (TM)
ComputerBob.com - Nearly 6,000 Posts and 23 Million Views
My Massive Stroke
Help! (off-topic)
_________________
Your Life Matters

Alex_80
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

#3 Post by Alex_80 »

This isn't a problem.

After installation I have noticed that some partitions were auto mounted, others were manual mountable and others can't be mountable, so I have thought that I could solve my trouble in some manner, I have noticed that in "fstab" file in "etc" folder partitions had different options, so I have thought that editing fstab only, without editing other things, I could solve my trouble, but I'm not sure of that, so to avoid to make damages I ask for confirmation.

User avatar
ComputerBob
Posts: 1181
Joined: 2007-11-30 04:49
Location: The Mountains of the Sunshine State
Been thanked: 1 time

Re: Set partitions to hide or read only

#4 Post by ComputerBob »

Alex_80 wrote:This isn't a problem.

After installation I have noticed that some partitions were auto mounted, others were manual mountable and others can't be mountable, so I have thought that I could solve my trouble in some manner, I have noticed that in "fstab" file in "etc" folder partitions had different options, so I have thought that editing fstab only, without editing other things, I could solve my trouble, but I'm not sure of that, so to avoid to make damages I ask for confirmation.
In the KDE desktop enivironment, you can either comment-out the fstab lines of the partitions that you want to be "hidden" (by putting a "#" sign at the beginning of their lines), or you can completely remove the fstab lines of those same partitions. Either way, then those partitions will not be automounted and will not appear as "mountable" to the users (even if, for instance, they install the "KwikDisk" mounting tool in their panel).

I don't know how automounting works in GNOME, but I suspect that, by default, GNOME might either automount every partition that it sees or automatically make every partition that it sees mountable to users.
ComputerBob - Making Geek-Speak Chic (TM)
ComputerBob.com - Nearly 6,000 Posts and 23 Million Views
My Massive Stroke
Help! (off-topic)
_________________
Your Life Matters

Tixy
Posts: 96
Joined: 2009-08-12 17:00

Re: Set partitions to hide or read only

#5 Post by Tixy »

ComputerBob wrote:
Alex_80 wrote:I don't know how automounting works in GNOME, but I suspect that, by default, GNOME might either automount every partition that it sees or automatically make every partition that it sees mountable to users.
In the latest Squeeze, partitions on internal drives don't seem to auto-mount. Their Labels are listed in Nautilus and if you click on them, it asks for the root password then mounts them.

Alex_80
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

#6 Post by Alex_80 »

Thanks, I'll try to edit fstab for change mount options and then I will report results.

jjmac
Posts: 384
Joined: 2005-12-28 23:34
Location: Australia

Re: Set partitions to hide or read only

#7 Post by jjmac »

Howdy Alex_80,

Easy enough as a simple /etc/fstab edit.

To prevent a partition from mounting automatically at boot, add the option 'noauto' to the list of options for the partition in /etc/fstab. Such as ...
/dev/hda14 /mnt/knoppix4.0 ext2 noauto,users,noatime,exec,errors=remount-ro 0 2
It doesn't really matter where in the list the 'noauto' option is placed. Fuller info can also be found in the 'man' pages (]$ man mount and ]$ man fstab).

If the partition isn't listed in /etc/fstab you will have to be bothered with a more elaborate 'mounting' procedure as root, rather than the more simple ...

]$ mount /mnt/knoppix4.0

that would only be required for the above partition.

As for having 'hidden' partitions ... that is a different thing, effected using the 'fdisk' or 'cfdisk' programs. It can be useful when dealing with M$ installs, but then, no one really does that any more really (grin).


jm
http://counter.li.org
#313537

-=- The FVWM wm -=- http://www.fvwm.org -=-

Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ...

Alex_80
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

#8 Post by Alex_80 »

In fstab file I have added:

Code: Select all

/dev/sdb5 /media/sdb5 ext3 defaults 0 0
but it doesn't work, "mount point /media/sdb5 doesn't available" or similar message is showed.

I have try also with this:

Code: Select all

/dev/sdb5 /mnt/sdb5 ext3 defaults 0 0
but result is the same.

I have checked with GParted that sdb5 partition is really correct.

How I can solve the trouble?

User avatar
ComputerBob
Posts: 1181
Joined: 2007-11-30 04:49
Location: The Mountains of the Sunshine State
Been thanked: 1 time

Re: Set partitions to hide or read only

#9 Post by ComputerBob »

Alex_80 wrote:In fstab file I have added:

Code: Select all

/dev/sdb5 /media/sdb5 ext3 defaults 0 0
but it doesn't work, "mount point /media/sdb5 doesn't available" or similar message is showed.

I have try also with this:

Code: Select all

/dev/sdb5 /mnt/sdb5 ext3 defaults 0 0
but result is the same.

I have checked with GParted that sdb5 partition is really correct.

How I can solve the trouble?
Does a folder exist at /media/sdb5 or /mnt/sdb5? If not, you have to create a folder in one of those places before you can mount it.
ComputerBob - Making Geek-Speak Chic (TM)
ComputerBob.com - Nearly 6,000 Posts and 23 Million Views
My Massive Stroke
Help! (off-topic)
_________________
Your Life Matters

Alex_80
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

#10 Post by Alex_80 »

No, I don't create a folder, now I create the sdb5 folder in /mnt/ and it works.
Thanks.

What are differences between media and mnt mount point?

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Set partitions to hide or read only

#11 Post by Absent Minded »

Alex_80 wrote:No, I don't create a folder, now I create the sdb5 folder in /mnt/ and it works.
Thanks.

What are differences between media and mnt mount point?
The /media directory is "normally" use to mount removable media such as CD-ROMs and USB devices. The /mnt directory is generally (in Debian) used to mount internal (non-removable) hard drive partitions and NFS shares.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

Alex_80
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

#12 Post by Alex_80 »

Is this only a standard or there are real differences?

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Set partitions to hide or read only

#13 Post by Absent Minded »

There is no "real" differences. That is just the typical recommendations.

Edit: Many other distributions do not use a /media directory.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

Alex_80
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

#14 Post by Alex_80 »

So in theory can I mount a partition everywhere?
For example in theory can I mount sdb5 partition in /My folder/Animals/Cats?

User avatar
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

Re: Set partitions to hide or read only

#15 Post by nadir »

yes, but not only in theory. also in real.

i use either /media/what_i_choose_as_name or somewhere in my home-folder (usually there i call it Data)
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

Alex_80
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

#16 Post by Alex_80 »

Also out of media or mnt folder, in every subfolder of root folder?

User avatar
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

Re: Set partitions to hide or read only

#17 Post by nadir »

yes.
as far i know (as i usually do it like described i ain't got much experience doing it different, but i did)
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

Alex_80
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

#18 Post by Alex_80 »

Thanks.

What are the differences between to set authorizations (read only, read write, ...) from fstab file, /mnt/sdb5 folder and partition (labeled in my case "10 GB Volume") in Computer?

Alex_80
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

#19 Post by Alex_80 »

What is priority between authorization of "10 GB Volume", sdb5, fstab?

jjmac
Posts: 384
Joined: 2005-12-28 23:34
Location: Australia

Re: Set partitions to hide or read only

#20 Post by jjmac »

Howdy,


Alex_80 wrote:
>>
What are the differences between to set authorizations (read only, read write, ...) from fstab file, /mnt/sdb5 folder and partition (labeled in my case "10 GB Volume") in Computer?
>>
When you set the permissions directly to a mounted filesystem, as that is effectively what a mounted partition is ... your setting them in that filesystem.

This will over-ride whatever the permissions are for that mount point (ie; directory) in its' filesystem. The directory point will revert when the partition is unmounted.

When set in /etc/fstab, by that i think you mean passing options such as 'users' etc ... your just fine tuning the above. Even by setting allowable access to 'users', it will need that also to be the case in the mounted filesystem. But you could 'deny' that access via /etc/fstab though, even if allowed in the mounted filesystem. Effectively over-rideing that filesystem. But then, by mounting the filesystem somewhere else, you could over-ride its' other mount points accessibility.

That is not as complex as it might sound either :). But do, do some simple experiments with that just, to verify. It's been a while since i last had to do anything along those lines. And you wont do any harm in the process.

]# chmod 755 /mnt/some_dir
]# chown <name> /mnt/some_dir
]# chgrp <name> /mnt/some_dir

Using the above programs on a mounted partition will effect the changes needed to verify what i stated above. And are easily reversible.

Note:
-------
group member ships are not duplex in nature. That is, being the member of a group ... such as 'www_data' doesn't mean that 'www_date' is also a member of your user group.


jm
http://counter.li.org
#313537

-=- The FVWM wm -=- http://www.fvwm.org -=-

Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ...

Post Reply