LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-22-2005, 12:55 AM   #1
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
Resizing my partition


My HD is split into multiple partitions, my partition table is below
Code:
Disk /dev/hda: 30.0 GB, 30005821440 bytes
16 heads, 63 sectors/track, 58140 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1       29118    14675346    7  HPFS/NTFS
/dev/hda2           29118       37645     4297387+   c  W95 FAT32 (LBA)
/dev/hda3           37645       47335     4883760   83  Linux
/dev/hda4           47335       58140     5446035    5  Extended
/dev/hda5           47335       48498      586341   82  Linux swap / Solaris
/dev/hda6           48498       58140     4859631    b  W95 FAT32
/dev/hda6 is actually ext2. I want to remove hda6, and resize hda3, so I can have more room on my debian install. I have a feeling hda4 is the journalling part of hda3, and I don't know what to do about it. Can someone tell me what I need to do?
 
Old 11-22-2005, 02:54 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Re: Resizing my partition

Quote:
Originally posted by microsoft/linux
I want to remove hda6, and resize hda3, so I can have more room on my debian install.
You can't - without significant work.
Quote:
I have a feeling hda4 is the journalling part of hda3, and I don't know what to do about it.
No, hda4 is what it says it is, an extended partition - the container for logical partitions hda5 and hda6. Check the start and end numbers and you'll see what I mean.

Your best solution would be to use hda6 as a mount-point for what is your biggest directory tree - or the one you expect to grow biggest and/or fastest. This can be achived by a simple "cp -a" command and an update to /etc/fstab.
 
Old 11-22-2005, 08:38 AM   #3
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
why is it so difficult to resize an ext3 partition? Couldn't you just move the end point back? That's what I did when I was resizing my windows partition. What about ext3 makes it so difficult?
 
Old 11-22-2005, 08:49 AM   #4
Wells
Member
 
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417

Rep: Reputation: 53
OK...a couple of problems that I see with your original idea....

First, you have a main partition, then a Windows partition, then a second linux partition. After that, in the fourth partition you have a logical partition which holds two more partitions. Those two partitions are a linux data and a linux swap partition. In order for you to do what you are talking about, you would have to do the following:

1. Wipe out the swap and last data partitions (hda5 and hda6)
2. Wipe out the logical partition (hda4)

At this point, you will only have three partitions left, and unused space from 47335 to 58140. Now you need to use parted or some other program to extend hda3 into this space. This is, of course, assuming that parted is not broken still and can handle ext3 partitions again. If not, you may have to convert hda3 into an ext2 partition, extend the drive, then convert back to an ext3 partition. Yes, even more work, not to mention you are risking the integrity of the data on hda3. Anyways...

3. Extend hda3 using parted. Leave some space at the end so that you can recreate the swap partition, unless you feel that you really don't need it. I find that it is always good to have a little bit of swap space on the system regardless, otherwise things get a little flaky.
4. Create the new swap partition as hda4, then format the partition for swap (mkswap)
5. Edit /etc/fstab to point to the new swap partition, as it has changed in enumeration.

This should do the job. I highly recommend backing up everything that you want to save, just in case something breaks.
 
Old 11-22-2005, 09:33 AM   #5
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
I understand I'd have to remove the swap and hda6(I was building LFS 6.1 on it, but I need more room). Is this the only thing that makes it so difficult? What things should I back up? the whole thing? Other suggestions?
 
Old 11-22-2005, 09:40 AM   #6
Wells
Member
 
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417

Rep: Reputation: 53
I would back up anything that you do not want to lose, on any of the partitions.
 
Old 11-22-2005, 09:43 AM   #7
samael26
Member
 
Registered: Oct 2004
Location: France, Provence
Distribution: Debian
Posts: 848

Rep: Reputation: 30
Simple things work best. I suggest backing up your whole linux partitions and
format them afresh so that you can distribute your new partitions as you think
will fit your needs best. Windows is first, so that's ok, just reinstall Debian and
rebuild LFS from scratch. What have you got to lose ?
You can make images of your linux partitions using partimage.
It will work if they are not mounted, so, boot on a Knoppix Cd for instance
to do so.

Good luck !
 
Old 11-22-2005, 10:14 AM   #8
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
I was just going to remove the LFS/swap partitions and move the back end of the ext3 partition back. Will this work? Or should I still back-up, reformat, and then put my stuff back on? Is there a way to back up to CDs? I don't have an extra HD laying around big enough
 
Old 11-22-2005, 06:37 PM   #9
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
bump
 
Old 11-29-2005, 09:56 PM   #10
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
please? noone has any other ideas?
 
Old 11-29-2005, 11:09 PM   #11
Lokathor
Member
 
Registered: Oct 2005
Location: Boise, ID
Distribution: Debian testing
Posts: 99

Rep: Reputation: 15
http://www.linuxquestions.org/questi...hreadid=362506

First, read that topic. It'll show you how to make partition backups in segments at a time with dd. You can make .iso files and burn those to CD, then copy them back to reassemble the partition later.

Be warned, this mentod is very delecate and so read closely the thread explaining how dd works first.
 
Old 11-29-2005, 11:24 PM   #12
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
the IT person at my old school showed me a way to mirror a drive, essentially tarring and untarring the drive. Is there a way to tar the drive, expand the partition, and then untar it back onto the expanded partition? Is there any reason I can't just move the end point of the partition back(after remove hda6 and swap, and then recreating swap)?
 
Old 11-30-2005, 12:10 AM   #13
Lokathor
Member
 
Registered: Oct 2005
Location: Boise, ID
Distribution: Debian testing
Posts: 99

Rep: Reputation: 15
well, if you read the description of DD a little farther than just the begining you'd see farther down that it's the same kind of process as tarring an untarring, but without any compression (good topic, i'd suggest it even if you don't use dd in ths situation, the info is helpful to be aware of). Come to mention it, Tar might be a better sollution depending on how much free space you've got left at this point.
 
Old 11-30-2005, 04:59 AM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
It is *never* as simple as "moving the endpoint of the partition back".
Not under Windows, not ever.
Consider how much you pay for the (commercial) software that does this for you, and how much you aren't paying for all the efforts of the people providing you with OSS tools.

Deleting the logicals, then the extended will allow you to resize the hda3 partition. However the filesystem within that expanded partiton will not use anything more than it was initially defined for. Imaging tools (dd and partimage for example) suffer the same limitation once the image is restored to a larger partition than the source.
There are tools to do filesystem resizing for you - some more successfully than others.

Personally I never resize partitions - I always back-up, delete, reallocate (including mkefs), then restore.
In this scenario, tar is an excellent option.
If it all goes to hell, you have the tar as a backup that can be restored almost anywhere - a significant benefit.
 
Old 11-30-2005, 08:40 AM   #15
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
so even if I moved the endpoint back(after deleting the logical partitions/swap), I would still only have 5.0 GB for my install? There's no way just to have it recognize the extra 5GB?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Resizing Linux Partition From Partition magic John_Emad SUSE / openSUSE 5 02-16-2005 12:42 PM
need help resizing an ext3 partition with an underlying partition... spiroth10 Linux - Software 1 07-30-2004 12:21 PM
? on resizing partition eroica Mandriva 0 05-11-2004 11:50 AM
Resizing a partition aikempshall Linux - Hardware 4 04-22-2004 03:06 AM
Resizing the / partition lacerto Linux - General 1 03-18-2004 12:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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