How do I change the directory where daedalus stores its DB and logs in Linux?

Combining the two answers by @rickymac and @p-alik worked perfectly.

Detailed solution:

The shell script that installed the wallet on my distro (NixOS) put it in ~/.local.

I made a new directory on my large drive mounted on /data called /data/cardano.

I went to ~/.local/share/Daedalus and executed mv mainnet /data/cardano. After that completed I did ln -s /data/cardano/mainnet/ ./mainnet.

Next I made sure to edit ~/.local/bin/daedalus and ~/.local/share/Daedalus/mainnet/namespaceHelper (now symlinked to the big drive… this is what my desktop shortcut runs to start the wallet) to have the additions suggested by @p-alik. Both those files now look like this…

#!/usr/bin/env bash

set -ex

cd ~/.daedalus/
mkdir -p etc
cat /etc/hosts > etc/hosts
cat /etc/nsswitch.conf > etc/nsswitch.conf
cat /etc/machine-id > etc/machine-id
cat /etc/resolv.conf > etc/resolv.conf

export XDG_DATA_HOME=/data/cardano/mainnet

exec ./nix/store/4xbn31l2fr95vp9z7g7ayxzy19ywcpnd-nix-user-chroot-2c52b5f/bin/nix-user-chroot -n ./nix -c -m /home:/home -m /etc:/host-etc -m etc:/etc -p DISPLAY -p HOME -p XAUTHORITY -p XDG_DATA_HOME -- /nix/var/nix/profiles/profile/bin/enter-phase2 daedalus

After starting up the wallet again it is now using the shared drive AFAIK this is now working with no problems and no longer uses my SSD, which is shorter on space. Thanks all!

5 Likes