TK421
TK421

Reputation: 363

Symlink not being created

I'm running Fedora on a laptop with a small SSD and large HDD. I've got the OS installed on the SSD and my data on the HDD.

All my files are located at /run/media/kennedy/data/Kennedy

What I had before (and want again) is a symlink from /home/kennedy to that location. That way I'm not messing with actual /home, but when I am in /home as normal user, all my things are easily accessed and stored with plenty of space. Right now /home/kennedy has the standard directories; desktop, documents, downloads, and so forth. No files worth worrying about.

So I opened a shell, logged in as su, and entered

ln -s /home/kennedy /run/media/kennedy/data/Kennedy

expecting that when I cd /home/kennedy and ls, I would see all my lovelies. Instead, I see that standard folders and nothing more. Whisky Tango Foxtrot, over.

edit to add: I'm pretty sure the permissions are right, but only pretty sure. How do I check and correct that (if off)?

Upvotes: 1

Views: 4415

Answers (2)

l'L'l
l'L'l

Reputation: 47169

You have the command backwards, it should be:

ln -s /run/media/kennedy/data/Kennedy kennedy

Invoke the command while you are in your /home directory, then you should be set.

Upvotes: 3

codeforester
codeforester

Reputation: 42999

You have to reverse the arguments:

ln -s /run/media/kennedy/data/Kennedy /home/kennedy

This will:

  • run successfully if /home/kennedy doesn't exist (kennedy would be the new symlink)
  • fail if /home/kennedy exists and it is not a directory (symlink or a regular file); need add -f flag in such a case - ls -sf ...
  • if /home/kennedy is a directory, then the symlink will be created as /home/kennedy/kennedy

See this related post: How to symlink a file in Linux?

Upvotes: 4

Related Questions