hard-drive

Python causing: IOError: [Errno 28] No space left on device: '../results/32766.html' on disk with lots of space

陌路散爱 提交于 2019-12-17 09:38:45
问题 I am running a Python script that is causing the above error. The unusual thing is this script is running on a different machine and is having no problems. The difference is that on the machine that is causing the problems I am writing to an external hard drive. To make things even weirder this script has run on the problem machine and already written over 30,000 files. Some relevant information (The code that is causing the error): nPage = 0 while nPage != -1: for d in data: if len(d

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

How to Read particular sector of a disk using ATA command?

好久不见. 提交于 2019-12-13 19:19:37
问题 I want to read a particular sector(MBR Sector) of a disk using ATA commands in vc++. I am new to VC++ so i am facing a problem when sending command to disk using DeviceIoControl . I am providing a code that i am using to read out a sector using command Read Sector(s)(0x20). BOOL status = FALSE; PATA_PASS_THROUGH_EX pATAData; DWORD dataSize = sizeof(ATA_PASS_THROUGH_EX) + 512; BYTE Buffer[sizeof(ATA_PASS_THROUGH_EX) + 512]; DWORD bytescopied = 0; pATAData = (ATA_PASS_THROUGH_EX*)Buffer;

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

Serial Number of Bootable device [closed]

ε祈祈猫儿з 提交于 2019-12-13 09:36:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . I have to get the serialnumber of the disk on which my operating system is installed. I know in order to get serial number i need to run: >wmic diskdrive get serialnumber,capabilities Capabilities SerialNumber {3, 4} AI92NXXXXXXXX2G02 {3, 4, 7} 1172XXXXXX030 There are no attributes to check if the OS is

How to avoid programs in status D

守給你的承諾、 提交于 2019-12-13 07:00:33
问题 I wrote a program that are reading/writing data (open one infile and one outfile, read part of infile, then process, then write to outfile, and that cycle repeats), with I/O value about 200M/s in total. However, most of the running time, they are in status D, which means waiting for I/O (As shown in the figure)1. I used dd check write speed in my system, that is about 1.8G/s. Are my programs inefficient? Or my harddisk have problems? How can I deal with it? 回答1: If using ifort, you must

Low level disk operations in Linux for C++

送分小仙女□ 提交于 2019-12-12 08:27:54
问题 What kind of methods exists in linux for low level disk operations in C++? I am attempting to write my own manager of data on a disk. For example, I would like to create a C++ program in the Linux environment that allocated a certain amount (continuous) on a disk and then freely allows me to read/write to that chunk of data. I don't think I want to use the standard fstream::open because then the file is managed by the OS and I might not get a continuous section on the disk. Thanks. 回答1:

What are the different possibilities to store a large number of files in a SQL Server 2008 Database?

蓝咒 提交于 2019-12-12 06:26:34
问题 Let's say i want to build a website that will hold a very large number (at least 10 millions) of small files (around 50KB, mostly PDF , but also word/excel documents, jpg, and text files). Using SQL Server 2008 database, what are the different technical possibilities to store these files (eg: using a table with for filenames + filesystem for data, using varbinary, etc...) ? 回答1: SQL Server 2008 database provider many datatypes to store binary data. FILESTREAM datatype was introduced in SQL

How to get Hard-Disk SerialNumber in C# (no WMI)?

断了今生、忘了曾经 提交于 2019-12-12 05:29:34
问题 I know there are two articles in CodeProject (one uses WMI and the other no WMI but in C++). I tried the WMI way, not only it's slow, but it is also unreliable. So, that's why I decided not to pursue that way. I want to do it in C# through pInvoke. I tried it but got stuck in DeviceIoControl API. Can anybody give me a hint? Here is my code: using System; using System.ComponentModel; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices;

'parted mklabel' raises an error through Python subprocess

被刻印的时光 ゝ 提交于 2019-12-12 03:44:47
问题 I want to format a hard disk via python script using subprocess.Popen. Typing the following command inside a shell worls fine. Just pay attention with this command! parted /dev/sdh mklabel gpt Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? I agree by typing Yes and the disk is well formatted. Rolling it inside Python subprocess, Popen exits with status code 1. I'm even not able to write 'Yes' into the