3

We have an iSCSI target provided by a CentOS server attached to a Windows Server 2003 Standard box, formatted in NTFS.

My question is this - I know we can resize the backend block device fine (LVM et al.), however how do you tell Windows the NTFS filesystem has shrunk afterwards? [note we want to shrink].

I'm imagining a world of pain if it's not done correctly!

This is a production box, so ideally we'd like the process to keep the drive mounted and online during the process, but downtime can be scheduled if need be.

90% of what I've found on the subject so far basically involves using the 'ntfsresize' command in Linux to do the job -- but surely Windows can do this itself?

Cheers!

UPDATE: thanks for the replies but live bootable CDs are a daft idea. The drive is mounted over iSCSI from a Linux box - so if I needed to use gparted/ntfsresize/etc I could just unmount the iscsi target, mount the block device locally on the Linux SAN and resize. Also are people sure a gparted bootdisk would even see an iSCSI target?

I was really hoping I had underestimated Windows - but it seems not!

2

In VMware land I believe this is done automatically in the latest versions, but the way you're doing it you're going to have to use a tool like GParted (bootable ISO) or Acronis Disk Director to resize the partition (also bootable). As always, take a full backup first, your mileage may vary.

  • I still can't believe Windows lacks the ability to do it itself. Booting into Linux and resizing would be my preference (as a Linux guy), however as the client is a Windows guy it's not exactly the most professional sounding solution! – Coops Jan 17 '11 at 15:13
  • @coops 2k3 is almost a decade old now. As mr. Denny said, newer versions of windows can do this – Zypher Jul 13 '12 at 6:16
2

Windows 2003 doesn't support shrinking volumes. The OS is 9 years old at this point and it really wasn't needed that much back then. Windows 2008 introduced this feature.

Without using a 3rd party tool you'll need to present the volume to a Windows 2008 server, have it shrink the file system, then shrink the presented device.

0

PartedMagic Live CD (effectively GParted) allows for partition resizing, but would obviously require downtime on the server. Resizing large partitions can take several hours. Backup or image the drive first.

0

Generally to shrink a volume you need to do 4 things:

  1. Move file data to the beginning of the volume (in some cases to the end)
  2. Change filesystem size in filesystem metadata, reorganize metadata to reduce metadata size if necessary
  3. Change partition size if necessary (in certain cases a naked filesystem without partition table may exist so the step is not necessary)
  4. Reduce block device size

Step 1 takes most time and is most dangerous in terms of possibility of data loss and time taken. So ensure that the drive and its underlying block device are not damaged in any way before proceeding.

Fortunately step 1 can be done on a live system even on Windows 2003. Windows has defragmentation API designed to be safe to use, and there are many programs that can move the data to the beginning of the volume. This moving is not performed or performed only in part by windows built in ntfs defrag program because it doesn't improve performance.

So find a third-party defragmenter that uses defrag API. Run it in a move-data-to-beginning mode on the live server.

Then schedule downtime and use partition resizing tools from another system to do steps 2 and 3. They will take little time if data are already moved.

People advice to use bootable media (it's really a bootable flash these days, disks in 2013 are a joke) because for most people it's easiest way to have your physically connected system drive/root filesystem unmounted. If it's already network-mounted you have better options like those you explained.

0

I've successfully done shrinking w2k3 partition with Acronis Disk Director from Hiren’s BootCD 9.6.

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.