1

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)?

2 Answers 2

4

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?

Sign up to request clarification or add additional context in comments.

2 Comments

Maybe I wasn't clear. /home/kennedy is not a directory I created, it is the directory created for the user "kennedy" so that, when logged in as kennedy and looking at /home in the GUI you actually see the contents of /home/kennedy. What I want to happen is that when the user looks at that directory, they see the contents of /run/media/kennedy/data/Kennedy. I don't want to open /home/kennedy and see the symlink. the directory /home/kennedy should be nothing more than a window to the HDD directory. Do I need to remove the directory kennedy and create the symlink?
I am not sure what content is already there in /home/kennedy. So, it will be more prudent to do mv /home/kennedy /home/kennedy.old rather than removing it.
3

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.