[Solved] Lost in the (sym) Links

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
SomeDudeInAZ
Level 4
Level 4
Posts: 251
Joined: Sun May 05, 2019 6:48 pm
Location: Scottsdale, AZ, USA

[Solved] Lost in the (sym) Links

Post by SomeDudeInAZ »

Hi Folks,

I've done my googling, and reading the man pages and still I can't seem to put this together the way I want. Granted, my system may be doing everything exactly right and my idea of what it *should* be doing are 2 totally different things.

What I want: Similar to this topic here viewtopic.php?f=90&t=341161

I want to create a "new" home directory for my files on a different physical drive. I also want to then do this for certain programs (like evolution email :x ) that don't use "profiles" in the way thunderbird does so that I can easily store my email and other "embedded" data on the drive of my choice. Almost like creating a "mini appimage"

This way I can back up my main system drive and my data will always be safe without having to worry about a restore. I'm tired of manually moving files around.

This post viewtopic.php?f=90&t=345208 seems to be exactly what I'm doing from a command line POV.

This sorta :? gave me what I was looking for:

Code: Select all

ln -s /mnt/da/daHome/Documents ~/foo
in that I now have a link in my home directory (called foo) going to the documents directory on another drive.

But foo didn't exist until I created the link. So am I tripping over the issue where to do what I want (basically redirecting all I/O from a hard coded directory to a user controlled directory) I have to delete the original directories first for the links to take?

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: Lost in the (sym) Links

Post by Moonstone Man »

SomeDudeInAZ wrote: Sat Apr 17, 2021 7:29 pm This sorta :? gave me what I was looking for:

Code: Select all

ln -s /mnt/da/daHome/Documents ~/foo
If that 'sorta :? gave [you] what [you were] looking for' then the simplest solution is to mount the new Documents directory over the top of the existing Documents directory in fstab.

Code: Select all

UUID=some.long.string              /home/your.username/Documents    ext4     defaults,user,exec,noatime,nofail    0      0
That's the basic idea, and while your description of what you want is very difficult to follow, I get the impression that what you actually want to do is mount a directory on a drive, not a partition. In that case, you need to use the bind mount option:

Code: Select all

/mnt/da/daHome/Documents       /home/your.username/Documents              none    defaults,user,exec,noatime,nofail,bind      0      0
That assumes you have already mounted the drive on /mnt in your fstab.

You also ask:
I have to delete the original directories first for the links to take?
The way you are doing it now, with a symlink, yes. If you use the fstab method then there is no need to delete the contents of the existing Documents directory because the mount will mask the existing content so that you will only see the content of the mounted Documents directory, however deleting the content is recommended so that you can avoid confusing yourself if the mount fails because if the mount fails then you'll see the original contents and likely will not know that the mount failed.

If none of that is 'sorta :? ... what [you were] looking for' then you need to consider the poor quality of your description of what you actually want to achieve and how you have posed an XY problem in the bargain.
Petermint
Level 9
Level 9
Posts: 2981
Joined: Tue Feb 16, 2016 3:12 am

Re: Lost in the (sym) Links

Post by Petermint »

Links have a confusing list of options. For anyone looking at links for this type of work, you need hard links, not soft links.

Mount options are also fun. The sda, sdb type of mount works when your disks are fixed in a desktop and you never change the SATA cables. The UUID identifications works when you decide to add a USB disk or add an M.2 disk that makes the BIOS reallocate SATA ids.

When you are logged in as you, you can change directories, like Documents, to another disk. You can then reboot to make Linux use the updated fstab.

To move your whole home directory, it is easier to boot a live Linux.

You can have a mass of disks reallocated. My desktop has home pointing to a separate disk. Home has Documents and Pictures on other disks. Timeshift has a separate disk. Backintime has separate disks including USB disks.

For an individual application, look through the application settings to see if you can change the location of the application settings. I do this for some applications so that every element of a project is in one project directory.
SomeDudeInAZ
Level 4
Level 4
Posts: 251
Joined: Sun May 05, 2019 6:48 pm
Location: Scottsdale, AZ, USA

Re: Lost in the (sym) Links

Post by SomeDudeInAZ »

Thank you both.

Given the unexpectedly large range of possible "sorta" solutions, it appears my lack of linux knowledge is tripping me up. More research is obviously required on my part before asking.

I'll mark this thread solved to not clutter things and leave it up as the idea of mounting a directory in fstab had not occurred me. Maybe it'll help someone else.

Petermint: Unfortunately, some programs (like Evolution Email) don't allow you to specify a discrete storage location; either from within the program itself, a config file, or even using dconf. So in a case where I want my data to be stored on my larger disk (my 2TB SSD vs my 64GB Mint partition on my multi-os boot drive), some sort of redirection mechanism is required.
Locked

Return to “Beginner Questions”