Upgrade deletes symbolic links /home /root

Hi all,
my directory tree contains

/media/externalDisk/users/home
/media/externalDisk/users/root

where “external disk” is a disk containing only data and it is mount in the position

/media/externalDisk

I use two symbolic links:

/home -> /media/externalDisk/users/home
/root -> /media/externalDisk/users/root

during “sudo pacman -Suuyy” the listed symbolic links are deleted and substituted by physical directories. Can you please avoid deleting the symbolic links?

I know that I could mount directly the directories using fstab. What is the problem of using the symbolic link?

Regards
MArco Righi

The update contained the package filesystem, which installs or restores directories and symlinks, and checks permissions, and that’s what had the effect on your system.

/home and /root are not supposed to be symlinks but real directories on the root filesystem. They can be mountpoints ─ albeit that this is not advisable when it comes to /root ─ but they must be directories. The permissions on symbolic links are never checked, which means that from the vantage of the package, there’s a discrepancy there with regard to security.

Technically, that should be fine ─ illogical as it is ─ but on account of Manjaro concretely, that is not supported, exactly because we use the filesystem package, which helps sort out a bunch of problems for newbies. The way you’ve set things up ─ while technically workable ─ is a very unusual corner case that we don’t officially support. :man_shrugging:

1 Like

Why illogical? The meaning of mount command is “mount” a resource. I have these directories on only one resource, an external disk. One resource, one mount.
After that the resource is mounted, it is elegant to connect the resource with s symbolic link. I could use mount command with / home and / root, mounting a resource already mounted, and creating some dependencies between mounts points … is it logical when it is avoidable?
I like Manjaro and for some aspects, I consider this distribution one of the best distribution but no one distribution is perfect. I tried a lot of linux distributions with my work: Slackare, Red-Hat, Fedora, Gentoo, Debian, Ubundu, EndevourOS, Puppy, Lubuntu and others… and Majaro is the best for me. But this constraint could be generate a warning instead of delete the links. Every thing cam be improved, I think.

Why not simply mount whatever partition contains those files directly to /home? Why mount it to /media/externalDisk/users/home and then change /home into a symlink? That is the illogical thing here.

And the contents of /root should either way reside on the root filesystem itself, or you will be having problems when booting up in single-user maintenance mode.

Furthermore, there are yet other ways to do the same thing as what you’re doing, i.e. by using bind mounts.

Perhaps, but like I said, your usage scenario is a corner case ─ you might very well be the only person who does things that way ─ and this corner case was not incorporated in the filesystem package.

1 Like

Am I correct that the OP’s problem is that he sym linked root and home specifically? Symlinks inside of Home should be untouched by the update correct? I ask because I use Symlinks inside of home for Music, Video etc folders. Thanks.

The OP has replaced both /home and /root with symlinks to directories on another drive, instead of mounting a partition from the other drive on /home directly and leaving /root alone.

1 Like

Is it the right point of view an upgrade that deletes a directory? I think no, but I am not a package maintainer. It seems a bug, not a feature. I ask to correct the bug even if it afflicts only a few users.
Regards

No. Updates don’t delete those directories. If it did there’s b e a lot more issues here on the forum as well as any other distro’s forum.

When you delete a directory that is a symlink, the directory and it’s contents aren’t deleted, only the link itself.

1 Like

It does not delete anything; it restores the filesystem hierarchy as it was supposed to be, and in doing so, it replaced those two symbolic links with actual directories, because that’s what they are supposed to be.

It’s not a bug; it’s the explicit purpose of the filesystem package.

/home is supposed to be a directory, and its contents can live either on the root filesystem, or on another filesystem that’s mounted at /home. Your usage scenario of mounting that other filesystem under /media and then converting /home into a symlink to the other mountpoint is actually a pretty perverse and illogical way of doing things.

In addition to that, as I have already told you twice before, /root is meant to live on the root filesystem, because it contains the root user’s shell environment, and if the system is booted up into single-user maintenance mode, then no other filesystems than the root filesystem ─ and possibly /usr if you have that separate, in which case it’ll be mounted from within the initramfs ─ will be mounted.

1 Like

We can continue to discuss along. The packages brutally destroy a symlink. It is the first OS that does that.
It is a perfect logical solution, very similar to the one chosen in MacOS.

You can continue to follow you solution and defend it. It is easy to write a script to correct your bug.

It’s not a bug; it’s a design decision. But you are free to write your script and use it.

You are however correct that this discussion could easily go on forever, and considering your tenacity at wanting to do things the wrong way and then complaining about the results, I think it’s probably wisest to just close the thread.

3 Likes