LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-03-2005, 12:38 PM   #1
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Rep: Reputation: 35
Help understanding ntfsresize?


when you use ntfsresize is the number you give for the resizing the overall number it will be resized to our the amount that gets taken off the end of the ntfs filesystem? Also it says the end is fragmented but it is a fresh install of windows xp pro. Shouldn't a fresh install not need fragmenting?
 
Old 03-03-2005, 12:48 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Quote:
Shouldn't a fresh install not need fragmenting?
That would seem logical but you are talking about Windows....

At any rate, you can use the --info switch to see how much the partition can be safely resized to.
For example...
ntfsresize --info /dev/hda1 #this will show how much space can be gained.

Then, you can resize the partition. The number on the end is going to be the new size of the ntfs partition.
For example...
ntfsresize --size 8000M /dev/hda1 #in this case, I'm resizing the file system to an available amount of 8000M (8GB).

If you aren't comfy doing that, you could boot up with the knoppix cd and use the GUI tool called qtparted to resize the partition.

Last edited by homey; 03-03-2005 at 12:49 PM.
 
Old 03-03-2005, 01:11 PM   #3
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
thanks for the quick reply. I have a 60 gb harddrive with windows on it and i want to leave about 25 for linux so just to make sure i understand you i would do:

ntfsresize -s 35000M (or 35840) /dev/hda1?

I didn't know that qt would automatically adjust the filesystem cuz i know with ntfsresize it doesn't resize the partition just the file system. So i'd still need something to adjust the partitions.

edit: Yeah i figured the fragmentation was due to windows shottiness.

Last edited by dr_zayus69; 03-03-2005 at 01:14 PM.
 
Old 03-03-2005, 01:15 PM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Quote:
ntfsresize -s 35000M (or 35840) /dev/hda1?
What's the output of ntfsresize --info /dev/hda1 ?
 
Old 03-03-2005, 01:44 PM   #5
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
root@ttyp0[knoppix]# ntfsresize -i /dev/hda1
ntfsresize v200309071734captive1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 60022448128 bytes (60023 MB)
Current device size: 60022448640 bytes (60023 MB)
Checking filesystem consistency ...
100.00 percent completed
Accounting clusters ...
Space in use : 1834 MB (3.1%)
Calculating smallest shrunken size supported ...
You could resize at 30013247488 bytes or 30014 MB (freeing 30009 MB).
 
Old 03-03-2005, 02:00 PM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Quote:
You could resize at 30013247488 bytes or 30014 MB (freeing 30009 MB).
That's good and means that your plans to resize to 35Gigs is ok.
ntfsresize -s 35000M /dev/hda1

Qtparted handles the entire operation ( partition and file system ) but if you are willing to use the command line, here are my notes.
Code:
When decreasing the size of a partition, do the file system first. This is true for Windows or Linux partitions.

To resize an NTFS partition to a smaller amount:
Run defrag and scandisk before proceeding
Boot up with the rescue cd
I backup the partition table with the command:
sfdisk -d /dev/hda > /mnt/images/w2part

ntfsresize --info /dev/hda1  #this will show how much space can be gained.
ntfsresize --size 8000M /dev/hda1  #in this case, I'm resizing the file system to an available amount of 8000M (8GB).

After resizing ( decreasing ) the file system, then
Run the fdisk utility to resize ( decrease ) the partition. ## note: the partition needs to be slightly larger than the file system size unless you are a magician and can get a perfect match where the file system will fit inside the new partition size.
fdisk /dev/hda
Delete the old partition and create a new one. Make sure to use the original starting point and make any changes only at the end of the partition.
Don't forget to set the partition type to 7 (NTFS) and write the changes.
Reboot and let Windows do the chkdisk thing.
Reboot with the rescue cd and run the resize with no options to make sure the file sytem matches the partition size: ntfsresize /dev/hda1
 
Old 03-03-2005, 02:06 PM   #7
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
thanks for all your help.

edit: now i get this output when doing a a test.

root@ttyp0[knoppix]# ntfsresize -n -s 35840M /dev/hda1
ntfsresize v200309071734captive1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 60022448128 bytes (60023 MB)
Current device size: 60022448640 bytes (60023 MB)
New volume size : 35840000000 bytes (35840 MB)
Checking filesystem consistency ...
100.00 percent completed
Accounting clusters ...
Space in use : 1834 MB (3.1%)
Schedule chkdsk for NTFS consistency check at Windows boot time ...
Resetting $LogFile ... (this might take a while)
Updating $BadClust file ...
ERROR: Device has bad sectors, not supported

does that mean i can not do it with ntfsresize at all or is there something i can do to be able to still use it?

Last edited by dr_zayus69; 03-03-2005 at 02:15 PM.
 
