DebianThis forum is for the discussion of Debian Linux.
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.
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?
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.
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?
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.
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?
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.
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
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.
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)?
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.