resize (enlarge) the Windows ntfs partition using RIP and ntfsresize


Jephe Wu - http://linuxtechres.blogspot.com

  1. Environment
HP DL360G5 server with 2x146G hard disk, Windows 2003 server R2 service pack 1, the first partition is 10G, we need to resize to 40G.


2. how to do it
use RIP (Recovery Is Possible) cdrom which you can download it from http://www.tux.org/pub/people/kent-robotti/looplinux/rip/ to boot up HP server, then use fdisk to enlarge the partition size first, after that, use ntfsresize program to resize the file system size to 40g.

3. steps

a. backup your important data just in case.

b. reboot server from RIP CD, login in as root without password, run commands below:

ifconfig eth0 10.0.0.145 up
/usr/sbin/sshd
passwd root

note : passwd root to change root password so that you can ssh to this server 10.0.0.145 remotely, use your network environment IP instead.

c. ssh into HP server remotely
, run command below to enlarge partition size:

fdisk -l /dev/cciss/c0d0 > fdisk-backup # backup the current partition table first
fdisk /dev/cciss/c0d0 # to delete the the first partition which is ntfs, then create a new partition with 40g size, then give the partition id as number '7' (compare it with your fdisk-backup file generated in previous step), taggle it as active partition to make it bootable (otherwise you cannot boot up windows anyway)

save the partition, exit

d. resize

ntfsresize -n -s 40g /dev/cciss/c0d0p1

above command just tests first, if it's okay. run it once more time without -n parameter to do the real writing.

ntfsresize -s 40g /dev/cciss/c0d0p1

reboot