1

Update:

  • Extending Ubuntu or Ubuntu Partition Resizing is solved (see instructions in the first answer)

  • Recovery of damaged file(s) from Gparted error failed but NTFS partition looks intact after the error and chkdsk /f fix.

I used Gparted to resize but ended with error fixed through windows using chkdsk /f command but there are damaged files:

Hope this info help guys need to know which files are damaged after chkdsk fix especially when you have a big partition with alot of files in it.

after searching, I can now specify the damaged file(s) and its sector and cluster by using winhex through windows:

  1. extract and open it as admin.
  2. click open disk from toolbar and choose the logical volume partition that has problem.
  3. from navigation menu: seek file record and type the file number from chkdsk fixes information (in my case: file 34235 'see below chkdsk info').
  4. you should find the file location on the right pane and its cluster and sector.
  5. after seeking this location I found the file with zero size.

Thanks God, in my case the file damaged was many gigs movie file... with the information below is there any other damaged files !! and is there a way to recover it or fix it?.

How can I add space to ubuntu root partition (ext4) as I am dual booting Ubuntu with Windows, and my Ubuntu partition ran out of storage space and tried Gparted from live install media (try ubuntu from usb) to add unallocated space before ubuntu partition to it but when I tried to resize ubuntu partition always see zeros to add?!!

the error from gparted before using chkdsk and steps above: ...

check file system on /dev/sda3 for errors and (if possible) fix them  00:00:02    ( ERROR ) 
    
ntfsresize -i -f -v /dev/sda3  00:00:02    ( ERROR ) 
    
ntfsresize v2015.3.14AR.1 (libntfs-3g)
Device name : /dev/sda3
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 720586666496 bytes (720587 MB)
Current device size: 720586670080 bytes (720587 MB)
Checking for bad sectors ...
Checking filesystem consistency ...
ERROR(5): ntfs_decompress_mapping_pairs: Input/output error
NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.

The partition shrunk with an error and unallocated space, so I decided to run

chkdsk /f 

From Windows CMD, which gave me this output:

    Chkdsk was executed in read/write mode.  

Checking file system on E:
Volume label is Storage.

Stage 1: Examining basic file system structure ...
The highest VCN 0xc004b of attribute of type 0x80 and instance
tag 0x0 is incorrect.  The expected value is 0xf38ed.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87AC.
Deleted corrupt attribute list entry
with type code 128 in file 34235.
Unable to locate attribute of type 0x80, lowest vcn 0x4c752,
instance tag 0x0 in file 0x87ac.
The attribute of type 0x80 and instance tag 0x0 in file 0x85bb
has allocated length of 0xc004b000 instead of 0x4c752000.
Deleted corrupt attribute list entry
with type code 128 in file 34235.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000085bc.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x85BC.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000085bd.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x85BD.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000085be.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x85BE.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x7000000008790.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x8790.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x2000000008791.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x8791.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x12000000008794.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x8794.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x2000000008795.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x8795.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x2000000008796.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x8796.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x2000000008797.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x8797.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x2000000008798.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x8798.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x2000000008799.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x8799.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x200000000879a.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x879A.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x200000000879b.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x879B.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x200000000879c.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x879C.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x200000000879d.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x879D.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x200000000879e.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x879E.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x200000000879f.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x879F.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087a0.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87A0.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087a1.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87A1.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087a2.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87A2.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087a3.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87A3.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087a4.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87A4.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087a5.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87A5.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087a6.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87A6.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087a7.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87A7.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087a8.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87A8.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087a9.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87A9.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087aa.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87AA.
Unable to locate attribute with instance tag 0x0 and segment
reference 0x20000000087ab.  The expected attribute type is 0x80.
Deleting corrupt attribute record (0x80, "")
from file record segment 0x87AB.

  271872 file records processed.                                                         File verification completed.

  1215 large file records processed.                                                                                                                           
  0 bad file records processed.                                      
Stage 2: Examining file name linkage ...

  293964 index entries processed.                                                        Index verification completed.

Stage 3: Examining security descriptors ...
Cleaning up 133 unused index entries from index $SII of file 0x9.
Cleaning up 133 unused index entries from index $SDH of file 0x9.
Cleaning up 133 unused security descriptors.
Security descriptor verification completed.
Inserting data attribute into file 34235.

  11048 data files processed.                                            CHKDSK is verifying Usn Journal...
Usn Journal verification completed.
CHKDSK discovered free space marked as allocated in the
master file table (MFT) bitmap.
CHKDSK discovered free space marked as allocated in the volume bitmap.

