26 (edited by Damon 2012-09-05 01:03:52)

Re: Proposition of a tutorial for the NTFS size bug

greegthegeek wrote:

---------snip---------

*** EDIT by gedakc 2010-02-18:  The value 63 is the starting sector of the NTFS file system partition.  It might differ on your system.

Write your pbr in a file: dd if=/dev/sda of=/some/where/myCurrentPbr.pbr bs=512 count=1 skip=63

---------snip---------

NOTE:  Be extra careful when entering the commands.  Data loss could result otherwise.

dd if=/some/where/myCurrentPbr.pbr of=/dev/sda bs=512 count=1 seek=63

---------snip---------


Can you change the skip and seek to be a bit more visible? On the dump you use skip=63 (or 2048 in my case), whereas on the load it requires seek=63 (or 2048).

I didn't catch that so I was recalling the buffer in the terminal using the up arrow. I kept getting an error that it "cannot skip to specified offset" I finally figured it out, but maybe listing that error at the very end might help too.

Thanks, you rock! I didn't lose mission critical data, but it was a bunch of settings I didn't want to have to set again.

------

Edit: BTW I was using GParted that was bunded with the SysRescCd, v 1.5.3. It's a few years old (2010), but it was handy and I had never encountered any problems with GParted & NTFS in the past. I'll use a newer version next time ;-)

27

Re: Proposition of a tutorial for the NTFS size bug

Thank you Damon for the advice.  I have updated the skip and seek keywords to be blue and red respectively.  I hope that this will make these keywords stand out better.

28

Re: Proposition of a tutorial for the NTFS size bug

Hello, I recently attempted to shrink down a partition to move data from a failing drive to a (smaller) SSD. I was about to post my log and ask for help but it looks like I may be subject to this bug. Can someone please look at my results and tell me if this tutorial should be able to fix my issue? Thanks.

GParted 0.14.0 --enable-libparted-dmraid

Libparted 3.1

Shrink /dev/sda2 from 574.59 GiB to 126.11 GiB  00:41:33    ( ERROR )  
     
calibrate /dev/sda2  00:00:00    ( SUCCESS )  
     
path: /dev/sda2
start: 409,600
end: 1,205,415,935
size: 1,205,006,336 (574.59 GiB)  
 

check file system on /dev/sda2 for errors and (if possible) fix them  00:00:22    ( SUCCESS )  
     
ntfsresize -P -i -f -v /dev/sda2  
     
ntfsresize v2012.1.15AR.5 (libntfs-3g)
Device name : /dev/sda2
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 616963240448 bytes (616964 MB)
Current device size: 616963244032 bytes (616964 MB)
Checking for bad sectors ...
Checking filesystem consistency ...
Accounting clusters ...
Space in use : 135410 MB (21.9%)
Collecting resizing constraints ...
Estimating smallest shrunken size supported ...
File feature Last used at By inode
$MFT : 330766 MB 0
Multi-Record : 334062 MB 361812
$MFTMirr : 1 MB 1
Compressed : 331749 MB 13851
Sparse : 332411 MB 75691
Ordinary : 334086 MB 617636
You might resize at 135409872896 bytes or 135410 MB (freeing 481554 MB).
Please make a test run using both the -n and -s options before real resizing!
  
 
 

shrink file system  00:41:11    ( ERROR )  
     
run simulation  00:11:52    ( SUCCESS )  
     
ntfsresize -P --force --force /dev/sda2 -s 135409958911 --no-action  
     
ntfsresize v2012.1.15AR.5 (libntfs-3g)
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
allocated extent inode 277
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Non-positive free clusters (0)!
Device name : /dev/sda2
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 616963240448 bytes (616964 MB)
Current device size: 616963244032 bytes (616964 MB)
New volume size : 135409951232 bytes (135410 MB)
Checking filesystem consistency ...
Accounting clusters ...
Space in use : 135410 MB (21.9%)
Collecting resizing constraints ...
Needed relocations : 5354933 (21934 MB)
Schedule chkdsk for NTFS consistency check at Windows boot time ...
Resetting $LogFile ... (this might take a while)
Relocating needed data ...
Updating $BadClust file ...
Updating $Bitmap file ...
Updating Boot record ...
The read-only test run ended successfully.
  
 
 

real resize  00:29:19    ( ERROR )  
     
ntfsresize -P --force --force /dev/sda2 -s 135409958911  
     
ntfsresize v2012.1.15AR.5 (libntfs-3g)
allocated extent inode 277
No free mft record for $MFT: No space left on device
Could not allocate new MFT record: No space left on device
Device name : /dev/sda2
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 616963240448 bytes (616964 MB)
Current device size: 616963244032 bytes (616964 MB)
New volume size : 135409951232 bytes (135410 MB)
Checking filesystem consistency ...
Accounting clusters ...
Space in use : 135410 MB (21.9%)
Collecting resizing constraints ...
Needed relocations : 5354933 (21934 MB)
Schedule chkdsk for NTFS consistency check at Windows boot time ...
Resetting $LogFile ... (this might take a while)
Relocating needed data ...
Updating $BadClust file ...
Updating $Bitmap file ...
ERROR(28): Could not update runlist for attribute 0x80 in inode 0: No space left on device
  
 
 
 
 

========================================

Move /dev/sda3 to the left  

========================================

Move /dev/sda4 to the left and shrink it from 103.34 MiB to 103.00 MiB  

========================================

29

Re: Proposition of a tutorial for the NTFS size bug

@levih, based on the log it appears that you have encountered a different problem.  I highly recommend that you try using the latest GParted version (currently 0.19.1) while booted from media containing GParted Live.  GParted Live contains more recent versions of ntfs-3g which is where I think the problem originates.  You might also try booting into Windows to run "chkdsk /f /r" on the drive, shutdown Windows properly, and then boot using the latest GParted Live.

If the problem persists, please create a new post in a new thread.

30

Re: Proposition of a tutorial for the NTFS size bug

i have sucessfull solved my problem with the info from this tutorial.