LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-30-2010, 07:19 PM   #1
wastingtime
Member
 
Registered: Sep 2004
Posts: 86

Rep: Reputation: 17
resize partitions and keep the data


I have a dual boot (pclinuxos, winxp) machine with multiple partitions.

The first two physical partitions are NTFS-3G and used by WinXP.

I'd like to resize them such that the first partition (C: ) will have more space and the second partition (D: ) will have less space. This must be done without damaging the WinXP installation.

The size, location and order of the Linux partitions should remain them same.

Is there a Linux tool I can use to perform this surgery?

Here's the layout of the hard drive.
The partitions are listed in their physical order on the disk.

Quote:
/dev/sda1 NTFS-3G (C: ) 6.9GB
/dev/sda5 NTFS-3G (D: ) 19.0GB
/dev/sda6 Linux swap 1.9GB
/dev/sda7 Linux (/ ) 27.0GB
 
Old 08-30-2010, 07:29 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
The second partition is the biggest problem because most operating systems tend to put information at the beginning of the partition. However, you should be able to do this with a GParted Live CD, but you'll have to be careful. Using XP, defragment the 2nd partition so that everything is at the beginning of the partition. Then boot into GParted Live and shrink the 2nd partition. When that is done, you'll want to move the 2nd partition to the end of the free space. Then you'll extend the first partition to fill up the rest of the free space. Then reboot into XP. It might do a chkdisk since you changed the drive size, but it should be fine.

I have done this in the past and it worked. But there's always a risk of data loss. Make sure you've backed everything up to another (preferably external) drive.
 
Old 08-30-2010, 07:30 PM   #3
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
You should be able use the gparted live cd http://gparted.sourceforge.net/livecd.php to do this. Please ensure you back up your data first, my personal preference is clonezilla but there are more choices than you can poke a stick at. There are also plenty of tutorials on gparted usage like this example.

<edit>Damn! .. too slow!</edit>

cheers
 
Old 08-30-2010, 07:30 PM   #4
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,096
Blog Entries: 21

Rep: Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473
Gparted in PartedMagic Iso (google it) can resize windows without damaging windows parrtition. Saying that. I would of course back up any critical data before resizing any partitions.

After resizing. Be sure to boot back into windows first because it does a check disk first before booting because Of resizing. I have shrunk XP on my EEEPC 701SD so I could DD it to a 8gig external SD Flash drive.

Last edited by rokytnji; 08-30-2010 at 07:34 PM.
 
Old 08-30-2010, 07:32 PM   #5
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
... looks like we have a consensus
 
Old 08-30-2010, 07:38 PM   #6
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,820

Rep: Reputation: 229Reputation: 229Reputation: 229
I don't think so...

A Windows partition has data at the front boundary of the partition. I don't think you can shrink "D" at its beginning to create room for more of "C" without loosing information vital to the files on the partition.

Can you not copy the contents of "D" to another medium, shrink "D" from the front, then copy the contents back?

I seem to be in the minority here, and await more replies.

Wrong...

I seem to be in the minority here because I seem to be wrong, alas. Shrink "D" and then move it to the "right" leaving space for "C" to the "left" as posted by pljvaldez is the correct answer. Backup is very good to have when doing this.

Last edited by thorkelljarl; 08-30-2010 at 08:19 PM.
 
Old 08-30-2010, 08:48 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Be aware that those (other than the C: drive) are logical partitions. The left boundary of the extended will need to be moved to accommodate as well.
 
Old 08-31-2010, 12:11 AM   #8
linux_hy
Member
 
Registered: Oct 2006
Posts: 66

Rep: Reputation: -2
an unskillfull resolve
you could backup the disk with command dd then repart the disk and last restore with dd again
 
  


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
LXer: How To Resize ext3 Partitions Without Losing Data LXer Syndicated Linux News 0 01-09-2007 08:33 PM
Does the Suse 10.0 installation resize fat32 partitions without data loss? augu2000 SUSE / openSUSE 4 10-26-2005 05:28 PM
Resize Partitions mramos Red Hat 4 09-12-2005 09:32 AM
Install Slack 10, resize partitions w/o losing data Hal Linux - General 4 09-03-2004 10:00 AM
resize partitions wolfe2554 Linux - General 1 07-05-2004 08:06 PM

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

All times are GMT -5. The time now is 03:42 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