Windows has made corrections to the file system.
No further action is required.

 703697916 KB total disk space.
 700163512 KB in 65279 files.
     24676 KB in 11048 indexes.
    359436 KB in use by the system.
     65536 KB occupied by the log file.
   3150292 KB available on disk.

      4096 bytes in each allocation unit.
 175924479 total allocation units on disk.
    787573 allocation units available on disk.

After that, the partition was fixed and running with free space wasn't available before (which means some file(s) are deleted through chkdsk fix) and unallocated space, so I ran

 chkdsk /r 

To check for bad sectors and thanks God no bad sectors were found. and I specified the damaged file as mentioned above. hope this info helps others and dev community helps me :).

  • You should disable fast boot and resize your NTFS partitions from windows. You can then add the free space to ubuntu with a live usb. – Panther Aug 30 '16 at 19:10
  • tried to disable fast boot and resize NTFS partition from disk management proceed but when trying to add this unallocated space to ubuntu partition (ext4) not allowed through disk management or gparted live usb (space available as unallocated only and can't be added to ubuntu partition (gparted resize and move option gives zero to add but I can shrink it few megs !!!) – tasty nn Aug 30 '16 at 22:30
  • you have to do gparted one step at a time. Hard to give you advice without a screen shot of your partitions – Panther Aug 31 '16 at 14:37
  • That image is from windows and you can not do what you want from windows. Boot Linux from a live USB and post a screen shot from gparted – Panther Aug 31 '16 at 16:17
  • Iam now at windows the screenshot from diskmanagement and it's installing big file right now when it finish I will go to live usb and post the screenshot form gparted just wanna know how to screenshot from live usb just in case! – tasty nn Aug 31 '16 at 16:31
-1

Finally the issue was lack of observation:

  1. first to resize ubuntu system partition: you must do it from live usb or from the media you installed ubuntu from by choosing try ubuntu instead of install it. Gparted will be used ... no thing more. (you can also try using gparted live CD instead).
  2. Rule is resize from adjacent unallocated space so open Gparted and see the location of ubuntu partition (beginning of HDD, middle or end of it) if the partition is in the middle then you have two choices for unallocated space:

    -Resize the partition before it from the end (take shorter time)

    -Resize the partition after it from the beginning (take longer time)

    *when start resizing don't cancel it let it finish even it took hours and you can watch the progress from time to time.

  3. Now you should have unallocated space adjacent to it.
  4. if the unallocated space outside the extended partition that contains ubuntu partition then you must resize the extended partition first to make it inside then ubuntu

    -see this picture and notice the colors in upper right (yellow for data - white free space - grey unallocated and cyan (extended partition) contains dark blue (ubuntu partition we want to extend) here

    -in this case cyan (extended partition) should contain the grey (unallocated space) with the blue dark (Ubuntu partition) so we resize the extended partition first then we can finally resize the blue dark (Ubuntu partition) here

    *if there is a warning about (moving a partition might cause your OS fail to boot) just proceed and click ok and you should finish with all operations completed

notes:

  • if you are dual booting windows with linux and there is error happened in NTFS partition resizing process you can try chkdsk /f from windows to fix it (and maybe you have lost some files like what happened with me above)
  • also it's recommended to chkdsk /f the NTFS partition you used in resizing operation in normal case.
  • if there is a swap space between ubuntu partition and unallocated space try to turn it off (swap off) and reallocate it then turn it back on.

Thanks God, It's done.

  • Glad it worked but IMO that is not really the best method and as you noted your method may result in data loss. Due to the potential for data loss I am giving a down vote. – Panther Sep 1 '16 at 16:40
  • if there is any other way to do this... you should mention it before. I searched alot about this and from my experience and testing this is the best way to do it.. couple of more notes: if you have space you can backup data of the affected partition(s) before resizing. using third party software like partition wizard is more risky than gparted and actually it didn't work with me for resizing ubuntu partition. at all thank you :) – tasty nn Sep 1 '16 at 21:12
  • 1. Back up your data first. 2. turn off fast boot. 3. resize windows partitions from within windows, not gparted. 4 Use gparted from a live CD to manage partitions, it is all in the gparted manual. - gparted.org/display-doc.php%3Fname%3Dhelp-manual . Data loss can always happen but you greatly increase the risk by not disabling fast boot and by resizing wnidows NTFS partions from a live CD rather then from within windows. – Panther Sep 2 '16 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.