LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-28-2010, 02:59 PM   #1
sandgroper
Member
 
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118

Rep: Reputation: 15
Expanding Partitions.


Hi people ,

I have an older system with a 2 HDD set up in a dual boot system with Fedora and Windows XP and I want to expand the windows drive using Gparted .

I have used Gparted a few times , but I am not sure about how to go about expanding a partition when it involves a extended partition.

My existing HDD set up is

hda1 18.6 Gb fat32 - windows XP
hda2 Extended partition
hda3 18.6 Gb - fat 32 windows data storage

hdb1 /boot 100 Mb
hdb2 swap 1 Gb
hda3 / 36 Gb

What I want to do is to amalgamate hda2 and hda3 into hda1 to create one 37.2 Gb partition on the drive.

I am not sure of the sequence of how to do this , but from what I have read I think I need to
1) shrink hda3 to 0 Gb
2) shrink hda2 to 0 Gb
3) expand hda1 to maximum.

Is this the correct sequence of amalgamating hda3 , hda2 into hda1 ?

Thanks.
 
Old 05-28-2010, 03:14 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
If you're going to do that, I would just do the following:
Code:
1) move your data from hda3 somewhere else
2) delete partitions hda2 and hda3
3) grow hda1 to full drive size
There's no reason to leave the other two partitions there at all.
 
1 members found this post helpful.
Old 05-28-2010, 10:38 PM   #3
sandgroper
Member
 
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pljvaldez View Post
If you're going to do that, I would just do the following:
Code:
1) move your data from hda3 somewhere else
2) delete partitions hda2 and hda3
3) grow hda1 to full drive size
There's no reason to leave the other two partitions there at all.
Thanks for the reply.

I had though about deleting partitions hda2 and hda3 first , but I wasn't sure about what would happen afterwards , would after expanding hda1 to the full capacity and then doing a reboot and to get windows to do a file system check would the amalgamated hda1 retain the fat32 file system over to the space left by the old partitions ?

I want to retain the data on hda1 so that I don't have to re-install everything on hda1.

Also , when I go to delete the partitions , do I commit the changes after every deletion of the partitions hda2 , hda3 and then resize hda1 then commit the the changes to hda1 or do I delete the partitions hda2 , hda3 , resize hda1 and then commit the changes all in one process ?

.
 
Old 05-29-2010, 04:34 AM   #4
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I echo pljvaldez's advice to be followed but add explanation as follow

You should have hda5, hda6 etc inside the extended partition hda2. By deleting hda2, which is just a border containing no data, all logical partitions like hda5, hda6 etc willl be gone. Therte is no need to delete the logical partitions if you first nuke its extended partition.

When you delete a partition you destroy the "contents pages" of that partition. The space then become unallocated. This process is reversible if you keep a record of the partition and rebuild it.

Before deleting hda3, which is a primary partition as Linux uses hda5 as the first logical partition, you should have moved any data you want to save say to the Linux partition hdb3.

If you resize hda1 to absorb the space of hda2 and hda3 the process is irreversible.

Before you resize a Xp you should defrag it first and preferably removing the page files option (so that there is no immovable files inside the partition). Xp will automatically do a chkdsk with the resized partition on the first boot.

If the data is critical to you my advice is to clone the hda into an external hard disk vis a USB connection. Any disk larger than 37.2Gb will do. That provides you a bootable backup should you ever require it.

Gparted will be good enough for the job but I would use the latest one, say from Gparted site itself or Parted Magic as both of them do a Live CD.
 
1 members found this post helpful.
Old 05-29-2010, 06:55 AM   #5
sandgroper
Member
 
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by saikee View Post
I echo pljvaldez's advice to be followed but add explanation as follow

You should have hda5, hda6 etc inside the extended partition hda2. By deleting hda2, which is just a border containing no data, all logical partitions like hda5, hda6 etc willl be gone. Therte is no need to delete the logical partitions if you first nuke its extended partition.

When you delete a partition you destroy the "contents pages" of that partition. The space then become unallocated. This process is reversible if you keep a record of the partition and rebuild it.

Before deleting hda3, which is a primary partition as Linux uses hda5 as the first logical partition, you should have moved any data you want to save say to the Linux partition hdb3.

If you resize hda1 to absorb the space of hda2 and hda3 the process is irreversible.

Before you resize a Xp you should defrag it first and preferably removing the page files option (so that there is no immovable files inside the partition). Xp will automatically do a chkdsk with the resized partition on the first boot.

If the data is critical to you my advice is to clone the hda into an external hard disk vis a USB connection. Any disk larger than 37.2Gb will do. That provides you a bootable backup should you ever require it.

Gparted will be good enough for the job but I would use the latest one, say from Gparted site itself or Parted Magic as both of them do a Live CD.
Thanks for the reply ,

I will do as you suggest , I will :

1) Move all my data off hda3
2) Switch the windows paging off
3) Defrag the hda1 partition
4) Use Gparted to delete the extended partition hda2 , which will destroy the partition hda3
5) Use Gparted to resize hda1 to the full capacity of the drive
6) Reboot the system and let XP do a file system check .

Would that be the correct process ?

Thanks for the suggestion of turning off the paging file before I do a defrag on hda1 , I have always wondered about what was the umovalble blocks on the disk when I was doing a defrag .

ATM I have switched the paging file off and I am currently doing a defrag of hda1 and it doesn't show any of those unmovable blocks.

I have used Gparted a few times , but I have never done a resize on a critical partition before , so I want to make sure of the process before I commit to do the resizing.

