Release / Cria a release (push) Canceled after 0s
Release / CLI (linux-aarch64) (push) Canceled after 0s
Release / CLI (linux-x86_64) (push) Canceled after 0s
Release / CLI (macos-aarch64) (push) Canceled after 0s
Release / CLI (macos-x86_64) (push) Canceled after 0s
Release / CLI (windows-x86_64) (push) Canceled after 0s
Release / App desktop (linux-x86_64) (push) Canceled after 0s
Release / App desktop (macos-aarch64) (push) Canceled after 0s
Release / App desktop (macos-x86_64) (push) Canceled after 0s
Release / App desktop (windows-x86_64) (push) Canceled after 0s
Release / Publica a release (push) Canceled after 0s
2.8 KiB
2.8 KiB
Running Guará with Docker
The image contains the guara command line tool and smartctl. It is useful in three cases:
- A Linux server or NAS without a desktop, with the damaged disk plugged in.
- Forensic image files (
.img, E01, AFF4) on any system with Docker, because no device access is needed. - A reproducible environment for scripts and CI.
It is not the recommended way for most people. For a desktop, use the packages from Releases.
Limits
- Raw devices only work on Linux hosts. On Windows and macOS, Docker runs inside a virtual machine and does not pass physical disks through. Use an image file instead.
- The graphical interface is not served from the container.
guara uilistens only on127.0.0.1and accepts only thatHost, by design; opening it to the outside would weaken that protection, so it is not part of the image. - Files written to a mounted folder belong to root unless you pass
--user(possible when you work on image files).
Build
docker build -t guara .
Image files (any system)
Mount the folder with the image read-only and a separate folder for the results:
docker run --rm \
-v "$PWD/images:/images:ro" \
-v "$PWD/out:/out" \
--user "$(id -u):$(id -g)" \
guara scan /images/disk.img --session /out/s.json --list
docker run --rm \
-v "$PWD/images:/images:ro" -v "$PWD/out:/out" \
--user "$(id -u):$(id -g)" \
guara recover /out/s.json /out/recovered
A physical disk (Linux host)
Pass the device read-only with the :r flag. Docker then blocks writes to it at the kernel level, in addition to Guará never writing to the source:
docker run --rm \
--device=/dev/sdb:/dev/sdb:r \
-v /mnt/other-disk/out:/out \
guara scan /dev/sdb --session /out/s.json --list
- The destination must be on another disk than
/dev/sdb. - Reading a raw device needs root inside the container, so do not pass
--userhere. - Verified locally with a loop device (Linux):
inspect,scanandrecoverread through--device=...:r, and a write attempt (dd of=/dev/loop0) fails withOperation not permitted. Loop devices are hidden fromguara devices, like other virtual devices, so pass the path explicitly; a real USB disk does appear in the list. - SMART depends on the host, the controller and the device.
--cap-add=SYS_RAWIOis the usual addition when--devicealone is not enough, but this was not verified with a loop device, which has no SMART data. - Avoid
--privileged: it gives the container access to every device.
Other commands
Everything in the terminal reference works the same way, for example:
docker run --rm --device=/dev/sdb:/dev/sdb:r guara devices
docker run --rm --device=/dev/sdb:/dev/sdb:r guara health /dev/sdb