[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: improvement for 'ln' to add the '-m' switch
From: |
Dragan Simic |
Subject: |
Re: improvement for 'ln' to add the '-m' switch |
Date: |
Fri, 09 Feb 2024 14:47:23 +0100 |
Hello,
On 2024-02-09 09:22, aotto wrote:
I understand your concern because from a technical point of view a
"link" and "mount" is something total different
*but* from an end-user point of view the end-user want to have the
"srcDir" mapped (I use "mapped" because I want *not*
use the term "link" or "mount") into the "tgtDir" because the end-user
*require* this.
As Bernhard already explained, linking files and performing mounting
are two distinctively separate, different operations. As such, they
belong to two different userspace utilities.
for my special case the "ln -s .." is even don't work with git and so
I was left scan the internet for such a simple task.
the classic "mount" feature does even *not* fit because, as you
mentioned also, the mount does *not* survive a reboot.
Perhaps you can add the required mount commands to the startup
scripts of your system. Even more conveniently, bind mounts can be
defined in /etc/fstab, [1] please read the fstab(5) man page.
I came up with the "ln -m ..." purpose because this is the end-user
front-end for "mapping" a directory/file into an other place.
I understand that this is *not* easy because to survive a reboot
without "spam" the "/etc/fstab" definitely require a new technology.
As already explained, such an approach simply wouldn't fit into
the way things are intended to work, despite what they might look
like when viewed from the end-user perspective.
[1] https://man.archlinux.org/man/fstab.5
On 09.02.24 09:10, Bernhard Voelker wrote:
[+coreutils ML]
On 2/8/24 17:43, aotto wrote:
> Hi, I write to you because of a suggestion from the "https://serverfault.com/"
Q&A side
you sent this to my personal email, so you're lucky this didn't land
in spam.
Hence I'm hereby forwarding to the coreutils mailing list.
> subtract: add a "-m" switch to "ln" to support "mount -bind srcDir tgtDir"
>
> As reference please read:
>
> →
https://serverfault.com/questions/1153146/improvement-add-new-switch-to-ln-called-m-to-link-a-directory-as-mount
>
> As original reference please read:
>
> →
https://stackoverflow.com/questions/77954023/git-check-in-a-file-in-a-symlink-directory-fails/77960139#77960139
>
>
> mfg
>
> aotto
ln(1) is the userland tool for the link/linkat system calls for hard
links
and for the symlink/synlinkat system calls for symbolic aka soft
links.
Both hard and soft links are persisted in the file system.
mount(1)-ing is a completely different matter, because it tells the
kernel
to well, mount(2), one file system (or part of it) on another place,
and
this is gone when the system reboots.
Therefore, I don't see any common point in this, and therefore adding
such
a functionality to ln(1) is the wrong thing to do.