-
Permission problem running a compiled C++ program
I boot with Knoppix 3.7 and am still learning Linux. I need to clone a hard drive with lots of errors (dd can't handle it). I have obtained the source for GNU ddrescue (not to be confused with dd_rescue, written by Kurt Garloff), written in C++ by Antonio Diaz. http://www.gnu.org/software/ddrescue/ddrescue.html
I had no problems unzipping and untarring the source files, and I was able to './configure' and then 'make' it (in the same directory on my USB flash drive where the source code is stored).
But now I'm having trouble getting ddrescue to run. If I run it from 'Konsole' terminal with this invocation
ddrescue /dev/hdc /dev/hdb testlog
I get the following error: "ddrescue: cannot open input file: permission denied". I think this is because accessing a full drive like hdb or hdc (rather than a partition like hdb1 or hdc2) can only be done from Root.
But when I launch a 'Terminal as Root' window (logging in as root with a password that I set myself) and navigate (cd) to the correct folder with the compiled folder, I am unable to invoke ddrescue...
root@ttyp1[ddrescue-1.0]# ddrescue /dev/hdc /dev/hdb testlog
bash: ddrescue: command not found
What am I doing wrong? Is there another shell that I should be using?
-
Senior Member
registered user
Root probably (and wisely!) does not have the current directory (.) in her PATH. Try ./ddrescue (that's dot-slash)
-
./ worked
THANKS!! Using ./ddrescue worked just fine, although I don't really understand why...
I thought that the . (dot) specifies current directory, so ./ddrescue is telling the system to run ddrescue from a subdirectory of the current directory that I'm in?
-
Senior Member
registered user
Yes, "." does mean the current directory. When you use a command that is not in a directory mentioned in PATH
(type "echo $PATH" to see what's in there), then everything you type up to the last "/" is the path to the executable,
the rest is the name of the executable itself. Try playing with the commands "basename" and "dirname".
HTH
Similar Threads
-
By Rehtwol in forum General Support
Replies: 1
Last Post: 09-22-2006, 04:43 AM
-
By k00ld00d in forum General Support
Replies: 2
Last Post: 05-19-2006, 02:14 AM
-
By kepler in forum General Support
Replies: 2
Last Post: 11-08-2004, 01:30 PM
-
By oahuyahoo in forum General Support
Replies: 4
Last Post: 11-07-2004, 12:22 PM
-
By chook in forum Hdd Install / Debian / Apt
Replies: 1
Last Post: 03-23-2004, 06:57 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

IBM System X3850-X5 Server w/4x Intel Xeon E7-4870 CPU , 512 GB DDR3 RAM,NO HDD
$1299.99

IBM QRadar xx29 2x Xeon E5-2650v4 2x 900W PSU M5120 12x 3.5" Bay Server No RAM
$179.99

IBM ADP Server Type 7870 AC1 NO HDD | 128GB RAM PC3L | 2 x Xeon E5620
$199.99

Unused IBM 09P0037 MAINBOARD For RS/6000 7044-170 P-Series
$375.00

IBM SYSTEM X3500 M3 SERVER 7380AC1 TOWER Server XEON E5620 8GB RAID SEE NOTES
$110.30

Compaq ProLiant 1500R 5/100 rack server, Series 3155, with IBM 2.1GB HD, VINTAGE
$295.00

IBM 4262 SYSTEM x3200 Tower - HDD Wiped, NO OS
$80.00

IBM SYSTEM X3550 M5 5463AC1 2.5x8 Server 2*XEON E5-2640 V3 8GB SEE NOTES
$85.99

Rare Vintage IBM 93ZZ PowerPC Server Board - MCM Ceramic CPU - 40N1844 - 1.1 lbs
$49.99

IBM 7014-T00 Enterprise 19" Rack Enclosure No Keys
$549.95