Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

GParted cannot shrink the partition since it says there are 5 bad sectors that are hardware related. (Scan disk on Windows XP can't fix them).

So, after booting up the GParted disc, I used the Terminal to do a

ntfsresize --bad-sectors --size 63G /dev/sda2

so after that, different webpages said fdisk will need to be run...

Must fdisk be run? If not, can you still boot up Windows XP as usual?

Can you instead use GParted to resize the partition (instead of using fdisk)?

Otherwise if fdisk is used, how is it done?

The page

http://man.linux-ntfs.org/ntfsresize.8.html

says we need to use fdisk to delete the original partition and create a new one?

The page

http://www.nishants.net/articles/ntfsresize.htm

says the new partition should be 20M to 200M larger than the new ntfs size, and set the partition's bootable flag on?

Update: the key is, what is the exact line of the fdisk command?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

If your hard drive is developing bad sectors, it's on its way to total failure. Your best bet is to buy a new one, transfer your data, and dispose of it. Hard drives are amazingly cheap now--I bought a terabyte drive for $89!

share|improve this answer
add comment

Yes, you must use fdisk if you use ntfsresize. As your first link indicates:

Similarly to other command line filesystem resizers, ntfsresize doesn’t manipulate the size of the partitions, hence to do that you must use a disk partitioning tool as well, for example fdisk(8).

GParted does all of that for you: it uses ntfsresize, and then does the fdisk step. If it errors out, and you proceed manually, you'll need to run through all the steps manually.

Your second link is detailing steps to follow if you are resizing a WinXP boot partition. If that's not what you are doing, you certainly don't need to set the new partition's bootable flag. The message about making the partition bigger than the actual size is to make sure you give it enough space, so it's not necessary if you get the math right. But it's hard to get the math exactly right, so this is good advice:

We've successfully shrunk the filesystem, now we've to resize the partition accordingly. You can use your favourite partitioning tool like fdisk, cfdisk, sfdisk etc. The only precaution that needs to be taken is to keep the starting cylinder of the partition same as original. Also, the partition should be 20-200MB larger than the size of the shrunk filesystem. We can safely chose our partition size as 15200MB as our filesystem is of 15000MB.

share|improve this answer
    
what is the exact line of the fdisk command? I think the option and numbers are the ones I am looking for. –  動靜能量 Nov 1 '09 at 17:42
    
i can't tell you that. you need to keep the starting ciylinder of the partition the same as the original. best to use fdisk interactively. –  quack quixote Nov 1 '09 at 22:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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