Running 'dd' command at startup?
- by Usman Ajmal
Hi, I have set a script to run at Linux startup. The script contains a following line of code
dd if=/dev/sda2 of=/dev/sda5 ?> result.txt
Now, when my Linux Desktop appear, result.txt contain
dd: opening '/dev/sda2': Permission denied
If I prefix the dd command with sudo as:
sudo dd if=/dev/sda2 of=/dev/sda5 ?> result.txt
the result.txt contains
sudo: no tty present and no askpass program specified
Is there a way I can get around this problem? What I want is to copy 2nd parititon to 5th when a user logs in no matter if he is root, admin, Desktop or an unprivileged user.
Thanks a lot as always.