LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-07-2008, 08:53 AM   #1
jjhunt
LQ Newbie
 
Registered: Mar 2007
Location: Florida
Distribution: Fedora, Knoppix, Slackware, openSuse, and SystemRescueCD
Posts: 9

Rep: Reputation: 0
Resize fat32 filesystem to fill partition using parted


Here's my story: I'm having to re-image Windows XP boxes using PartImage, but not all of the machines have the same size hard drive. This will be done with no human interaction at all, and I've come across a snag. Since we don't know how big the hard drive or partition will be, the image we are using will be just big enough to hold Windows, and then we will expand the file system to match.

I know this is done easily with ntfs by using ntfsresize... But we cannot use ntfs (some of the machines use solid state drives, and ntfs's journaling will prematurely wear them out--they run 24-7-365 x n). I've been pouring through the parted documentation, and I'm not sure if it will do the same thing or not...

Will using parted (device) resize (current start) (current end) actually resize the file system to match the partition size? Or am I going about this the wrong way?

Thanks to anyone who can point me in the right direction!

--John
 
Old 02-07-2008, 09:26 AM   #2
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,316

Rep: Reputation: Disabled
Welcome to LQ!

Parted will resize the partition, not the file system on it.
 
Old 02-11-2008, 02:21 PM   #3
jjhunt
LQ Newbie
 
Registered: Mar 2007
Location: Florida
Distribution: Fedora, Knoppix, Slackware, openSuse, and SystemRescueCD
Posts: 9

Original Poster
Rep: Reputation: 0
For posterity's sake, I'll let you know what I found out:

After partimage was done copying the image on to the partition I was left with a 40GB partition that had a 5GB file system on it. Linux could "see" the partition at the correct size, while Windows could not.

What I did in my bash script was I grabbed the $STARTPOINT and $ENDPOINT of the partition and passed them into parted:

parted -s /dev/${DRIVETYPE} resize 1 $STARTPOINT $ENDPOINT

(DRIVETYPE being either hda or sda, depending on the computer's hardware) Apparently, since parted resizes the file system when it resizes a partition, it will grow the file system to match. Nice.

As I mentioned before, this was for fat32. NTFS will not work, but that's why we have ntfsresize, eh?
 
Old 02-11-2008, 03:43 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,199

Rep: Reputation: 2950Reputation: 2950Reputation: 2950Reputation: 2950Reputation: 2950Reputation: 2950Reputation: 2950Reputation: 2950Reputation: 2950Reputation: 2950Reputation: 2950
One of the nicest features of parted (for supported filesystems).
This is why all the other "pretty" tools (qparted/qtparted ...) use libparted.
 
Old 02-14-2008, 09:51 AM   #5
jjhunt
LQ Newbie
 
Registered: Mar 2007
Location: Florida
Distribution: Fedora, Knoppix, Slackware, openSuse, and SystemRescueCD
Posts: 9

Original Poster
Rep: Reputation: 0
Revisited

Hate to beat a dead horse, but...

Now I have an issue with a warning that says "Warning: File system reports free space as XXXX clusters, not XXXX clusters."

In script mode, it does not prompt to Ignore/Cancel. It simply cancels. But typically if you use it, and it comes up with the error and you choose ignore, parted will work just fine with no problems... is there any way at all to get it to select ignore? It defeats the purpose of having a script mode, doesn't it?

I've tested using parted in interactive mode using Here-Documents, to no avail. Are there any other tools in Linux that allow scripting to grow a fat32 file system to fill a partition's free space? What gets me is that on the machine I'm testing on, it does not always fail. Sometimes it does, sometimes it doesn't. Arg.
 
  


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
lost fat32 partition during resize. Is it possible to recover some files? gkiagia Linux - Hardware 3 07-23-2006 10:15 AM
Can't resize ext3 partition (using "parted"). Help or advise another app, plz kornerr Linux - General 2 04-28-2005 11:01 AM
Resize Partition with parted jdmml Linux - Hardware 0 07-08-2004 09:43 PM
Parted; trying to resize partition to actuall size Zero-0-Effect Linux - General 3 04-30-2004 11:13 PM
can fdisk or cfdisk resize a fat32 partition? toastermaker Linux - Software 6 01-29-2004 07:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:58 PM.

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