PDA

View Full Version : Writing to / and subdirs.



bikerman
04-14-2004, 02:11 PM
Hi, folks.

I searched hi and low before asking this because I felt sure someone else would have had the question. But I couldn't find a single one! Maybe I'm just dense. :) I'm not a newbie to Linux by any means, but I am fairly new to Knoppix...though I have managed to remaster a time or two.

I would like to be able to install software (debs for example, or just software I compile under knoppix) on the running knoppix system. I don't want to remaster and don't want the changes to stick, just want to play with something new. But I can't b/c the root filesystem is always mounted read-only. I tried

# mount -o remount,rw /dev/cloop /KNOPPIX

and was able to write to /, but still couldn't write to any subdirs. Is there a trick or am I wanting to do the impossible?

Many thanks,
Ben

Cuddles
04-15-2004, 12:22 AM
BikerMan,

First, I assume you are running off the CD, right? (Or, do you have Knoppix booted/installed on your hard drive?)

Using the CD, or installed on the hard drive, can change the whole response to your question...

From what I have found out, and this is from having Knoppix installed on my hard drive, for more than a few months now... I have needed to "put" files in locations on my hard drive, that are NOT just in my /home folder, some are programs, binary files, and even "shared" documents...

First problem is the device itself, it can be mounted Read-Only, appears you have gotten around that little hitch - the second is permissions. You have three sets of permissions, each of these can have three kinds of settings, as well. The permissions are for: User, Group, and Other. The user would probably be for the person who created the source. Group would be for the "group" the user is associated with, and lastly, Other would be for any one not the User, or in the Group. A "source" can be either a folder, or a file, the file can be a document, binary (program), or folder.

For each of the three above, you can have Read, Write, and eXecute settings. Read and Write are as implied, if a User, Group, or Other have access to Read and Write, they can view, or change, the file or folder. Execute gets a little grey, because if the "source" is a folder, it actually means "enter" access, if the "source" is a program, or binary, then it is as implied, they can execute it.

If you look at the permissions of any folder, file, or program, you will usually see the permissions in the form of "drwxrwxrwx" - "d" would designate a folder, or directory, the three sets of "rwx" after that would be for User, Group, and Other, respectfully, after that.

If I recall right, the "/" root access on a device, is usually something like "drwxrw.r.." -=- Note the [dots] designate missing permissions in the listing - This permission string would be broken down into the following: First, it is a directory, or folder - User has Read, Write, and eXecute -=- Group has Read and Write, but not eXecute -=- and Other has Read Only access.

On "shared" folders, or files, you will want to ensure that everyone has access, or permissions to changing, or running what is to be shared. Usually a commond like "chmod" and even "chgrp" to change the group for the "source". Another way is through the GUI interface, using Konqourer and right-clicking on the "source" and selecting "Properties".

I tend to go for the command line interface, it is easier, and can be checked quicker, to ensure that it changed the way you wanted.

from the command line:
chmod 777 [folder] -=- will change properties on [folder] to drwxrwxrwx.
chmod -R 777 [folder] -=- will do the same as above, except it also is Recursive to its contents, and any subfolders and files it contains.

chgrp [user] [folder/file] -=- changes the Group User to [user] for [folder/file]
chgrp -R [user] [folder/file] - same as above, but it also is Recursive to all subfolders and files.

You might want to look at the manual pages for these two commands, by using the command "man" followed by the command you want help on... Like:

man chmod
or
man chgrp

I think the reason you are having Write and Read problems is because of the permissions set on where you are trying to put these files. You might want to check them, and if they appear to be correct, post back with some more information on the permissions you have on the spectific folders you are trying to save into, and what "User" is trying to do this save - sometimes Root can be the only User to write into certain areas, whereas, Other and User, can read, write, and execute in other areas, depending on the permissions set.

Hope this helps,
Cuddles