Kevin Karhan :verified:<p><span class="h-card" translate="no"><a href="https://diaspodon.fr/@AugierLe42e" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>AugierLe42e</span></a></span> I assume that port is fixed to a specific USB Hub / Controller / Port and the button is similarly linked to some GPIO / I²C / PS/2 port...</p><ul><li>What you can do is check <code>lsusb</code> for <a href="https://infosec.space/tags/USB" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>USB</span></a> devices and see if the specific port in question has a USB mass storage device or SATA bridge chip attached to it when said button is pressed.</li></ul><p>If <a href="https://infosec.space/tags/QNAP" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>QNAP</span></a> used <a href="https://infosec.space/tags/Linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Linux</span></a> they should've provided those drivers / scripts as part of their <a href="https://infosec.space/tags/GPLv2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>GPLv2</span></a> obligations to buyers/owners of said <a href="https://infosec.space/tags/NAS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>NAS</span></a> boxes.</p><ul><li>Just don't expect any of that code to be useable, as <span class="h-card" translate="no"><a href="https://mstdn.jp/@landley" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>landley</span></a></span> can attest from the <a href="https://infosec.space/tags/BusyBox" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BusyBox</span></a> license enforcement…</li></ul><p>Either way if you can reliably identify the port & detect the button presses that <em>should</em> be sufficient to build like a <a href="https://infosec.space/tags/bash" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bash</span></a> or <a href="https://infosec.space/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> script to basically detect the drive, mount it and <code>cp -r /dev/$DRIVE/ /home/copied_drives/$LABEL/</code> </p><ul><li>It may need some fiddling and will most likely only work reliably on unencrypted drives with ext2-ext4, btrfs, ntfs, fat32, exfat filesystems...</li></ul><p>Pretty shure you'll have to tweak a bit unless you want to use <code>/dev/by-uuid/$UUID</code> and the UUIDs of the partitions as name...</p>