kandi X-RAY | hdparm Summary
kandi X-RAY | hdparm Summary
hdparm
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of hdparm
hdparm Key Features
hdparm Examples and Code Snippets
Community Discussions
Trending Discussions on hdparm
QUESTION
My program frequently polls disks for changes but i don't want them to wake them up nor wait 10sec until they are accessible.
I know that on the command shell i can use hdparm -C /dev/sda
to find out if a drive is in active/idle or standby mode. But hdparm does need root rights and is not installed by default so i can't use it in my program.
How can i do the same with a C function?
...ANSWER
Answered 2021-Feb-01 at 15:05hdparm uses a SCSI ioctl on /dev/sda
to obtain the power mode. This usually requires root because regular users won't have read/write permissions on block devices.
If you have udisks2 installed and running you can get around this by invoking a dbus method on the system bus:
- Service: org.freedesktop.UDisks2
- Object Path: /org/freedesktop/UDisks2/drives/
- Method: org.freedesktop.UDisks2.Drive.Ata.PmGetState
udisks2 runs as root to obtain the necessary power state (standby/active/idle), but any application with access to the system bus can query udisks2.
QUESTION
In the following code, I write messages to a file using bufio in golang. My disk I/O speed is about 1000M/s. Strangely, when the size of the written file is less than 20G, the writing speed is about 800M~900M per second, a little bit less than the I/O speed. But, when the file size is more than 21G, I found the writing speed is about 200M per second, much less than the I/O speed. I don't know why, anybody can help me? Thank you.
...ANSWER
Answered 2017-Dec-19 at 14:41Your issue is not reproducible. Your code has bugs.
We would expect that disk write time would be affected by a number of factors: the program, other programs, the operating system, hardware, and so on.
Boot a standalone, dedicated machine, and run the diskio.go
program. What results do you get? For example, on my machine:
QUESTION
I'm compiling a test program on clion using windows subsystem for linux WSL
. I am using dlopen
etc. to load a library at runtime. The error I am getting is:
ANSWER
Answered 2020-Feb-26 at 03:28I think you are confusing the GNU link library flag -l
with the library name dl
, which together in the link stage appear as -ldl
. If the library is in the system path (of WSL), you should not need the full path to the library either. You can simply put the library name dl
in this command:
QUESTION
I would like to partially colorize the output of any given bash command in my scripts, just to make it pretty and easy to catch important information displayed on the screen.
It's rather easy to echo
colored results, but I failed with commands displaying some system measurements.
Let's use hdparm
as an example.
ANSWER
Answered 2019-Sep-23 at 06:33You can redirect command output into array, and then echo array items in colors you want. For example:
QUESTION
Ok I am trying to find a way I can run
...ANSWER
Answered 2018-Sep-12 at 20:42If that's the only problem you have:
QUESTION
If you run hdparm -I /dev/X
where X
is your SSD device, it would print info (read-only operation) something similar to this
ANSWER
Answered 2018-May-17 at 11:35One possible reason may be that what you see on screen is not the result of awk, but of stderr. Here's what you can do to diagnose it :
- Forego the for loop for now and test with one device, say sda.
- Redirect the output to a file, e.g. $ sudo hdparm -I /dev/sda > /tmp/tempfile
- See if you still see the lines with 'frozen' no screen.
QUESTION
I'm running MPD on a Raspberry Pi connected to an USB HDD Dock over USB. The HDD Is formatted in BTRFS and I mount a subvolume (-o subvol=Music,autodefrag,space_cache,compress,relatime). Unfortunately i can't control the HDD's spin downs. The HDD spins down and goes to stand by after approx. 30 secs.
I've already tried HDPARM with:
hdparm -B 254 -S 0 /dev/sda
And HD-IDLE with:
hd-idle -i 0 -a sda -i 1200
with no effect.
As a dirty trick i moved the mpd's log file to the external HDD and revved up MPD's log verbosity (but this is not reliable). Currently i'm running an infinite loop to keep the drive alive.
I need some advice how to regulate this issue.
...ANSWER
Answered 2017-Apr-15 at 18:38This is the current fix:
QUESTION
I have a USB drive that my Ubuntu machine can't format. I think the problem originated when I was using Rufus or UNetBootin inside a Windows VM and got a blue screen. There's no important data on there, I just want to be able to use it. It's probably not worth the trouble but I want to understand the problem in case it happens again. I tried all sorts of tools but none of them seems to be low-level enough to rewrite the partition table.
Here is the output of some of the tools I tried. As you can note, there is no sdb1 or any found partition because the table is unreadable. I can use a Windows host too if the only solution is by using some ".exe" but I'd rather use UNIX terminal tools if possible.
...ANSWER
Answered 2017-Mar-26 at 16:47Apparently the Startup Disk Creator on Ubuntu doesn't care what's on the drive at all. I suppose it always creates its own partition table. So I used it with an Ubuntu image, assuming it would fail and was greatly surprised. I then used GParted to have an empty FAT32 partition and now I can use my drive without any problem (except maybe with future formats). Oddly, GParted first thought my drive was 60GB and successfully created a partition table but failed creating a partition. After the error message, the size of the drive rightly showed 16GB so I created the partition successfully.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hdparm
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page