For macOS 10.10 and later only. This script applet will go through the iTunes library and sort each track into a new discrete playlist named for the drive on which each track's file is located.
New playlists will be named something like "--> Files_on_volume Local drive", "--> Files_on_volume MyBook2TB", and so on.
Perhaps Also of Interest...
downloaded 22m 11s ago
Recreate a playlist such that its visible columns mirror the Music library
downloaded 22m 34s ago
Delete files downloaded and cached by Apple Music
downloaded 28m 38s ago
Perform tasks on a batch of playlists; rename, delete, duplicate, merge, more
downloaded 51m 11s ago
Delete characters from the beginning or ending of selected tracks' name, artist, album, comments, composer, or show tags
downloaded 52m 3s ago
Create a playlist for each entry of a specified tag
downloaded 1h 12m 22s ago
Exports and then re-imports selected tracks' artwork