For the resizing I will be using the latest version of Parted Magic so , hopefully everything will go alright.

.

Last edited by sandgroper; 05-29-2010 at 06:57 AM. Reason: Edit : typo
 
Old 05-29-2010, 07:06 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Some say a CHKDSK /F is prudent, too.

Personally I have has mixed results with gparted and found fdisk and cfdisk more robust.
 
Old 05-29-2010, 07:08 AM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Which are the typos?

I'm guessing only the second hda3 is a typo.

Quote:
Originally Posted by sandgroper View Post
hda1 18.6 Gb fat32 - windows XP
hda2 Extended partition
hda3 18.6 Gb - fat 32 windows data storage

hdb1 /boot 100 Mb
hdb2 swap 1 Gb
hda3 / 36 Gb
Is the first hda3 a logical partition or a primary?
If it were logical, most Linux systems would call it hda5 not hda3. So I think it is primary.

That means the extended partition is empty and independent of the primary partition that follows it.
 
Old 05-29-2010, 07:14 AM   #8
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by sandgroper View Post
2) Switch the windows paging off
3) Defrag the hda1 partition
Definitely a good idea when shrinking a Windows partition. I don't know if it makes a significant difference when expanding a Windows partition.

Quote:
4) Use Gparted to delete the extended partition hda2 , which will destroy the partition hda3
I'm not sure whether Gparted would even let you delete an extended partition that contains logical partitions, rather than requiring you to explicitly delete the logical partitions first.

But since we think hda3 is primary, not logical, deleting hda2 might renumber hda3 but wouldn't delete hda3.

Either way, I think it is less confusing to delete hda3 and then delete hda2.

Last edited by johnsfine; 05-29-2010 at 07:15 AM.
 
1 members found this post helpful.
Old 05-29-2010, 08:30 AM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
sandgroper,

The steps are correct.

I normally use "fdisk /dev/hda".

The commands inside fdisk are
Code:
p
d
2
d
3
p
w
q
The two "p" commands show the partition table before and after the deletion. Once satisfied you "write" the partition table with "w" and then exit fdisk by "q".

Gparted is known to reliably resize a NTFS partition for a number of years. However NTFS is a proprietary filing system and the inner working is not published. To ensure success it pays to simplify the partition by defraging and taking out the immovable files. If the NTFS has corruptions Gparted may not be able to resize it successfully. This does occur but only in extreme cases.
 
1 members found this post helpful.
Old 05-29-2010, 09:56 AM   #10
sandgroper
Member
 
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by saikee View Post
sandgroper,

The steps are correct.

I normally use "fdisk /dev/hda".

The two "p" commands show the partition table before and after the deletion. Once satisfied you "write" the partition table with "w" and then exit fdisk by "q".

Gparted is known to reliably resize a NTFS partition for a number of years. However NTFS is a proprietary filing system and the inner working is not published. To ensure success it pays to simplify the partition by defraging and taking out the immovable files. If the NTFS has corruptions Gparted may not be able to resize it successfully. This does occur but only in extreme cases.
All of my windows partitions are FAT32 , so hopefully I will have a better success in resizing the partitions than if they were NTFS.
I have purposely left my windows partitions as FAT32 so that I can write to it with Fedora when needed.

Thanks , I will post the results after I have done the resizing .
 
Old 05-29-2010, 10:32 AM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Modern kernels have ntfs-3g loaded as default. You can read write any NTFS partition for couple of years now! but you need to do it as root.

Using Fat32 partition for read/write by Linux is about 2.5 years out of date.

Last edited by saikee; 05-29-2010 at 10:33 AM.
 
Old 05-29-2010, 11:31 AM   #12
sandgroper
Member
 
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118

Original Poster
Rep: Reputation: 15
Success !
I have successfully re-sized/expanded my hda drive.

It turned out to be very easy and painless , I booted up using Parted Magic and used Gparted to do it all.

I did the careful way of deleting the partition ( hda3) that was in the extended partition first and then deleted the extended partition (hda2 ) and after that I expanded the main partition hda1 to take up the full size of the drive.

The whole operation took less than 5 minutes and Gparted actually rebuilt the file system in the blank space that was left by the deleted partitions.
I was a bit worried that the unallocated space on the deleted partitions wasn't going to have a file system on it.

I booted into Windows and there wasn't any BSOD or any error messages , the boot up just took a little bit longer to do , like Windows was thinking about what had happened.

To make sure that there was no problems , I scheduled the Windows utility to do a full hard drive scan on re-boot and everything was OK , there were no error messages.

Now I know how to expand a Windows partition , I am going to do my other dual boot computer that has the same set up as the one I just fixed.

Anyway , thanks to all the people who help me to understand how to expand/re-size partitions.

 
Old 05-29-2010, 11:37 AM   #13
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Yep. pljvaldez's scheme to be worked to like I said and you shall be home free.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] trouble expanding 4+TB GPT partition after expanding hardware RAID-5 volume muad'dib Linux - Enterprise 6 09-26-2009 05:01 PM
Expanding my experiance Michael_aust Linux - Newbie 5 06-15-2006 07:16 PM
Expanding Root Partition and Other Partitions scoobs Linux - Software 2 12-06-2005 02:57 AM
expanding / michael_mead Linux - General 3 09-03-2003 02:22 PM
Expanding a partition echid Linux - General 1 08-12-2002 10:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:02 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
Open Source Consulting | Domain Registration