# hdparm - mlock() failed on timing buf: Cannot allocate mem

## brent_weaver

Hello all ... I am trying to have a non-root user run:

```

hdparm -T /dev/sda

```

I have put the Linux user in the disk group, but still get the following error message:

```

hdparm -T /dev/sda

/dev/sda:

mlock() failed on timing buf: Cannot allocate memory

```

Is this an issue with ulimit? How do I resolve this as I need to use it for monitoring.

Thanks in advance.

----------

## silent_Walker

Sounds to me like you may be running out of ram:

 *Quote:*   

>  hdparm -T
> 
> Perform timings of cache reads for benchmark and comparison pur-
> 
>               poses.   For  meaningful  results,  this  operation  should   be
> ...

 

How much free memory do you have when you run that command, are you using SWAP?

Are you also running the latest version of hdparm?

----------

## brent_weaver

I am running hdparm-9.43. I should have mentioned that this works perfectly for root user. This server has like 16GB of ram and nothing running on it. Swap flile is untouched.

----------

## silent_Walker

 *brent_weaver wrote:*   

> I am running hdparm-9.43. I should have mentioned that this works perfectly for root user. 

 

Wikipedia ( I know ) says 

 *Quote:*   

> hdparm has to be run with root privileges, otherwise it will either not be found or the requested actions will not be executed properly.

 

I know that for Debian, you can run it as a non root user.   So it is most likely that the path to hdparm only exists for root users.  You could try modifying the path so that a non root user can run it.

Also this is from Linux Questions

 *Quote:*   

> hdparm is usually in /sbin, which is not part of the path for a normal user. You usually need to be root to use hdparm effectively 

 

----------

