Re: mountpoint parameter

"Adolf Belka (gmail)" <[email protected]> Thu, 25 Sep 2025 19:09:31 +0200
Newsgroups gmane.network.unison.general
Message-ID <[email protected]>
I have been running with the mountpoint check for several years. This is how I have it defined.

--------------------
# Unison preferences file

# synchronisation roots
root = /mnt/Samsung_A20e/Card
root = /mnt/File_Server/Camera Pictures/Samsung A20e phone

# choose fastcheck type
fastcheck = true

# set FAT to true as sd card is FAT formatted
fat = true

# Paths to synchronise
path = DCIM

# Check that mountpoint exists
mountpoint = DCIM/Camera
--------------------

The root /mnt/Samsung_A20e/Card is where the memory card should be mounted for the sync to work.

The path to synchronise is everything from DCIM on the roots and the mountpoint check is looking if there is a directory named Camera in the DCIM directory. That will definitely not be present if the memory card has not been successfully mounted but it will always be present if the card has been correctly mounted.

Note that the mountpoint is relative to the roots hence it does not start with a /

Hope this helps.


On 25/09/2025 18:34, Greg Troxel wrote:
> Micha Silver <[email protected]> writes:
> 
>> Thanks Greg:
>>
>> On Thursday, 25 September 2025 at 18:51, Greg Troxel <[email protected]> wrote:
>>
>>> I just reread, and I see that the text is confusing. But I'd like to
>>> hear how you interpret the manual and the man page.
>>
>> In the docs the mountpoint parameter is described as a path.
>> "-mountpoint PATH causes Unison to double-check, at the end
>> of update detection, that PATH exists and abort if it does not"
>>
>> So following that I had tried several combinations of possible
>> "paths". When I entered the full path to the actual mount point
>> "/media/micha/backup" then the error was that absolute paths are not
>> supported. *Any* other string tried to append that string to the first
>> root and the backup aborted since there is no
>> "/home/micha/micha/backup", etc.
>>
>> What I expected was checking only the path of the externally mounted
>> file system. Or alternatively, allowing for separate "mountpoints" for
>> each root. (In general you would not expect the path of one root to
>> exactly match the path at the second root.)
> 
> The manual says:
> 
>    \SUBSECTION{Mount Points and Removable Media}{mountpoints}
> 
>    Using Unison removable media such as USB drives can be dangerous unless you
>    are careful.  If you synchronize a directory that is stored on removable
>    media when the media is not present, it will look to Unison as though the
>    whole directory has been deleted, and it will proceed to delete the
>    directory from the other replica---probably not what you want!
> 
>    To prevent accidents, Unison provides a preference called
>    \verb|mountpoint|.  Including a line like
>    \begin{verbatim}
>                 mountpoint = foo
>    \end{verbatim}
>    in your preference file will cause Unison to check, after it finishes
>    detecting updates, that something actually exists at the path
>    \verb|foo| on both replicas; if it does not, the Unison run will
>    abort.
> 
> 
> I interpret this as saying that foo should be a pathname within the
> replica, so that unison can error out if the replica isn't actually
> there.
> 
> Thus a reasonable value might be ".emacs" (if you're of that tribe), but
> really some file that is in your home directory, and thus will be
> missing if the removable media is not mounted.
> 
> The man page
> 
>       mountpoint xxx
>               Including the preference -mountpoint PATH causes Unison to
>               double-check, at the end of update detection, that PATH exists
>               and abort if it does not. This is useful when Unison is used to
>               synchronize removable media. This preference can be given more
>               than once. See Section “Mount Points and Removable Media” in the
>               manual.
> 
> is less clear, but it says that one should read the manual :-)
> 
> 
> The error
> 
>    Fatal error: Path /home/micha/micha is designated as a mountpoint, but points to nothing on host RMS
> 
> is also confusing, unless one has just read the manual in the last few
> minutes.
> 
> There is also confirmbigdel, but the man page notes that this is only
> for TUI.  (I wonder if that's still true.)
> 
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
> 

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].