Posted by jpluimers on 2026/10/04
I thought I posted about this, but I didn’t (below are some related NTFS partition posts that ammend this one): moving an NTFS partition on a disk to make space so you can resize another disk partition.
Simple case: moving a Windows Recovery Partition to the end of a disk
For simple cases when you can afford losing or reconstructing data, or restoring data from back-up, you can use the existing tools DISKPART (TUI) or DiskMgmt (GUI)
For the specific case of the Windows Recovery Partition, this involves running reagentc /disable at the beginning of the process and reagentc /enable at the end.
See:
Complexer case: moving an NTFS data partition while keeping the data
I had this disk layout:
Read the rest of this entry »
Posted in Batch-Files, Development, NTFS, Power User, Scripting, Software Development, Windows | Leave a Comment »
Posted by jpluimers on 2024/09/25
Posted in C, C++, Development, NTFS, Power User, RoboCopy, Software Development, Visual Studio C++, Windows, Windows 10, Windows 11 | Leave a Comment »
Posted by jpluimers on 2021/10/07
TL;DR: Empty files are indeed of size zero, but there is some disk space involved for their meta-data (like name, permission, timestamps)
Some links (via [WayBack] create zero sized file – Google Search):
- [WayBack] Zero-byte file – Wikipedia
- [WayBack] filesystems – How can a file size be zero? – Super User (thanks [WayBack] phuclv):
Filesystems store a lot of information about a file such as file name, file size, creation time, access time, modified time, created user, user and group permissions, fragments, pointer to clusters that store the file, hard/soft links, attributes… Those are called file metadata. Why do you count those metadata into file size when users do not (need to) care about them and don’t know about them? They only really care about the file content
Moreover each filesystem stores different types of metadata which take different amounts of space on disk. For example POSIX permissions are very different from NTFS permission, and there are also inode numbers in POSIX which do not exist on Windows. Even POSIX filesystems vary a lot, like ext3 with 32-bit block address, ext4 with 48-bit, Btrfs with 64-bit and ZFS with 128-bit address. So how will you count those metadata into file size?
Take another example with a 100-byte file whose metadata consumes 56 bytes on the current filesystem. We copy the file to another filesystem and now it takes 128 bytes of metadata. However the file contents are exactly the same, the number of bytes in the files are also the same. So displaying file size as 156 bytes on a system but 228 bytes on another is very confusing and counter-intuitive.
- [WayBack] What is the concept of creating a file with zero bytes in Linux? – Unix & Linux Stack Exchange:
touch will create an inode, and ls -i or stat will show info about the inode:
$ touch test
$ ls -i test
28971114 test
$ stat test
File: ‘test’
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fc01h/64513d Inode: 28971114 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/1000) Gid: ( 1000/1000)
Access: 2017-03-28 17:38:07.221131925 +0200
Modify: 2017-03-28 17:38:07.221131925 +0200
Change: 2017-03-28 17:38:07.221131925 +0200
Birth: -
Notice that test uses 0 blocks. To store the data displayed, the inode uses some bytes. Those bytes are stored in the inode table. Look at the ext2 page for an example of an inode structure [WayBack].
Oh and a nice NTFS thing (thanks [WayBack] Paweł Bulwan):
Related: my really old post command line – create empty text file from a batch file (via: Stack Overflow)
–jeroen
Posted in *nix, btrfs, Development, File-Systems, NTFS, Power User, Software Development, Windows | Leave a Comment »
Posted by jpluimers on 2021/09/21
Lots of interesting tidbits on unix and NTFS file systems.
If you want to blow up your tooling, try creating a recursive hardlink…, which is likely one of the reasons that nx file systems do not support them.
Covered and related topics:
Read the rest of this entry »
Posted in *nix, Development, File-Systems, History, NTFS, Power User, Software Development, Windows, Windows Development | Leave a Comment »
Posted by jpluimers on 2020/07/03
A while ago, I had to mass encrypt a lot of directories and files on Windows for some directories in an existing directory structure.
This helped me to find out which ones were already done (it lists all encrypted files on all drives; the /n ensures the files or encryption keys are not altered):
cipher.exe /u /n /h
This encrypted recursively in one directory B:\Directory:
cipher /D /S:B:\Directory /A
It also has options to wipe data (/W), export keys into transferrable files (/X) and many more.
If you like the Windows Explorer more then to encrypt/decrypt (it is a tedious process): [WayBack] How do I encrypt/decrypt a file? | IT Pro.
Via:
–jeroen
Posted in Encryption, NTFS, Power User, Security, Windows | Leave a Comment »
Posted by jpluimers on 2020/01/31
When copying over a 400 gigabyte file over the network to an NTFS compressed folder on a drive with having 600 gigabytes free space, the volume became full after copying ~350 gigabytes.
What I learned is that compressing huge files for later read-only access is fine, but you need about twice the disk space while the copy operation is in progress.
For non-compressed files you can go without this extra reservation.
Background information:
Note there are also issues with NTFS compression and de-duplication. I’m not sure about sparse files. Be careful when you try to compress the system drive where your Windows OS lives on:
–jeroen
Posted in NTFS, Power User, Windows | Leave a Comment »
Posted by jpluimers on 2018/04/20
A while ago I had an Intel Matrix RAID-1 pair of drives that got broken. One of them turned “red” and – since both drives were only a few serial numbers apart – the other was giving issues the moment I tried fiddling with it.
These actions failed:
- Windows image backup – would end up with a “blue” screen indicating Windows 10 had a problem and was trying to collect data
- Paragon HDM
- Migrating the OS to a brand new RAID-1 set
- P2V
- Disk2vhd would hang at the 100% completion mark
What had succeeded was a regular Windows backup (a non-image one).
This is what I finally did to get it working again:
- Kill disk2vhd after it hung a few hours at the 100% completion mark
- Verify with
- Mark the VHD file as online using diskpart (first atach the vdisk, select disk, then mark it online)
- Verify with chkdsk that the image was in fact without problems
- Detach the VHD file using diskpart
- Copy the VHD file to a HDD that Paragon HDM would recognise
- Use Paragon HDM to perform a V2P copy
- Paragon expects a .VD file, but if you ask it to use all file types, it does recognise that VHD files contain disk images
–jeroen
References:
Posted in NTFS, Power User, Windows, Windows 10 | Leave a Comment »
Posted by jpluimers on 2017/05/26
Source:
History repeating itself: [Archive.is] 31607 – C:\nul\nul crashes/BSOD then, now it’s this:
Via:
All versions prior to Windows 10 and Windows Server 2016 seem vulnerable.
So add $MFT to this list:
Oh BTW: history repeated itself this year too. With NUL
In short, Steven Sheldon created a rust package named nul which broke the complete package manager on Windows:
BTW: one of my gripes on learning new languages is that they come with a whole new idiom of their ecosystem: rust, cargo, crates, all sound like being a truck mechanic to me.
–jeroen
Read the rest of this entry »
Posted in Development, Microsoft Surface on Windows 7, NTFS, Power User, Security, Software Development, The Old New Thing, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows 95, Windows 98, Windows Defender, Windows Development, Windows ME, Windows NT, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Vista, Windows XP | Leave a Comment »