published
updated
https://gist.github.com/shamil/62935d9b456a6f9877b5
{{{bash
sudo modprobe nbd
qemu-nbd --connect=/dev/nbd0
You can now look around and explore the filesystem for any files you wanted
In particular I wanted my postgres databases, as a backup was taken a week ago, and I could still get the fresher data.
Getting postgres going
⚠ This is shady ⚠
I needed to edit the postgresql.conf
to make it run in the /tmp
directory, instead of granting permission of /run/postgresql
(I don't run psql on my laptop)
postgresql.conf
was already a broken symlink. The /nix/store
was different.
{{{bash
useradd postgres
nix-shell -p postgresql_11
pg_ctl start --pgdata="
Look around for the databases and users you want to restore
sudo useradd freshrss sudo -u freshrss pg_dump -h /tmp freshrss > freshrss.sql
sudo useradd gitea sudo -u gitea pg_dump -h /tmp gitea > gitea.sql }}}
= Don't forget to clean up! =
{{{bash
sudo umount