[Solved] Set partitions to hide or read only

New to Debian (Or Linux in general)? Ask your questions here!

[Solved] Set partitions to hide or read only

Postby Alex_80 » 2010-02-21 22:42

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.
Alex_80
 
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

Postby ComputerBob » 2010-02-21 22:52

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
My Ministry
User avatar
ComputerBob
 
Posts: 1190
Joined: 2007-11-30 04:49
Location: The Beautiful Sunshine State

Re: Set partitions to hide or read only

Postby Alex_80 » 2010-02-22 18:42

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.
Alex_80
 
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

Postby ComputerBob » 2010-02-22 19:49

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
My Ministry
User avatar
ComputerBob
 
Posts: 1190
Joined: 2007-11-30 04:49
Location: The Beautiful Sunshine State

Re: Set partitions to hide or read only

Postby Tixy » 2010-02-22 22:49

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.
Tixy
 
Posts: 96
Joined: 2009-08-12 17:00

Re: Set partitions to hide or read only

Postby Alex_80 » 2010-02-25 00:16

Thanks, I'll try to edit fstab for change mount options and then I will report results.
Alex_80
 
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

Postby jjmac » 2010-02-25 00:53

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 ...
jjmac
 
Posts: 387
Joined: 2005-12-28 23:34
Location: Australia

Re: Set partitions to hide or read only

Postby Alex_80 » 2010-03-08 20:59

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?
Alex_80
 
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

Postby ComputerBob » 2010-03-08 21:23

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
My Ministry
User avatar
ComputerBob
 
Posts: 1190
Joined: 2007-11-30 04:49
Location: The Beautiful Sunshine State

Re: Set partitions to hide or read only

Postby Alex_80 » 2010-03-09 11:13

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?
Alex_80
 
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

Postby Absent Minded » 2010-03-09 11:30

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
User avatar
Absent Minded
 
Posts: 3757
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.

Re: Set partitions to hide or read only

Postby Alex_80 » 2010-03-09 11:59

Is this only a standard or there are real differences?
Alex_80
 
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

Postby Absent Minded » 2010-03-09 12:08

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
User avatar
Absent Minded
 
Posts: 3757
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.

Re: Set partitions to hide or read only

Postby Alex_80 » 2010-03-09 13:10

So in theory can I mount a partition everywhere?
For example in theory can I mount sdb5 partition in /My folder/Animals/Cats?
Alex_80
 
Posts: 43
Joined: 2010-02-21 21:04
Location: Italy

Re: Set partitions to hide or read only

Postby nadir » 2010-03-09 13:12

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.
User avatar
nadir
 
Posts: 5964
Joined: 2009-10-05 22:06
Location: away

Next

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable