LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Moving and resizing partitions (https://www.linuxquestions.org/questions/linux-general-1/moving-and-resizing-partitions-197480/)

slyman 06-25-2004 01:52 AM

Moving and resizing partitions
 
Hi all,

This is not directly related to LFS, but I am only doing this because of LFS (and the fact that LFS guys are generally more knowledgeable and may well have had a similar scenario.

At the moment I have a 40Gb HDD and the following partition scheme which is a legacy from having a W2K only box once apon a time:

hda1 - 10gb - Win2K NTFS
hda2 - 10gb - Core Linux Reiserfs (/)
hda3 - 1gb - swap
hda4 - 18gb - Windows 95 Extended
hda5 - 18gb - Reiserfs (/home)

I am currently building LFS 5.11 on a loopback device with the file residing on hda5. Clearly I need to get LFS onto it's own partition eventually and would also like have it as my main OS (well that's the plan) so what I would like to end up with is:

hda1 - 3gb - Win2K FAT32
hda2 - 5gb - LFS Reiserfs ( / for LFS, whatever for Core)
hda3 - Extended
- hda5 - 5gb - Core Linux Reiserfs ( / for Core, whatever for LFS)
- hda6 - 25gb - Reiserfs (/home)
hda4 - 1gb - swap

I would eventually remove Core as well.

A few questions though...

Is it possible to boot into a logical drive in an extended partition? I would think so, but I have not found any documentation that says either way.

Are there any tools to 'slide' partitions around? I would rather not blow away my whole drive (blowing away the Win2K partition is ok) So, say I

1) remove Win2K partition and create a new one in the same position but
only 3gb.
2) slide hda2 back by the 7gb now free and shrink it to 5gb
3) remove the swap partition
4) slide hda4 back to the end of hda2 (would this then become hda3?)
5) slide hda5 back to the end of hda4 (or hda3? - would this now become hda4?) and expand it....

etc etc etc

Can I do that?

Sorry if I sound ignorant, but I know very little about playing around with partitions other than creating them from scratch with fdisk (either DOS or linux) and I can't seem to find answers in any documentation only maybes (and I don't like maybes when it comes to partitions).

Thanks in advance...

Si.

mascdman 06-25-2004 09:43 PM

I watched a friend of mine change partitions around like that (he only did one, though) and as long as you keep the partition cylinder boundaries constant, I think you should be fine (Big disclaimer: I haven't done this. Make sure you have backups that work. No, really. Make backups. I was nervous just watching my friend do this). Someone please correct me on this if I'm wrong.

I tried working out a list of commands on paper and ran into a (potential) problem: how full is your /home (hda5)? If it's more than 6GB I don't think you have enough space to move the partitions around -- you'd have to delete more than just the windows hda1 partition. Let me know about /home and I'll finish off the list.

--mascdman

slyman 07-04-2004 08:02 PM

Thanks...

I tried using qparted and either it (probably not) or me (probably) messed it up ;o(. I think I forgot to reboot after one operation. Took forever to move all the partitions so I would have probably been quicker just backing up, trashing the whole drive and starting from scratch.

However, I am up and running again. Thankfully I was a good little boy and backed up beforehand.


All times are GMT -5. The time now is 06:01 PM.