disk

Calculate Total disk i/o by a single process

ぐ巨炮叔叔 提交于 2019-12-04 23:50:56
问题 I am looking for some tool that will dump total disk I/O by a single process after it ends. So far my finding is :- iotop = It shows i/o per process in real time but does not give total after process end. iostat = It shows real time I/O but does not tell process For example , I have some process running in background with PID ####. I need the Total Bytes Written and Read by that process in total after the process ends.Can anybody tell how I can extract this information given a process PID.

Storing entire process state on disk and restoring it later? (On Linux/Unix)

梦想与她 提交于 2019-12-04 16:26:22
问题 I would like to know: Is there a system call, library, kernel module or command line tool I can use to store the complete state of a running program on the disk? That is: I would like to completely dump the memory, page layout, stack, registers, threads and file descriptors a process is currently using to a file on the hard drive and be able to restore it later seamlessly, just like an emulator "savestate" or a Virtual Machine "snapshot". I would also like, if possible, to have multiple

Google Compute Engine VM instance: VFS: Unable to mount root fs on unknown-block

允我心安 提交于 2019-12-04 14:23:48
My instance on Google Compute Engine is not booting up due to having some boot order issues. So, I have created a another instance and re-configured my machine. My questions: How can I handle these issues when I host some websites? How can I recover my data from old disk? logs [ 0.348577] Key type trusted registered [ 0.349232] Key type encrypted registered [ 0.349769] AppArmor: AppArmor sha1 policy hashing enabled [ 0.350351] ima: No TPM chip found, activating TPM-bypass! [ 0.351070] evm: HMAC attrs: 0x1 [ 0.351549] Magic number: 11:333:138 [ 0.352077] block ram3: hash matches [ 0.352550] rtc

How does one map physical sectors of a disk to the files that contain them on an HFS+ volume on Mac OS X

泄露秘密 提交于 2019-12-04 13:01:37
I've been recovering a hard disk using dd_rescue , which provides me a list of all of the device sectors it could not copy due to hardware errors. I'd like to take that list, and write a tool to give me all of the files that contain these bad sectors so I can delete them. I'm not sure what APIs I can use to do this--essentially i want to get a list of all files on disk and for each file, a list of the ranges of sectors it occupies on disk. My first guess is that I will iterate over each directory entry on the disk and check to see if the file overlaps one of these bad sectors. Maybe there's a

Disk cylinder service requests algorithms

☆樱花仙子☆ 提交于 2019-12-04 12:01:16
Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130 Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests, for each of the following disk-scheduling algorithms --> C-SCAN and C-LOOK I have made some notes on what I think the order in each case would be and the resulting distance. a. Starts at

Disk seek time measurement method

两盒软妹~` 提交于 2019-12-04 11:18:33
I write a script to measure seek times on a HDD and a small change in how its done results in dramatically different times. First cycle makes jumps within an area at beginning of the disk. Second cycle selects random areas (of same size) on disk where seeks are performed. This approach is clearly different but I dont understand why it would change results? Notice that for large areas measurements converge for both methods. Bytes* methods just format numbers nicely (1024 <-> "1KB"). Script must be run under root. Disk is sdb, by default. import sys, os, time, random #---------------------------

Bash monitor disk usage

流过昼夜 提交于 2019-12-04 04:58:34
I bought a NAS box which has a cut down version of debian on it. It ran out of space the other day and I did not realise. I am basically wanting to write a bash script that will alert me whenever the disk gets over 90% full. Is anyone aware of a script that will do this or give me some advice on writing one? #!/bin/bash source /etc/profile # Device to check devname="/dev/sdb1" let p=`df -k $devname | grep -v ^File | awk '{printf ("%i",$3*100 / $2); }'` if [ $p -ge 90 ] then df -h $devname | mail -s "Low on space" my@email.com fi Crontab this to run however often you want an alert EDIT: For

Unmounting Drive/volume without ejecting

与世无争的帅哥 提交于 2019-12-03 20:54:37
I am want to unmount a disk WITHOUT EJECTING. To do that I tried following code { NSString *path; CFStringRef *volumeName=(__bridge CFStringRef)path; DASessionRef session = DASessionCreate(kCFAllocatorDefault); CFURLRef pathRef = CFURLCreateWithString(NULL, CFSTR("/volumes/Untitled"), NULL); DADiskRef disk = DADiskCreateFromVolumePath(kCFAllocatorDefault, session, pathRef); DADiskUnmount(disk, kDADiskUnmountOptionForce, NULL, NULL); } This code is from this question, Thanks to @zeFree Its working but I want dynamic path to the volume where as in the code its static. I tried changing NSString

Windows C/C++ Drive Init/Partition/Format

时间秒杀一切 提交于 2019-12-03 20:46:25
I am trying to build an application for Windows XP 64bit which is able to detect drives of a particular model in the system, and if they are not initialized & formatted perform these processes. I would also like to be able to query and set the partition information(including the volume label). I have started putting together code using DeviceIoControl, but I have not been able to figure out how to set/get partition/volume labels or format drives with the method, I have got SMART access working. Is there any other method that is any easier to use? Zac Sounds like you are looking for Disk

Can I use WMI to find the network usage by each process?

大城市里の小女人 提交于 2019-12-03 15:25:15
I'd like to use WMI on some windows systems to poll the network usage of each process. From what I can tell, there are many IO instances in the Win32_PerfRawData_PerfProc_Process but they are for the combined IO of network,disk,and device. Is there a way to break that up so I can get network and disk IO separate? 来源: https://stackoverflow.com/questions/376541/can-i-use-wmi-to-find-the-network-usage-by-each-process