Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've been stumbling again and again over a very silly issue with making and/or removing links in the Gnome environment.
for example when I try to make a link to folder which placed on a partition other than the OS parition of the current linux I get a permission denied message (now why the hell is that??)
why am I denied to create a simple link to a folder??
NO , the access rights are NOT read-only ! (in case you thought that)
I repeat , read-write is enabled on all drives/partitions!
and when I try to make a link to mount folder shall we say (/something) it's done successfully but when I want to get rid of it , it just won't go away !
it says something like "the link is to a different partition...etc" this problem has given me a headache , can somebody tell met what's so difficult about those links anyway!?
Just saying that the access rights are not read-only is not sufficient, check if they are writable for the user you are currently logged-on as.
Another thing might be that the partition is mounted read-only, permissions would still show read/write but you wouldn't be able to create any files (symlinks are files)
If all of the above is taken care off and you are still not able to do what you want, how about opening a terminal (gnome-terminal) and trying if you can create the links yourself (man ln), and/or if you can remove them yourself (man rm,man unlink)
I seem to recall something about hard links not working across different partitions...
I always use soft links (ln -s)
However you are logged in, if you can take action on a file (ie read, write, or execute), then you can link to it with the same privileges.
Finally, link creation is funny about full path names. I find the easiest way is to always link "in"---ie, while in the folder where the link will be, do this:
ln -s <full path>/<filename>
(With no name for the link specified, it automatically creates the link named <filename>)
And I have never been unable to delete a soft link.
Just saying that the access rights are not read-only is not sufficient, check if they are writable for the user you are currently logged-on as.
Another thing might be that the partition is mounted read-only, permissions would still show read/write but you wouldn't be able to create any files (symlinks are files)
If all of the above is taken care off and you are still not able to do what you want, how about opening a terminal (gnome-terminal) and trying if you can create the links yourself (man ln), and/or if you can remove them yourself (man rm,man unlink)
All of what you suggested has been tried over and over again without any success.
as a remainder: I'm logging in as ROOT! all partition are enabled for read-write-execution (for the root)
and I can read , create , delete , manipulate , etc all types of files on all partition only the link files are making problems.
Quote:
always use soft links (ln -s)
However you are logged in, if you can take action on a file (ie read, write, or execute), then you can link to it with the same privileges.
Soft links?
aha , now what the hell is difference between hard and soft links?
I'm going to check out the method you suggested , but there is still something making trouble..
assuming the un-deletable links are hard links to a partition mis/placed on another one , the question is HOw do I get rid of those bloody bits ??
and finally why is this link creation so un-neccessarily complicated in linux?
You can't create a hard link to another filesystem. You need to create symbolic links instead.
See the "man ln" manpage and "info coreutils" manual for more information.
OK , I'm looking into this , but you didn't answer my question of how to remove aleady existing hard links. and what's the difference between hard and symbolic?
Btw , did I forget to mention that the partition in question is Fat32 , in case that would change anything just to let you know.
ATTENTION PLEASE - update:
OK i've figured out how to do it , first i open a console , cd to the directory where the link should exist , then type "ln -s /where/are/you/mysoandso.this mylinkname" and walla I've my shortcut in place!
NOw removing it , I just open a console , cd to location , then use "rm mylinkname" and Poof! the link gets eighty-sixed like Donald Ramsfield , hehe
what did i want to say at last? Ah yeah despite the sure knowledge that I'm gonna bath in tomato 2nite. LOL
"The way linux handles link creation/deletion is totally freaking idiotic!" a statement by entz.
not that I hate using the console , absolutely not ! I love typing commands and doing stuff like that but giving a permission denied error as if I was trying to delete the system partition or anything else in that direction just because I used the "straight forward logical" GUI way to create and delete links instead of typing ln -s ... and /or rm etc iS just plainly and unbelievably frigged up!
NONEthless , I'd like to thank you guys for giving me hints in solving another linux crisis.
You shouldn't log in as root in normal circumstances because it's a security risk and things.
if you quickly type
rm -rf ./
but miss out the . then you've just deleted everything on your hard drive from root (/) onwards.
so the theory is only log in with the privileges you need.
I find command line is much easier and more precise then gnome.
Try:
ln -s /some/random/file stuff
Where ln is the link command, -s specified symbolic (soft) /some/random/file is the path of the file you want to create the link to, and stuff is the name of the link you're creating.
A symbolic link is a pointer to another point, the windows definition of a link basically.
A hard link is in essense creating a copy of the file without using any extra disk space. You're giving one file more than one location, if you delete one hard link, the others remain pointing to it. If you delete the last one, you delete the item.
if you want to remove a link, you should be able to do
rm stuff
if it's a link to a folder, make sure you don't have a slash on the end.
You shouldn't log in as root in normal circumstances because it's a security risk and things.
if you quickly type
rm -rf ./
but miss out the . then you've just deleted everything on your hard drive from root (/) onwards.
so the theory is only log in with the privileges you need.
Yeah yeah , theory *sigh*
well I'm the type of guy who runs around with his gun ALWAYS UNSECURED and ready to fire , IF ya know what i mean LOL
plus i don't usually use the command line to do file management (creating , copying , deleting ,etc) I prefer the GUI it's much much nicer and shall I say more "advanced" (there is a beautiful device called Mouse , which was invented so ppl can use it)
and in the worst case , I've a big gigantic 280 GB external backup HDD that holds a second copy of everything important to me.
about the possiblity of a remote attack or something , I guess the attacker will have a hard time trying to get in and even in case he/she got it , the attacker would gain full access regardless of me logged as root or not .
Even if you have your gun always cocked and unsecured (mmm pun!), then still you shouldn't run Linux as root!
Having users with your mentality is bad because it creates a culture of people that don't care about security and that my friend is what windows is all about. So be fair to us, fellow users, and follow our advice, or go back to windows if you want an os that doesn't care about security.
The Fat32 filesystem is a foreign filesystem. The fat32 filesystem doesn't contain inodes. They are created dynamically in the VFS system after it is mounted. Since a hard link is another inode to the same file, you won't be able to create a link on a VFAT drive. I don't know if you can create a symbolic link from a Linux partition, such as a ext3 partition, and have it reference a file on a Fat32 partition. I doubt it.
Running as root is dangerous. Anything can happen, either by someone else maliciously or an accident. Suppose you wanted to delete all of the files and directories in ~/Documents/trip/ and instead of typing rm -rf ~/Documents/trip/* you accidentally typed rm -rf ~/Documents/trip /*.
This simple typo would delete your entire installation. If you ran it as a normal user, you would only delete your own files in /tmp and /home/<username>/. Also, you might realize your mistake due to all the error messages and hit Cntrl-C to cancel before the command reached your home directory.
Sometimes you need to start a config program as root. You can use kdesu or gnomesu to launch a graphical program as root, or use sudo to run a console command as root. You might want to read "man sudo" and "man visudo" to learn how to setup sudo.
Some of the console commands can get tricky, because an argument can be interpreted as either a file or a directory. For example:
mv file file2
will rename "file" to "file2" if there isn't a file directory, but move the file to file2/file if there is. Of course you could enter "mv file file2/" which would be interpreted as moving the file to a directory and fail if the directory didn't exist. The ln command allows you to create a target or targets in a directory. If there is only one target, the first form and third form (listed on the "man ln" man page) look identical.
However, your situation is due to using the wrong type of filesystem for doing this sort of thing and doesn't have to do with the ln command.
I don't know if you can create a symbolic link from a Linux partition, such as a ext3 partition, and have it reference a file on a Fat32 partition. I doubt it.
You can definitely create a symbolic link from somewhere on a Linux partition to somewhere on a FAT32 partition, I have done it a number of times.
Quote:
Originally Posted by jschiwal
Running as root is dangerous. Anything can happen, either by someone else maliciously or an accident. Suppose you wanted to delete all of the files and directories in ~/Documents/trip/ and instead of typing rm -rf ~/Documents/trip/* you accidentally typed rm -rf ~/Documents/trip /*.
This simple typo would delete your entire installation. If you ran it as a normal user, you would only delete your own files in /tmp and /home/<username>/. Also, you might realize your mistake due to all the error messages and hit Cntrl-C to cancel before the command reached your home directory.
Sometimes you need to start a config program as root. You can use kdesu or gnomesu to launch a graphical program as root, or use sudo to run a console command as root. You might want to read "man sudo" and "man visudo" to learn how to setup sudo.
First of all the user said that thay don't do file management from the command line (but you don't appear to have read that).
Secondly, whatever typo one may make will have exactly the same effects whether it's done from a root login session or with sudo.
Thridly, loging in as a restricted user doen't protect any of that user's files in any way. Considering that it is the users pesonal files that are important wheras the restricted area will contain only software that is either downloaded free or installed from disks that the user could install from again, loging in as a restricted user will only protect data that is of no real value anyway.
Some members seem to think that the world will explode if anyone ever logs into their own computer as root. It won't.
It is all about limiting damage and giving one time to think. I have several logins, each with a specific task. If I log in as user A all I can damage is my user A files. Users B,C, and D files are all safe from whatever A does. If one logs in as root you can wipe out root, A,B,C and D all in one error.
Using su -, forces one to think for just that one extra second that can be the difference between whoops and whew (almost whoops).
First of all the user said that thay don't do file management from the command line (but you don't appear to have read that).
Mishaps can happen with the mouse or when entering text in a dialog.
Quote:
Secondly, whatever typo one may make will have exactly the same effects whether it's done from a root login session or with sudo.
True, but the example I gave was in the home directory were a person wouldn't use sudo. A mishap when doing adminstrative work could be dangerous, but when when doing normal things, sudo wouldn't be used. Running normally as root is very dangerous. If you log in as root you will do more things than you need to as the root user.
Quote:
Thridly, loging in as a restricted user doen't protect any of that user's files in any way. Considering that it is the users pesonal files that are important wheras the restricted area will contain only software that is either downloaded free or installed from disks that the user could install from again, loging in as a restricted user will only protect data that is of no real value anyway.
If the command arguments of a regular users command start with a system directory, then the stream of errors would indicate a problem and allow one to abort before the personal files are wiped out. Running as root, things like deletions would be successful. Also, using sudo, the commands are logged so you would have a better chance of remembering what you did earlier in case some changes were not successful.
I really don't understand why new Linux users have so much problem understanding the proper use of the root account. Maybe it is because of so many people being wrongly indoctrinated by microsoft.
Fact is: Linux separates root account from ordinary users for a variety of reasons, not only to prevent us from typos or carelessness, but also from malicious programs.
Running as root all the time means that any program you start has the same privileges as you, meaning ALL privileges, meaning it can access all devices connected to that pc, it can access all files, and it can access all computers that you have in your .netrc file, or that have your public key.
While this is not the end of the world, this kind of behavior is exactly what windows does. The result of that is that 99% of all spamware, scamware, virus, and other malicious software is targeted to windows.
The fact that there are (almost) no viruses targeted to Linux is not because of the incompetence of the virus writers, but of the "sane defaults" that come right of the box, meaning that any potential virus is as good as useless unless it can run as root.
And this thing of "I'm always careful" is rubish! we are humans and as such we make mistakes; if not today, then tomorrow.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.