Old 03-03-2005, 02:27 PM   #8
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Quote:
Schedule chkdsk for NTFS consistency check at Windows boot time ...
You need to boot up into windows and tell it to do a chkdsk ( scan disk ) operation.
I'm not sure if xp is the same as w2k in this respect but here's info using w2k....
Right click on Start / open explorer
Right click on Local Disk ( C : ) / select properties
Select the Tools tab...
Error-checking / Check Now...
[X] Automatically fix file system errors / Start
Reboot into windows to actually start that operation.
When the chkdisk is complete, then boot into the live cd.

Last edited by homey; 03-03-2005 at 02:28 PM.
 
Old 03-04-2005, 02:04 AM   #9
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
ok im stuck.

root@ttyp0[knoppix]# ntfsresize -n -s 35840M /dev/hda1
ntfsresize v200309071734captive1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 60022448128 bytes (60023 MB)
Current device size: 60022448640 bytes (60023 MB)
New volume size : 35840000000 bytes (35840 MB)
Checking filesystem consistency ...
100.00 percent completed
Accounting clusters ...
Space in use : 1835 MB (3.1%)
Schedule chkdsk for NTFS consistency check at Windows boot time ...
Resetting $LogFile ... (this might take a while)
Updating $BadClust file ...
ERROR: Device has bad sectors, not supported

i did chkdsk /f /r a second time. I went to western digital and got a utility to check my disk and it says i have 2 or more unrepairable errors. Is there no hope in resizing this ntfs filesystem? Here is what i wanted to do. I wanted to shrink down the ntfs, resize the partition, move the partition forward a bit so i could make a /boot partition to install grub into to chain load with NTLDR to boot a distro in the space i made by resizing. (+ the swap) Would i just have to get rid of xp repartition the drive to meet those requirements?

edit: or could i use the f option of ntfsresize to force the changes? Or would that not be a good idea?
edit2: even qtparted gives the same error.
edit3: zero filling the drive wouldn't get rid of the bad sectors would it? It would just erase everything in the good ones?

Last edited by dr_zayus69; 03-04-2005 at 03:08 AM.
 
Old 03-04-2005, 04:49 AM   #10
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 115Reputation: 115
Quote:
ntfsresize v200309071734captive1
Why don't you try a more recent version of ntfsresize? The ntfsresize FAQ says:
Quote:
Before resizing an NTFS, ntfsresize makes a filesystem consistency check and it refuses to progress, giving the above messages, if it found errors. In these cases you need to boot Windows and run chkdsk with the /f (fix errors) command line option. If chkdsk asks you about if it should check the drive the next time you restart the computer then answer 'y' (yes) and restart Windows. If you don't specify the /f option then chkdsk will not fix the NTFS consistency problems.

If you still have these messages after running chkdsk /f then you probably use ntfsresize version 1.7.1. You should use at least ntfsresize version 1.9.0.
Quote:
I wanted to shrink down the ntfs, resize the partition, move the partition forward a bit so i could make a /boot partition
Won't work. You can resize it but you can't change its starting point.
 
Old 03-04-2005, 05:24 AM   #11
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
i was using the version that came with knoppix 3.6 So i will check to see if newer versions are available in the lastest version of knoppix. But also i got the same error with QTParted so there is a chance that it is not just ntfsresize. This computer is getting up there in age so i have a feeling it is the drive that is going.

Last edited by dr_zayus69; 03-04-2005 at 05:33 AM.
 
Old 03-04-2005, 11:17 AM   #12
Padma
Member
 
Registered: Aug 2003
Location: Omaha, NE, USA
Distribution: PCLinuxOS 2007
Posts: 808

Rep: Reputation: 30
Knoppix 3.7 has the version you need.
 
Old 03-04-2005, 03:19 PM   #13
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
thanks i'll try that out.
 
Old 03-18-2005, 07:02 AM   #14
igu
Member
 
Registered: Jan 2003
Distribution: Fedora, Gentoo, SUSE, Mandriva
Posts: 127

Rep: Reputation: 15
Ntfsresize also detected the unrepairable disk errors, just like the Westerd Digital utility, so it refused to progress to protect your data. Otherwise you would have a great chance to lose everything.

However I think it's too cautious. Ntfsresize being open source, here is a modified version that will let you resize partitions on dying disk: http://www.bodden.de/misc/ntfsrecovery/

NOTE: BACKUP! You really can lose the data because your disk is not reliable. Of course the unrepairable disk errors won't be fixed either, only hacked around by ignoring them. If you run chkdsk /r then they will reappear again. Unfortunately they will stay there forever and you should expect more as time goes.

Good luck!

Last edited by igu; 03-18-2005 at 07:03 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ntfsresize cluster accounting errors firecat53 Linux - General 6 09-21-2005 10:53 AM
ntfsresize an extended partition? bleargh Linux - Software 1 05-19-2005 07:12 AM
ntfsresize not resizing enough eno_on Linux - General 5 12-28-2004 08:42 AM
slackware > installation > ntfsresize kleer Linux - Newbie 23 12-28-2004 06:44 AM
Problem after using NTFSResize 1.9.1 and fdisk StE_gUy Linux - General 1 04-18-2004 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration