Create a symbolic link (or other NTFS reparse point) in Windows Driver |
There isn't direct API to create reparse points.
You need to use ZwFsControlFileZwFsControlFile() to send
FSCTL_SET_REPARSE_POINT ioctl with appropriate input buffers and
parameters.
Don't have example though!
|
Android app installer displays wrong information about required disk space |
I'm not sure if this will work:
Try restarting your device and then install the app.
i was encountering the same problem which got solved by doing the above.
|
.NET Windows Services (WTSSendMessage) : Displays message on XP but not Windows 7 |
I believe that this maybe part of Windows Messenger that is not present in
Windows 7.
This link shows why (RPC disabled by default)
and possible solution:
By default remote RPC is disabled on Windows 7. It can be enabled by
setting the 'HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal
Server' value 'AllowRemoteRPC' to 1. However, this will only get you
another error - 0x721 - which I am guessing is caused by Windows 7 not
allowing 'nul' user access. There are several possible ways around this
problem but I haven't tried any of them. One approach would be to add
credentials from remote machines to the credential cache on the sending
machine but I don't know how practical that is. There may be a way to allow
'nul' user access but that is probably not a good idea either.
And t
|
How do I open the root.disk in linux? |
You need to mount this image before you can access it, try the following:
mkdir olddisk
sudo mount -o loop /path/to/root.disk olddisk
You should now be able to access the data inside this container.
|
How to get the number of connected displays to a gpu on Linux? |
The most analogous approach under Linux would be to use the NVCtrl API
which is what nvidia-settings, the linux NVIDIA control panel application,
provides.
How to download the nvidia-settings source package is documented in the
linux driver release notes. Specifically, you can find various packages
for specific driver versions here
Choose a package that is closest to your driver version.
Once you have downloaded and unzipped the nvidia-settings source, you will
find a samples directory. In that directory is a sample program which has
the necessary framework for what you want. Specifically, look in
nv-control-targets.c. The following function in that file will do what you
want:
/* Connected Display Devices on GPU */
ret = XNVCTRLQueryTargetAttribute(dpy,
|
Best Ways to reduce Disk IO On Linux Server |
Your servers shouldn't crash due to disk IO. They stop, but don't crash,
everything gets real slow, but crash?? Seems extreme.
What time do they crash at? 8am?
What happens if you reboot them?
Did you say webapp?
hmmm..
Dru
You could reduce IO by using smaller drives, hehe
I've got some, definitely reduced IO!!
|
Determine linux driver that owns a disk |
You can see the kernel log
dmesg | grep sda
<...>
[ 0.618438] sd 2:0:0:0: [sda] Attached SCSI disk
<...>
The log is talking about a scsi disk, and sd 2:0:0:0 is the device that
generated that message. You can inspect the sysfs for more details:
cd /sys/block/
cd /sys/block/sda/
Here you can find the information about all your block devices. If you look
into the directory of your specific device you should see its information.
Here the information about the scsi bus. There are two directories: drivers
and devices.
cd /sys/bus/scsi
cd /sys/bus/scsi/devices
cd /sys/bus/scsi/drivers
Here there is the list of drivers on the scsi bus.
ls /sys/bus/scsi/drivers
sd sr
The log said sd 2:0:0:0
cd /sys/bus/scsi/drivers/sd/2:0:0:0
Here my device, so sd is my driver.
Th
|
Python: check if two Linux paths are on same physical disk |
Look at the hex output. The first number after the 0x prefix indicates the
device driver:
>>> hex(os.stat("/usr").st_dev)
'0x801L'
This is a 'SCSI' disk, because all of them have ID 8. Reference:
https://www.kernel.org/doc/Documentation/devices.txt. Drive ID and
partition number are encoded in the remaining part of the st_dev.
The exact transformation for major ID and minor ID as implemented by glibc
is as follows:
>>> minor = int(os.stat("/lib").st_dev & 0xff)
>>> major = int(os.stat("/lib").st_dev >> 8 & 0xff)
>>> major, minor
(8, 1)
Meaning major number 8 (SCSI host adapter), minor number 1. The minor
number encodes drive number as well as partition. As can also be inferred
from here, all partitions on the first disk have a minor
|
Does writing data to stdout in linux occupy disk space? |
Unless the output is being redirected (though pipes to e.g. tee, or to a
file with the > shell redirection operator), then no, output will not go
to a file system. Output to a console (or terminal emulator) is slow as it
is, passing it through the file system would make it even slower, and may
not allow the disks to spin down if there's a lot of output.
It may, however, end up in the swap space, if the OS thinks the process
should be swapped out before the output is actually written.
|
How to force a Linux C Executable to access the disk for fetching data |
You can flush the memory cache by doing this (as root):
sync
echo 3 > /proc/sys/vm/drop_caches
The various values drop_caches accepts are:
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
You'll need 3 to drop everything.
|
Is there a way to tell in linux if a binary program that is running matches file on the disk? |
I am not sure what do you mean exactly.
use pid matching (compare ps output and getpid() in the server)
use /proc/$pid/environ and find _=path_to_someServer (there is the binary)
use diff /proc/$pid/exe someServer ("type someServer" to get full path)
|
Write C++ on Windows but use Linux System calls through a Linux emulator |
You've already tagged your question with Cygwin. That seems like the best
solution for what you want. Cygwin is basically a collection of programs
which emulate a GNU/LInux environment through the use of a
DLL (cygwin1.dll) which acts as a Linux API layer providing
substantial Linux API functionality.
Here's the link to the documentation for its API
Edit: Most of the Cygwin source code that I've looked at is written in C++
and makes system calls using MS Windows API to do provide the *nix
emulation. The source is well written and very readable (even to to a
non-C++ programmer such as myself). I think using Cygwin would be a good
transition from programming on Windows to a GNU/Linux environment.
|
How to get Windows key from disk that cannot boot? |
Just for anyone having the same problem, I found this program
http://www.nirsoft.net/utils/product_cd_key_viewer.html , that can find the
keys also for external drives, choosing as source the
WindowsSystem32configSOFTWARE file.
|
moving rows up and down on ext grid using ext4 |
It might be a lot easier to add an extra field to the store/model that
ranks the records. This way you only have to change the rank-number and
then filter the store. This should keep your selection intact. If you don't
want this rank-field to be synced to the proxy, set the "persist" property
false on the field. That's anyway better than using private parameters on
the remove method.
|
how to retrieve the disk signature of all the disks in Windows using Delphi 7? |
Depends what a "disk signature" is. i don't know what that is. i do know
the following code returns:
-
\?ide#disksandisk_sdssdx120gg25___________________r201____#5&20f0fb49&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
-
\?ide#diskst1000dm003-9yn162______________________hp13____#5&33aaabee&0&1.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
Are those "disk signatures"?
It uses the Windows Setup API:
procedure GetDisks(slDisks: TStrings);
var
InterfaceDevInfo: HDEVINFO;
index: DWORD;
status: BOOL;
Name: string;
begin
{ Get the interface device information set that contains all devices of
event class. }
InterfaceDevInfo := SetupDiGetClassDevs(
@GUID_DEVINTERFACE_DISK,
nil, // Enumerator
|
How to get the total size of hard disk of Windows machine? |
Look at GetDiskFreeSpaceEx(), which has an lpTotalNumberOfBytes output
parameter. It is subject to per-user disk quotas, though. If you need the
raw byte size of the physical disk, use CreateFile() to open a handle to
the desired disk and then use DeviceIoControl(), specifying the
IOCTL_DISK_GET_LENGTH_INFO control code, to get the disk's total byte size.
|
Store common queries on disk with Mysql and windows |
Why not consider something like Redis for caching?
It's an in memory data store and it's very popular right now. Sites using
Redis:
http://blog.togo.io/redisphere/redis-roundup-what-companies-use-redis
Redis also can persist data to disk: http://redis.io/topics/persistence
For caching though, saving to disk shouldn't be absolutely critical. The
idea is that if some data is not cached, the worst case is not always
loading from disk manually, but going straight through to your database.
|
How to get raw disk access in Java with write permissions - Windows 7 |
Your problem is that new RandomAccessFile(drivepath, "rw") uses flags which
are not compatible to raw devices. For writing to such a device, you need
Java 7 and its new nio classes:
String pathname;
// Full drive:
// pathname = "\\.\PhysicalDrive0";
// A partition (also works if windows doesn't recognize it):
pathname = "\\.\GLOBALROOT\ArcName\multi(0)disk(0)rdisk(0)partition(5)";
Path diskRoot = ( new File( pathname ) ).toPath();
FileChannel fc = FileChannel.open( diskRoot, StandardOpenOption.READ,
StandardOpenOption.WRITE );
ByteBuffer bb = ByteBuffer.allocate( 4096 );
fc.position( 4096 );
fc.read( bb );
fc.position( 4096 );
fc.write( bb );
fc.close();
(answer taken from another (similar) question)
|
ComboBox displays repeated Items in Windows 8 Surface |
Combo box uses CarouselPanel as ItemsPanel, you need to change to
StackPanel, then your problem will be solved.
Here's detailed blog regarding that. I hope it might help you.
Windows 8′s combobox and the carouselpanel
winRT ComoBox: suggestions to replace it with standard dropdown behavior?
|
windows azure virtual machine hard disk backups |
Azure attached disks, just like the OS disk, is stored as a vhd, inside a
blob in Azure Storage. This is durable storage: triple-replicated within
the data center, and optionally geo-replicated to a neighboring data
center.
That said: If you delete something, it's instantly deleted. No going back.
So... then the question is, how to deal with backups from an app-level
perspective. To that end:
You can make snapshots of the blob storing the vhd. A snapshot is basically
a linked list of all the pages in use. In the event you make changes, then
you start incurring additional storage, as additional page blobs are
allocated. The neat thing is: you can take a snapshot, then in the future,
copy the snapshot to its own vhd. Basically it's like rolling backups with
little space used, in the event
|
How to format disk with setting allocation unit size to 64K on Windows XP using CMD |
Your allocation size parameter is wrong. For 64K units, you should use
/a:64K.
/a:<UnitSize>
Specifies the allocation unit size to use on FAT, FAT32, or NTFS volumes.
If you do not specify UnitSize, it is chosen based on volume size. Default
settings are strongly recommended for general use. The following list
presents valid values for NTFS, FAT, and FAT32 UnitSize:
512
1024
2048
4096
8192
16K
32K
64K
FAT and FAT32 also support 128K and 256K for a sector size greater than 512
bytes.
Therefore, your batch file should use
start /wait cmd /q /c format f:StorageGroup3 /fs:ntfs /v:SG3Logs /a:64K /q
/y
See the MSDN documentation for format for more information, or type help
format from a command prompt.
|
how to find, using Delphi 7, that a (physical) disk with a specific number (0 .. n) exists in Windows? |
Use CreateFile() to open "\.PhysicalDriveX" as the filename, where X is the
desired number, and see if it succeeds or fails. Even if it fails, you can
still check if the error is due to the device not being present versus not
being accessible (which implies that it exists).
|
No permission to write to disk on Windows Server 2008 from .NET application with log4net |
You should put a folder name in the:
<file value="MyServiceLog.txt" />
Change it to:
<file value="c:dirIownMyServiceLog.txt" />
than make sure you give access to the user on c:dirIown
|
json data for Ext4 store which requires a root element using SPRING MVC |
Wrap the list in an object:
@ResponseBody Users
where
class Users {
public List<User> items;
}
And yes, brackets [] are used for JSON arrays.
|
How to detect the disk full error and let program resume after getting free disk space |
Check the return value of each call to fprintf() and fwrite(). If either
call returns a negative value, check errno to see if errno is equal to
ENOMEM or EDQUOTA. If so, you're probably out of disk space.
As for resuming the operation as if nothing ever happened; that's a little
bit harder; you'll need to keep track of what data you successfully wrote
to the disk, so that after you've notified the user and they've indicated
that it's time to try again, you can resume writing that data from the
point at which the error occurred. That means keeping the state of the
write in a structure of some sort (i.e. not just on the stack) so that you
can return from your writing-function and then resume it later on. (Either
that, or do the writing in a separate thread, and have the thread notify th
|
Mongodb exists after claiming that there is no disk space while disk was not full |
This is a bug in MongoDB. As of today it remains unresolved.
The best advice I can give you is to ensure you have plenty of available
disk space at all times.
|
How to get to last NTFS MFT record? |
The MFT location isn't always fixed on the volume. You should get the
starting MFT offset from the boot sector (sector 0 of the volume, you can
find the structure online).
The first file in the MFT is the "$MFT" file which is the file record for
the entire MFT itself. You can parse the attributes of this file like any
other file and get it's data run list. When you know the size of each
fragment in clusters, parse the last cluster for each 1024 byte record of
the last fragment (although I believe a fragmented MFT is rare). The last
record in the MFT is the last record in that particular cluster marked
"FILE0", if you encounter a null magic number that would be 1024 bytes too
far.
Or you can just get the file size from it's attributes and calculate the
offset to the end of the MFT based o
|
NTFS vs. File Share |
Short answer: No.
In Windows each file and directory has an ACL controlling access to it.
Each file share also has an ACL controlling access to the share.
When you access a remote file through a share you are doing so using the
credentials used to login to the local computer. (You can connect using
different credentials by entering a username/password when connecting).
The remote computer tests the supplied credentials against the ACL on the
share.
Once you are past that, then every file you attempt to access on the remote
machine through this connection will be checked using your credentials
against the ACL on the file and the share. This allows a file share to
offer more restricted access to some files than if the same user were
attempt to access them locally. (So you could share file
|
AIX 7.1 failed disk, need to figure out what physical disk this is? |
Use diag.
$ diag
<enter>
Task Selection
Hot Plug Task
SCSI Hot Swap Manager
Identify a Device Attached to a SCSI Hot Swap Enclosure Device
It should blink the LED of the device you requested.
|
What is the difference between HDFS and NTFS and FAT32? |
... Because NTFS and FAT aren't Distributed. The advantage of HDFS is that
it is.
See the HDFS Introduction.
|
NTFS - file record size |
It's not actually that much of a waste. You should try to look at what
happens when the number of attributes stored in the file record exceeds 1
KB. (by adding additional file names, streams, etc.) It is not clear (to me
at least) for different versions of NTFS if the additional attributes are
stored in the data section of the volume or in another File Record.
In previous versions of NTFS the size of a MFT File Record was equal to the
size of a cluster (generally 4KB) which was a waste of space since
sometimes all the attributes would take less than 1 KB of space. Since NT
5.0 (I may be wrong), after some research, Microsoft decided that all MFT
File Records should be 1KB. So, one reason for storing that number may be
backwards compatibility. Imagine you found an old hard drive which stil
|
NTFS Journal USN_REASON_HARD_LINK_CHANGE event |
As always with the USN, I expect you'll need to go through a bit of trial
and error to get it to work right. These observations/guesses may, I hope,
be helpful:
When the last hard link to a file is deleted, the file is deleted; so if
the last hard link has been removed you should see USN_REASON_FILE_DELETE
instead of USN_REASON_HARD_LINK_CHANGE. I believe that each reference
number refers to a file (or directory, but NTFS doesn't support multiple
hard links to directories AFAIK) rather than to a hard link. So
immediately after the event is recorded, at least, the file reference
number should still be valid, and point to another name for the file.
If the file still exists, you can look it up by reference number and use
FindFirstFileNameW and friends to find the current links. Comparin
|
Viewing Ciphertext of Encrypted File on NTFS (EFS) |
The way you open an encrypted file in order to read its raw encrypted
contents (e.g. for a backup/restore application) is to use the:
OpenEncryptedFileRaw,
ReadEncryptedFileRaw,
WriteEncryptedFileRaw, and
CloseEncryptedFileRaw
api functions.
Writing the code on the fly, in a hypothetical hybrid language:
void ExportEncryptedFileToStream(String filename, Stream targetStream)
{
Pointer context;
res = OpenEncryptedFileRaw("C:UsersIanwallet.dat", 0, ref context);
if (res <> ERROR_SUCCESS)
RaiseWin32Error(res);
try
{
res = ReadEncryptedFileRaw(exportCallback, null, context);
if (res != ERROR_SUCCESS)
RaiseWin32Error(res);
}
finally
{
CloseEncryptedFileRaw(context)
}
}
function ExportCallback(pbData: PBYTE, pvCallbackCo
|
ListBox displays "System.Windows.Forms.ListBox.Items.Count..." |
To write the items, change the line that does the write to:
rollLog.WriteLine(lstBoxOut.items[count]);
To read it back in:
private void btnReadFile(object sender, EventArgs e)
{
lstBoxOut.Items.Clear();
foreach (string line in File.ReadLines("Roll Results.txt"))
{
lstBoxOut.Items.Add(line);
}
}
The reason you're getting that output "System.Windows.Forms.ListBox...." is
because the statement rollLog.WriteLine(lstBoxOut) is equivalent to
rollLog.WriteLine(lstBoxOut.ToString()). The ToString() method returns
A string that states the control type, the count of items in the ListBox
control, and the Text property of the first item in the ListBox, if the
count is not 0.
|
NTFS sparse file data runs ($UsnJrnl) |
No, it means that $UsnJrnl occupies 2576 clusters on disk. Sparse clusters
don't occupy any space on disk, if you'd try to read sparse cluster, e.g.
cluster 10 in your example, NTFS just returns zeros.
Generally, you can't determine start and end cluster of the file, since
files can be fragmented - your example says that first 1408 clusters are
not allocated on disk at all, then 128 clusters of that file occupy disk
clusters 510119 - 510247, then 2448 clusters of the file occupy disk
clusters 256 - 2704; so in this case you can't say that file begins by
cluster X (on disk) and ends by cluster Y (on disk) - it's possible only if
file is not fragmented (when it uses only one cluster run).
|
How does NTFS handle the conflict of short file names? |
NTFS won't create two short names like that. The first will be THISIS~1.txt
and the second will be THISIS~2.txt. For example, open a command prompt and
from the root of C: drive type
C:>dir prog* /x /ad<Enter>
On a Windows 7 64-bit system you will see output similar to this
03/28/2013 12:24 PM <DIR> PROGRA~1 Program Files
07/31/2013 11:09 AM <DIR> PROGRA~2 Program Files
(x86)
12/10/2012 05:30 PM <DIR> PROGRA~3 ProgramData
|
access to ntfs stream for a very long filename fails |
As the very helpful page on CreateFile says referring to the lpFileName
parameter which specifies the filename:
In the ANSI version of this function, the name is limited to MAX_PATH
characters. To extend this limit to 32,767 wide characters, call the
Unicode version of the function and prepend "?" to the path.
Since you are contemplating BackupRead obviously you are wanting to access
this stream programatically. If so, test things programatically. Trying all
these operations from the command prompt is a crap-shoot and will not
establish anything more than the ability to perform such operations from
the command prompt.
With that in mind, let's try this simple program - boilerplate code
removed:
#include "stdafx.h"
int APIENTRY _tWinMain(HINSTANCE,
HINSTAN
|
Cloning an OS disk onto a smaller disk |
Acronis Clone Disk worked for me with some options settings, set the move
method to Manual and then we get the option to "Change Disk Layout" and
control how the unused space from the bigger disk will be shrunk when
moving to smaller disk.. The destination disk is fine and bootable now!
|
How to make Gradle stop trying to chmod MANIFEST.MF on an NTFS drive |
Gradle is trying to set default permissions for that file, and I can't see
a way to stop it from doing that. (You could make it set different
permissions, but I guess that won't help.) Under Windows/NTFS this normally
works just fine, so it might be a problem with you Linux NTFS driver or
configuration.
|
How to get windows size from Linux |
The issue has nothing to do with PuTTY per se, and everything to do with
SSH clients and pseudoterminals in general.
To avoid this issue, configure your PuTTY to use a pseudoterminal. (In the
TTY panel, there is a "Don't allocate a pseudoterminal" checkbox. Make sure
it is not checked.)
With ssh, you need to use the -t option to tell ssh to use a
pseudoterminal.
Here is a simple example program you can use in Linux to obtain the
terminal size. It does not require curses:
#include <unistd.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <stdio.h>
static int get_size(const int fd, int *const rows, int *const cols)
{
struct winsize sz;
int result;
do {
result = ioctl(fd, TIOCGWINSZ, &sz);
} while (result == -1 &&
|