/dd-safe

:shell: A safer and simpler way to use dd written in POSIX sh.

Primary LanguageShellMIT LicenseMIT

dd-safe

🐚 A safer and simpler way to use dd(1).

Written in shellcheck compliant POSIX sh.

OS support

  • 🐧 Linux
  • 😈 FreeBSD
  • 🐉 DragonFly BSD
  • 🐡 OpenBSD
  • 🚩 NetBSD
  • ☀️ Solaris/illumos
  • 🍎 macOS

Unsupported

  • 🍷 Windows via WSL (Windows subsystem for Linux)

I really wanted this to work, but WSL isn't even able to enumerate drives with tools like lsblk and fdisk. Therefore, officially supporting it would be a mistake.

lsblk: failed to access sysfs directory: /sys/dev/block: No such file or directory
fdisk: cannot open /proc/partitions: No such file or directory

How to - Download and run (without installation)

via wget

wget https://raw.githubusercontent.com/Adobe-Android/dd-safe/master/dds
chmod +x dds
./dds

via curl

curl -O https://raw.githubusercontent.com/Adobe-Android/dd-safe/master/dds
chmod +x dds
./dds

via git

git clone https://github.com/Adobe-Android/dd-safe.git
cd dd-safe
chmod +x dds
./dds

⚠️ This program expects to run with sudo, doas, or as root because dd(1) will often require root permissions to access devices.

How to - Download, install, and run

via wget

wget https://raw.githubusercontent.com/Adobe-Android/dd-safe/master/dds
wget https://raw.githubusercontent.com/Adobe-Android/dd-safe/master/Makefile
make install
dds

via curl

curl -O https://raw.githubusercontent.com/Adobe-Android/dd-safe/master/dds
curl -O https://raw.githubusercontent.com/Adobe-Android/dd-safe/master/Makefile
make install
dds

via git

git clone https://github.com/Adobe-Android/dd-safe.git
cd dd-safe
make install
dds

❗ Potential errors:

install: cannot create regular file '/usr/local/bin/dds': Permission denied
make: *** [Makefile:7: install] Error 1

✔️ Solution:

sudo make install

Author

David Brown - Adobe-Android

License

MIT