In class IDiskRemote, all metadata file system operations use os file system api directly.
There is little extendiability if we want store the metadata of HDFS or S3 into distributed file system.
So I suggest change this way by using DiskPtr and will propose a pull request.

In addition, metadata of HDFS or S3 only store local FS which is not sharable.

multipart_upload.AddParts(part.WithETag(part_tags[i]).WithPartNumber(i + 1));
        }
        req.SetMultipartUpload(multipart_upload);
        auto outcome = settings->client->CompleteMultipartUpload(req);
        throwIfError(outcome);
        LOG_TRACE(log, "Multipart copy upload has completed. Src Bucket: {}, Src Key: {}, Dst Bucket: {}, Dst Key: {}, "
            "Upload_id: {}, Parts: {}", src_bucket, src_key, dst_bucket, dst_key, multipart_upload_id, part_tags.size());
    }
}
struct DiskS3::RestoreInformation
{
    UInt64 revision = LATEST_REVISION;
    String source_bucket;
    String source_path;
    bool detached = false;
};
void DiskS3::readRestoreInformation(DiskS3::RestoreInformation & restore_information)
{
    ReadBufferFromFile buffer(metadata_path + RESTORE_FILE_NAME, 512);
    buffer.next();
    try
    {
        std::map<String, String> properties;
        while (buffer.hasPendingData())
        {
            String property;
            readText(property, buffer);
            assertChar('\n', buffer);
            auto pos = property.find('=');
            if (pos == String::npos || pos == 0 || pos == property.length())