Skip to content

Instantly share code, notes, and snippets.

@rho333
Last active September 1, 2021 06:21
Show Gist options
  • Save rho333/9282cea4d8e474dbf26abc1f8bf4739b to your computer and use it in GitHub Desktop.
Save rho333/9282cea4d8e474dbf26abc1f8bf4739b to your computer and use it in GitHub Desktop.
Mount ReadyNAS OS encrypted volume remotely over SSH

Remotely mounting a ReadyNAS volume over SSH

This is a not a shell script, run these commands manually. Tested working with ReadyNAS OS 6.10.4 Hotfix 1.

Procedure

Find your volume name:

ls /dev/md

First, place your keyfile in the nominal location and set permissions (you will need to scp this over).

cp <your_keyfile> /run/systemd/cryptsetup/<your_keyfile>
chmod 0600 /run/systemd/cryptsetup/<your_keyfile>

Cryptsetup and mount volume

/lib/systemd/systemd-cryptsetup attach '<your_volume_name>' '/dev/md/<your_volume_name>' '/run/systemd/cryptsetup/<your_keyfile>' ''

Remove keyfile from local filesystem

rm /run/systemd/cryptsetup/<your_keyfile>

Restart readynasd to get it to pick up on the new volume state

systemctl restart readynasd

Done!

logout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment