disk

Programmatically getting per-process disk io statistics on Windows?

戏子无情 提交于 2019-12-17 18:46:10
问题 I would like to display a list of processes (Windows, C++) and how much they are reading and writing from the disk in KB/sec. The Resource Monitor of Windows 7 has the ability so I should be able to do the same. However I have unable to find a relevant API-call or find anything in the perfmon counters. Could anyone point me in the direction? 回答1: You can call GetProcessIoCounters to get overall disk I/O data per process - you'll need to keep track of deltas and converting to time-based rate

How can I simulate a failed disk during testing?

℡╲_俬逩灬. 提交于 2019-12-17 17:42:24
问题 In a Linux VM (Vmware workstation or similar), how can I simulate a failure on a previously working disc? I have a situation happening in production where a disc fails (probably a controller, cable or firmware problem). Obviously this is not predictable or reproducible, I want to test my monitoring to ensure that it alerts correctly. I'd ideally like to be able to simulate a situation where it fails writes but succeeds reads, as well as a complete failure, i.e. the scsi interface reports

Is there any way of detecting if a drive is a SSD?

孤街浪徒 提交于 2019-12-17 07:17:22
问题 I'm getting ready to release a tool that is only effective with regular hard drives, not SSD (solid state drive). In fact, it shouldn't be used with SSD's because it will result in a lot of read/writes with no real effectiveness. Anyone knows of a way of detecting if a given drive is solid-state? 回答1: Detecting SSDs is not as impossible as dseifert makes out. There is already some progress in linux's libata (http://linux.derkeiler.com/Mailing-Lists/Kernel/2009-04/msg03625.html), though it

Size vs Size On Disk

痴心易碎 提交于 2019-12-16 18:03:28
问题 I read about the byte vs cluster theory, but I don't think it can apply in my case; Doesn't seem to have to do with "a bunch of small files"; . ├── [ 11K] 2ndVisit_Checklist.xlsx ├── [ 35K] 2ndVisit FTS_Timetable.xlsx ├── [ 34K] 2ndVisit_Roomlist.pdf ├── [ 27K] 2ndVisit_Teilnehmer.xlsx ├── [9.5K] Belgian Pupils for European Parliament.xlsx ├── [4.0K] Brussel EU │ ├── [ 64K] Checkliste.doc │ ├── [144K] Plan A73.doc │ ├── [ 38K] TN Liste EP.docx │ └── [108K] TN Liste EP V02.doc ├── [ 12K]

Assembly INT 13h - read disk problem

只谈情不闲聊 提交于 2019-12-14 03:57:21
问题 I need to be able to write a program in assembly to read the first sector of a disk (The MBR) and write it to a floppy disk or at least show the data. I understand that INT 13h and 25h do not work in the windows protected mode and i even tried my code in Dos but the dos system hangs when I run the program. This is the code: MOV byte ptr es:[bx], offset result MOV AL,1 ;number ofsectors to read MOV Cl,1 MOV ch,0 mov dl,80h ;the HDD mov dh,1 mov ah,02h INT 13h result is the buffer variable.

See disk management info with c#

爱⌒轻易说出口 提交于 2019-12-13 14:23:49
问题 When I open Disk Management (right click My Computer->Manage) I see: How can I know that path F:\ belongs to Disk5? In other words I will like to know what disks are available with C#. The reason why I need to know that is because I have a usb mas storage device that is encrypted and I need to pass the parameter \Device\Harddisk5 to TrueCrypt along with the password in order to mount the encrypted device with code. Edit I know how to look the drives info. I just dont konw how to know that

Getting Disk Size Properly

落花浮王杯 提交于 2019-12-13 14:07:28
问题 I am trying to get the physical device size of a connected USB flash drive. I have tried using WMI. ManagementObjectSearcher mosDisks = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive WHERE Model = '" + cmbHdd.SelectedItem + "'"); foreach (ManagementObject moDisk in mosDisks.Get()) { lblCapacity.Text = "Capacity: " + moDisk["Size"]; } I have tried using imports to get the geometry: var geo = new DiskGeometry(); uint returnedBytes; DeviceIoControl(Handle, 0x70000, IntPtr.Zero, 0,

Error on a disk space usage script

我的梦境 提交于 2019-12-13 08:40:53
问题 I tried to modify a little script of checking disk space usage, and I faced the below error: disk_space.sh: line 32: [: Use: integer expression expected # Set alert limit, 90% we remove % for comparison alert=90 # $1 is the partition name # $5 is the used percentage # Print the df -h, then loop and read the result df -h | awk '{ print $1 " " $5 }' | while read output; do #echo $output # Get partition name partition=$(echo $output | awk '{ print $1 }') #echo 'Partition: ' $partition # Used

How can I achieve parallelism in a program that is writing to the disk in C++?

巧了我就是萌 提交于 2019-12-13 07:17:00
问题 I have a buffer in main memory that contains a couple of files that I want to write in parallel(if possible?) to the disk. I read and write to different location every time. This is my code: #include <thread> void t1(){//read from the buffer and writes the 1st file to the disk } void t2(){//same with the second one } void t3(){//3rd} void t4(){//4th} int main(){ std::thread thread1(t1); std::thread thread2(t2); std::thread thread3(t3); std::thread thread4(t4); t1.join(); t2.join(); t3.join();

How to make a Disk auto-run both in Windows and MAC OS X

谁说胖子不能爱 提交于 2019-12-13 04:21:57
问题 I have develop two tiny utility applications for both Windows and MAC OS X. I know how to make this disk auto-run by Window. But for MAC OS X, I've no idea how to. Any one know about how to achieve this? Can I make ONE disk auto-run by both Windows and MAC OS X? And of cause, different OS should run different apps designed for themselves. For example, Window may run "util_Win.exe", while MAC OS X "util_MAC.app". 回答1: You can customize the background of a window by opening the window and