LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Formating and changing permissions (https://www.linuxquestions.org/questions/linux-newbie-8/formating-and-changing-permissions-731413/)

PC_Head 06-08-2009 08:07 AM

Formating and changing permissions
 
Hi. Im very new with Ubuntu 9.04 as i HATE windows. My questions are
1. How do i format a HDD?
2. How can i change the permissions when trying to hide a folder?

I have searched a lot of Linux forums and have tried many different suggestion but none seem to work for me. Like i mentioned, im very new to this, about 4 hours now.

The reason i wish to format 1 of my HDD is so it has Linux format on it and not Windows. When i try to hide a folder, i get the message 'you are not the owner, so you can not change these permissions'. I am the owner and its not 'root'.

I will be greatful for any help.

Thanks in advance.

PC_Head 06-08-2009 08:08 AM

Hi. Im very new with Ubuntu 9.04 as i HATE windows. My questions are
1. How do i format a HDD?
2. How can i change the permissions when trying to hide a folder?

I have searched a lot of Linux forums and have tried many different suggestion but none seem to work for me. Like i mentioned, im very new to this, about 4 hours now.

The reason i wish to format 1 of my HDD is so it has Linux format on it and not Windows. When i try to hide a folder, i get the message 'you are not the owner, so you can not change these permissions'. I am the owner and its not 'root'.

I will be grateful for any help.

Thanks in advance.

sycamorex 06-08-2009 08:10 AM

1. Install gparted:
Quote:

apt-get install gparted
It's a nice GUI partition manager where you can edit partitions.
2. What exactly do you want to modify with the folder you are talking about?

PC_Head 06-08-2009 08:13 AM

Quote:

Originally Posted by sycamorex (Post 3566785)
1. Install gparted:

It's a nice GUI partition manager where you can edit partitions.
2. What exactly do you want to modify with the folder you are talking about?

Ok. Where do i write 'gparted' in? Terminal?

I wish to make the folder hidden and password protected upon view.

jdkaye 06-08-2009 08:15 AM

Quote:

Originally Posted by PC_Head (Post 3566782)
Hi. Im very new with Ubuntu 9.04 as i HATE windows. My questions are
1. How do i format a HDD?
2. How can i change the permissions when trying to hide a folder?

I have searched a lot of Linux forums and have tried many different suggestion but none seem to work for me. Like i mentioned, im very new to this, about 4 hours now.

The reason i wish to format 1 of my HDD is so it has Linux format on it and not Windows. When i try to hide a folder, i get the message 'you are not the owner, so you can not change these permissions'. I am the owner and its not 'root'.

I will be grateful for any help.

Thanks in advance.

Hi,
1. You can use mke2fs to create an ext2/3 file system on your HDD.
2. chmod can be used to change permissions on files/folders.
Typing
Code:

man mke2fs
and
Code:

man chmod
at the command line will give you information on how to use these programs.
cheers,
jdk

PC_Head 06-08-2009 08:30 AM

Quote:

Originally Posted by jdkaye (Post 3566795)
Hi,
1. You can use mke2fs to create an ext2/3 file system on your HDD.
2. chmod can be used to change permissions on files/folders.
Typing
Code:

man mke2fs
and
Code:

man chmod
at the command line will give you information on how to use these programs.
cheers,
jdk

Sorry guys but im just not gettin it at the moment. gparted-how do i install it or is it stand alone? i downloaded it but it wont install.

i found out that by putting a . (dot) infront of the folder name and then pressing Ctrl H, i can hide it from view but i want to hide it so pressing Ctrl H or something will prompt a password. can wfat im asking be done?

jdkaye 06-08-2009 08:48 AM

These are all programs that should be already installed on your system. Yes, placing a dot in front of a filename with "make it sort of invisible" but any file manager can be set show all files including hidden ones. They are not very hidden by your method. Changing permissions is more secure.
cheers,
jdk

sycamorex 06-08-2009 09:13 AM

If gparted is not installed by default, you need to go to the command line, log in as root (su + password) and type: apt-get install gparted
Then it will appear in the menu.

i92guboj 06-08-2009 09:52 AM

Quote:

Originally Posted by PC_Head (Post 3566781)
Hi. Im very new with Ubuntu 9.04 as i HATE windows. My questions are
1. How do i format a HDD?

To format a disk, you can just use mkfs, no need for gparted. You can use gparted if you prefer graphical programs. But there's not much point in doing so, other than aesthetics. To create a filesystem for example using vfat (so you can read it from windows as well) you can do

Code:

sudo mkfs.vfat /dev/<whatever>
Change <whatever> by whatever disk you want to format. This command can be used to see the available disks and partitions.

Code:

sudo fdisk -l
Make sure you don't format the wrong one by error. If you still want to use gparted instead, you need to install it. In Linux, you don't usually go fishing programs around the net to install them. You can use the package manager of your distribution to install anything you need, as someone else pointed out above.

Quote:

2. How can i change the permissions when trying to hide a folder?
There's no such thing as a 'hidden' attribute in Linux. By convention (and only by convention) a file is considered hidden when its name starts with a dot. That way ls and most file managers will not show it unless you instruct them to do so (ls -a, or whatever menu option there's in your file manager to show hidden files).

Describe exactly what do you want to do. By default, no use should be able to see your files unless you grant them permissions to do so. You can use this command over any file or directory to make sure that no other user (but you) is able to read your files or enter your directories:

Code:

chmod go-rwx <whatever file or dir>
In graphical file managers there's usually some kind of dialog (try right click and look at the menu) to set the permissions of a file or group of files and directories. Sometimes after opening such dialog you need to press some kind of "Advanced" tab or button so you can see all the permissions. Just disable all of them for 'group' and 'others', and set whatever you want for 'user'.

Quote:

The reason i wish to format 1 of my HDD is so it has Linux format on it and not Windows. When i try to hide a folder, i get the message 'you are not the owner, so you can not change these permissions'. I am the owner and its not 'root'.
What files are you trying to change the permissions on? If they are not yours you can't change the permissions. That's the intended way, otherwise, permissions would have absolutely no sense, would they?

Root of course can change the ownership and permissions of any file. You should only be changed permissions in the files on your home directory, the rest of the files of your system (i.e. in /etc or /usr or whatever that's not /home) do have a given ownership and permissions for a reason, and changing them could greatly damage your installation to the point of rendering it useless.

Try do describe what exactly do you want to do.

About the password thing, you can't password protect a directory. You could however take another approach, like use a password protected archive on an encripted partition (that you could in turn mount in whatever directory you want).

i92guboj 06-08-2009 09:55 AM

Quote:

Originally Posted by sycamorex (Post 3566849)
If gparted is not installed by default, you need to go to the command line, log in as root (su + password) and type: apt-get install gparted
Then it will appear in the menu.

Just a note, I have no real experience with ubuntu, but according to what I read around everyday, root login is disabled by default, so you would instead do this:

Code:

sudo apt-get install gparted
Or use synaptic or whatever ubuntu uses these days to install software.

sycamorex 06-08-2009 10:15 AM

Quote:

Just a note, I have no real experience with ubuntu, but according to what I read around everyday, root login is disabled by default, so you would instead do this:
Yeah, my mistake. I forgot about it.


All times are GMT -5. The time now is 02:08 PM.