How does macOS select a name for a Time Machine backup? I see a folder

/Volumes/WD MyPassport/Backups.backupdb/GregoryMBpro


and /Volumes has

~/ &gt; ls -l /Volumes
total 0
drwxr-xr-x+  3 root    wheel   94 21 Sep 09:08 Preboot
drwxrwxr-x  16 gregory staff  632  2 Nov  2014 WD MyPassport
lrwxr-xr-x   1 root    wheel    1  7 Oct 22:37 elcapitan -&gt; /
~/ &gt; 


while the "Computer Name" I chose under Sharing in System Preferences is "Gregory's MacBook Pro".

(Note to self: it's a bad idea to name a volume after an OS release that will be upgraded sooner or later.)

What is the mapping between these names? In particular, if I change the name of either the volume or the computer name (under Sharing), would I inadvertently start a new Time Machine backup?

Relevant


Time Machine Backup Precautions
The name of the Time Machine ’backup disk’ (‘WD MyPassport’ in your example) does not matter. You can rename this as you wish and Time Machine will continue to back up as usual. References to the backup disk name in places such as Time Machine preference pane will be updated accordingly automatically. Per tmutil man page:


  In Mac OS X, HFS+ volumes have a persistent UUID that is assigned when the file system is created. Time Machine uses this identifier to make an association between a source volume and a snapshot volume.


The computer name (‘GregoryMBpro’) is used as the ‘machine directory’. Like the backup disk, you can rename your computer such as from the Sharing preference pane and Time Machine will continue to back up to the previous computer name. This is because…


  Machine directories and sparsebundles are owned by one computer at a time, and are tracked by unique identifiers rather than computer name, host name, or ethernet address.


However, unlike renaming the backup disk, renaming your computer doesn't rename the actual directory path used for backups — rename your computer and it will continue to back up but to the old computer name.