Package: ntfsprogs Version: 1.12.1-1 Severity: critical Justification: causes serious data loss Tags: d-i
After a resize using Debian Installer of an NTFS partition created with Windows Vista Beta 2, I found that the partition was no longer usable. I have checked that this really is an issue by doing manual resizes of: - an NTFS (1.2) partition created by installing Windows 2000 - an NTFS (3.1) partition created by installing Windows Vista Beta 2 The two are completely similar, except that the first is successful and the second leads to corruption. The corruption only becomes clear _after_ the physical partition is resized too; resizing the partition back to its original size does not get the partition back. ntfsfix does not help either. Note that during the manual resize operation I used fdisk, but the installer uses libparted; the corruption occurs with both. Logs for the resize of both NTFS partitions are attached and clearly show the problem. I noticed that a 1.13.1 release is available, but cannot tell from the changelog if that would fix this issue. -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.15-1-amd64-generic Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Versions of packages ntfsprogs depends on: ii libc6 2.3.6-15 GNU C Library: Shared libraries ii libfuse2 2.5.3-2.1 Filesystem in USErspace library ii libntfs8 1.12.1-1 library that provides common NTFS ntfsprogs recommends no packages. -- no debconf information
debian:~# ntfsresize -i /dev/sda1 ntfsresize v1.12.1 (libntfs 8:1:0) Device name : /dev/sda1 NTFS volume version: 1.2 Cluster size : 4096 bytes Current volume size: 20974428672 bytes (20975 MB) Current device size: 20974431744 bytes (20975 MB) Checking filesystem consistency ... 100.00 percent completed Accounting clusters ... Space in use : 410 MB (2.0%) Collecting resizing constraints ... You might resize at 409182208 bytes or 410 MB (freeing 20565 MB). Please make a test run using both the -n and -s options before real resizing! debian:~# ntfsresize -s 9G /dev/sda1 ntfsresize v1.12.1 (libntfs 8:1:0) Device name : /dev/sda1 NTFS volume version: 1.2 Cluster size : 4096 bytes Current volume size: 20974428672 bytes (20975 MB) Current device size: 20974431744 bytes (20975 MB) New volume size : 8999993856 bytes (9000 MB) Checking filesystem consistency ... 100.00 percent completed Accounting clusters ... Space in use : 410 MB (2.0%) Collecting resizing constraints ... Needed relocations : 99052 (406 MB) WARNING: Every sanity check passed and only the dangerous operations left. Make sure that important data has been backed up! Power outage or computer crash may result major data loss! Are you sure you want to proceed (y/[n])? y Schedule chkdsk for NTFS consistency check at Windows boot time ... Resetting $LogFile ... (this might take a while) Relocating needed data ... 100.00 percent completed Updating $BadClust file ... Updating $Bitmap file ... Updating Boot record ... Syncing device ... Successfully resized NTFS on device '/dev/sda1'. You can go on to shrink the device for example with Linux fdisk. IMPORTANT: When recreating the partition, make sure that you 1) create it at the same disk sector (use sector as the unit!) 2) create it with the same partition type (usually 7, HPFS/NTFS) 3) do not make it smaller than the new NTFS filesystem size 4) set the bootable flag for the partition if it existed before Otherwise you won't be able to access NTFS or can't boot from the disk! If you make a mistake and don't have a partition table backup then you can recover the partition table by TestDisk or Parted's rescue mode. debian:~# ntfsresize -i -f /dev/sda1 ntfsresize v1.12.1 (libntfs 8:1:0) Device name : /dev/sda1 NTFS volume version: 1.2 Cluster size : 4096 bytes Current volume size: 8999993856 bytes (9000 MB) Current device size: 20974431744 bytes (20975 MB) Checking filesystem consistency ... 100.00 percent completed Accounting clusters ... Space in use : 409 MB (4.5%) Collecting resizing constraints ... You might resize at 408817664 bytes or 409 MB (freeing 8591 MB). Please make a test run using both the -n and -s options before real resizing! debian:~# fdisk /dev/sda The number of cylinders for this disk is set to 20023. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sda: 164.6 GB, 164696555520 bytes 255 heads, 63 sectors/track, 20023 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS /dev/sda2 2551 3158 4883760 83 Linux /dev/sda3 3159 3280 979965 82 Linux swap / Solaris Command (m for help): d Partition number (1-4): 1 Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-20023, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-2550, default 2550): +10000M Command (m for help): t Partition number (1-4): 1 Hex code (type L to list codes): 7 Changed system type of partition 1 to 7 (HPFS/NTFS) Command (m for help): a Partition number (1-4): 1 Command (m for help): p Disk /dev/sda: 164.6 GB, 164696555520 bytes 255 heads, 63 sectors/track, 20023 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 1217 9775521 7 HPFS/NTFS /dev/sda2 2551 3158 4883760 83 Linux /dev/sda3 3159 3280 979965 82 Linux swap / Solaris Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. <<< REBOOT >>> debian:~# ntfsresize -i -f /dev/sda1 ntfsresize v1.12.1 (libntfs 8:1:0) Device name : /dev/sda1 NTFS volume version: 1.2 Cluster size : 4096 bytes Current volume size: 8999993856 bytes (9000 MB) Current device size: 10010133504 bytes (10011 MB) Checking filesystem consistency ... 100.00 percent completed Accounting clusters ... Space in use : 409 MB (4.5%) Collecting resizing constraints ... You might resize at 408817664 bytes or 409 MB (freeing 8591 MB). Please make a test run using both the -n and -s options before real resizing!
debian:~# ntfsresize -i /dev/sda1 ntfsresize v1.12.1 (libntfs 8:1:0) Device name : /dev/sda1 NTFS volume version: 3.1 Cluster size : 4096 bytes Current volume size: 20972564992 bytes (20973 MB) Current device size: 20972568576 bytes (20973 MB) Checking filesystem consistency ... 100.00 percent completed Accounting clusters ... Space in use : 7887 MB (37.6%) Collecting resizing constraints ... You might resize at 7886684160 bytes or 7887 MB (freeing 13086 MB). Please make a test run using both the -n and -s options before real resizing! debian:~# ntfsresize -s 9G /dev/sda1 ntfsresize v1.12.1 (libntfs 8:1:0) Device name : /dev/sda1 NTFS volume version: 3.1 Cluster size : 4096 bytes Current volume size: 20972564992 bytes (20973 MB) Current device size: 20972568576 bytes (20973 MB) New volume size : 8999993856 bytes (9000 MB) Checking filesystem consistency ... 100.00 percent completed Accounting clusters ... Space in use : 7887 MB (37.6%) Collecting resizing constraints ... Needed relocations : 330204 (1353 MB) WARNING: Every sanity check passed and only the dangerous operations left. Make sure that important data has been backed up! Power outage or computer crash may result major data loss! Are you sure you want to proceed (y/[n])? y Schedule chkdsk for NTFS consistency check at Windows boot time ... Resetting $LogFile ... (this might take a while) Relocating needed data ... 100.00 percent completed Updating $BadClust file ... Updating $Bitmap file ... Updating Boot record ... Syncing device ... Successfully resized NTFS on device '/dev/sda1'. You can go on to shrink the device for example with Linux fdisk. IMPORTANT: When recreating the partition, make sure that you 1) create it at the same disk sector (use sector as the unit!) 2) create it with the same partition type (usually 7, HPFS/NTFS) 3) do not make it smaller than the new NTFS filesystem size 4) set the bootable flag for the partition if it existed before Otherwise you won't be able to access NTFS or can't boot from the disk! If you make a mistake and don't have a partition table backup then you can recover the partition table by TestDisk or Parted's rescue mode. debian:~# ntfsresize -i -f /dev/sda1 ntfsresize v1.12.1 (libntfs 8:1:0) Device name : /dev/sda1 NTFS volume version: 3.1 Cluster size : 4096 bytes Current volume size: 8999993856 bytes (9000 MB) Current device size: 20972568576 bytes (20973 MB) Checking filesystem consistency ... 100.00 percent completed Accounting clusters ... Space in use : 7887 MB (87.6%) Collecting resizing constraints ... You might resize at 7886319616 bytes or 7887 MB (freeing 1113 MB). Please make a test run using both the -n and -s options before real resizing! debian:~# fdisk /dev/sda The number of cylinders for this disk is set to 20023. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sda: 164.6 GB, 164696555520 bytes 255 heads, 63 sectors/track, 20023 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 2550 20481024 7 HPFS/NTFS /dev/sda2 2551 3158 4883760 83 Linux /dev/sda3 3159 3280 979965 82 Linux swap / Solaris Command (m for help): d Partition number (1-4): 1 Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-20023, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-2550, default 2550): +10000M Command (m for help): t Partition number (1-4): 1 Hex code (type L to list codes): 7 Changed system type of partition 1 to 7 (HPFS/NTFS) Command (m for help): a Partition number (1-4): 1 Command (m for help): p Disk /dev/sda: 164.6 GB, 164696555520 bytes 255 heads, 63 sectors/track, 20023 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 1217 9775521 7 HPFS/NTFS /dev/sda2 2551 3158 4883760 83 Linux /dev/sda3 3159 3280 979965 82 Linux swap / Solaris Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. <<< REBOOT >>> debian:~# ntfsresize -i -f /dev/sda1 ntfsresize v1.12.1 (libntfs 8:1:0) ERROR(5): Opening '/dev/sda1' as NTFS failed: Input/output error This software has detected that your NTFS is corrupted. Please run chkdsk /f on Windows then reboot it TWICE! Important, don't forget the /f parameter! Afterwards you can run ntfsresize. No modification was made to NTFS. [EMAIL PROTECTED]:~$ ntfsfix /dev/sda1 Mounting volume... FAILED Attempting to correct errors... FAILED Failed to startup volume: Permission denied Volume is corrupt. You should run chkdsk.
pgpIwSHFjOc9z.pgp
Description: PGP signature

