[clug] ntfsresize: Road Report.

Stephen Jenkin sjenkin at canb.auug.org.au
Wed Jul 20 09:28:42 GMT 2005

http://linux-ntfs.sourceforge.net/rpm/index.html - NTFS kernel RPMS
http://linux-ntfs.sourceforge.net/downloads.html - ntfsTools download

I started poking around for something to reclaim space on the 20Gb drive
on my 'new' system that'd been built with a single Win-XP partition :-(

Quickly found 'ntfsresize', part of the NTFS tools, and after an hour I'm
done and dusted... Just works - a real joy.
A warning though: You *must* have a non-hard disk way to boot you system
to repair a damaged MBR or partition table.  Knoppix is good.

'Cause I'm already running linux on the system, I took their 'hard route'
- using command line, not using a bundled ISO.
The instructions are clear & simple. I did stuff up - because I didn't
read them closely enough [loaded wrong version of kernel module RPM].

Resizing the 20Gb partition to 8Gb.
Assumes you have linux running on the system.
Is done in two passes: resize partition, then change disk partition table.

FAQ: http://mlf.linux.rulez.org/mlf/ezaz/ntfsresize.html
download: http://linux-ntfs.sourceforge.net/downloads.html

Caveat:  Various 'fdisk' programs can reduce the number of blocks actually
assigned. Read the FAQ closely.  

+ Get ntfsprogs pkg that works for you.
    ntfsprogs-1.11.0-1.i586.rpm worked for me with FC3.
+ check rpm & install: rpm -ihv ntfsprogs-1.11.0-1.i586.rpm
+ Look at what you've got: 
   fdisk -l /dev/hda => showed one big partition in hda1
+ Check things work initially
   ntfsresize --info /dev/hda1 => checks the ntfs partition
+ Do a dummy run
   ntfsresize --no-action --size 8000M /dev/hda1
+ Do it for real...
   ntfsresize --size 8000M /dev/hda1
+ check it looks OK still:
   ntfsresize --info --force /dev/hda1
+ save partition table
   sfdisk -d /dev/hda > hda.pt              # saves the partition table   
   dd if=/dev/hda of=hda.mbr bs=512 count=1 # saves the MBR
+ change the partition table
   fdisk /dev/hda [delete & recreate the partition to 8000M]
+ reboot
   Windows will 'chkdsk' the partition and do a couple of reboots...

For read-only mounting of an NTFS partition: 
FAQ at: http://linux-ntfs.sourceforge.net/info/ntfs.html

[Sorry RH/Fedora RPM's only. Some 'contribs' for PPC & Linuxant]
+ Download the RIGHT kernel module.
  'uname -r'
+ check the rpm downloaded & install it...
  'rpm -ihv kernel-module-ntfs-....'
+ '/sbin/modprobe ntfs'
+ 'dmesg | grep -i ntfs' or 'grep -i ntfs /var/log/messages'
+ 'cat /proc/filesystems' -> look for ntfs
+ 'fdisk -l' -> look for NTFS partition
+ 'mkdir /mnt/windows'; 'mount /dev/hda1 /mnt/windows -t ntfs -r'

Hope this is of value/interest to someone out there.


Steve Jenkin, Unix Sys Admin
0412 786 915 (+61 412 786 915)
PO Box 48, Kippax ACT 2615, AUSTRALIA

sjenkin at canb.auug.org.au http://www.tip.net.au/~sjenkin

More information about the linux mailing list