Commands sometimes fail to execute in terminal

Asked by Terry D. Brown on 2008-02-06

When I try to execute "sudo hdparm -Tt /dev/hda" in a terminal window, I get this error message: /dev/hda: No such file or directory. I have had similar problems with other commands. What am I doing wrong? (I am new to Linux. )

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu hdparm Edit question
Assignee:
No assignee Edit question
Solved by:
marcobra (Marco Braida)
Solved:
2008-02-07
Last query:
2008-02-07
Last reply:
2008-02-07

Seems you do nothing wrong... please type:

ls -l /dev/hda

and copy result here.

Thank you

Terry D. Brown (tebrown-2) said : #2

terry@Library:/$ ls -l /dev/hda
ls: /dev/hda: No such file or directory
terry@Library:/$

Above is paste of the last three terminal lines.

So you don't have /dev/hda

Please try

ls -la /dev/hd*

and

ls -la /dev/sd*

Terry D. Brown (tebrown-2) said : #4

terry@Library:/$ ls -la /dev/hd*
ls: /dev/hd*: No such file or directory
terry@Library:/$ ls -la /dev/sd*
brw-rw---- 1 root disk 8, 0 2008-02-06 06:03 /dev/sda
brw-rw---- 1 root disk 8, 1 2008-02-06 06:03 /dev/sda1
brw-rw---- 1 root disk 8, 3 2008-02-06 06:03 /dev/sda3
brw-rw---- 1 root disk 8, 4 2008-02-06 13:03 /dev/sda4
brw-rw---- 1 root disk 8, 5 2008-02-06 06:03 /dev/sda5
brw-rw---- 1 root disk 8, 6 2008-02-06 06:03 /dev/sda6
brw-rw---- 1 root disk 8, 16 2008-02-06 06:03 /dev/sdb
brw-rw---- 1 root disk 8, 17 2008-02-06 06:03 /dev/sdb1
brw-rw---- 1 root disk 8, 18 2008-02-06 06:03 /dev/sdb2
brw-rw---- 1 root disk 8, 19 2008-02-06 06:03 /dev/sdb3
brw-rw---- 1 root disk 8, 21 2008-02-06 06:03 /dev/sdb5
brw-rw---- 1 root disk 8, 22 2008-02-06 06:03 /dev/sdb6
terry@Library:/$

Above is paste of applicable terminal lines.

Ok you have serial ata drive /dev/sd...

There is no reason to use hdparm on serial ata device.... hdparm is designed for ATA/IDE devices

"hdparm provides a command line interface to various hard disk ioctls supported by the stock Linux ATA/IDE device driver subsystem. Some options may work correctly only with the latest kernels. For best results, compile hdparm with the include files from the latest kernel source code."

http://linux.die.net/man/8/hdparm

Hope this helps

Terry D. Brown (tebrown-2) said : #6

terry@Library:/$ hdparm -Tt /dev/sda
/dev/sda: Permission denied
terry@Library:/$ sudo hdparm -Tt /dev/hda
[sudo] password for terry:
/dev/hda: No such file or directory
terry@Library:/$

Above is additional information: the applicable terminal lines when I tried using "sda" instead of "hda." I do not have an SATA hard disk in the computer in question. The two hard disks in this machine are IDE!

Please use:
type mount to view your /dev/sdX hard disk

then
sudo hdparm -Tt /dev/sd...

Terry D. Brown (tebrown-2) said : #8

terry@Library:/$ sudo mount
/dev/sda4 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.22-14-generic/volatile type tmpfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)
/dev/scd1 on /media/cdrom1 type iso9660 (ro,nosuid,nodev,user=terry)
terry@Library:/$ sudo hdparm -Tt /dev/sda

/dev/sda:
 Timing cached reads: 404 MB in 2.01 seconds = 201.14 MB/sec
 Timing buffered disk reads: 170 MB in 3.03 seconds = 56.09 MB/sec
terry@Library:/$

Above are the latest applicable lines from the terminal. Can you explain what you just had me do above?

Terry D. Brown (tebrown-2) said : #9

I see that I mis-typed "sda" as "hda" when I tried "sudo hdparm -Tt /dev/sda" before I received your last suggestion. So your suggestion pertaining to "mount" apparently had nothing to do with the success. I think you have answered my question successfully. Thanks!

Terry D. Brown (tebrown-2) said : #10

Thanks marcobra, that solved my question.