Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 ?
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 ?
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.
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
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.
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.
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 .
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.