LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Merging partitions (https://www.linuxquestions.org/questions/linux-general-1/merging-partitions-64353/)

Chrissi 06-08-2003 10:27 AM

Merging partitions
 
Well I've installed Mandrake Linux 9.1 a few days ago and it screwed up my WinXP. Windows won't boot up.

But that's not the problem, since I've pretty much learned to live without windows in these past few days. Only thing I want it back for is games, and I'll figure that out eventually.

Anyway. Since my 25 gig or so Windows partition is now useless, I want to merge it with my 7 gig Linux partition. How would I go about doing that? Windows was on NTFS (thus the not-working-ness).

...There are also two other "mystery" partitions... one 300 MB blank one and one 5 gig that the people I bought the computer from used for some sort of backup. I want to merge those, too, alowing Linux to use all of my drive. I found out about the mystery partitions using DriveDrake. With DriveDrake I tried to find a way to merge these partitions but I couldn't. Is it possible with DriveDrake or do I have to download something else?

michaelk 06-08-2003 04:55 PM

Don't know of any thing else except Partition Magic that will merge partitions. Unless you get the latest PM you will need to change the filesystem and reformat the space to something besides NTFS.

You could repartition the windows into multiple and use that space for seperate /boot /home /var etc.

Obi Perrin 06-08-2003 05:33 PM

The 300MB partition sounds awfully like the Linux swap partition. Linux actually uses that partition to temporarily store program data that is taken out of RAM, but will need to be accessed soon. In other words, if this is the swap partition, you don't want to delete it.

Your best bet would be to first transfer any irreplacable data to the Linux partition, then use parted to delete the unwanted partitions. What you do from here is a matter of preference. 7GB should be more than enough for the basic filesystem /usr/lib and /usr/bin...so instead of going through the perhaps dangerous job of changing the partition table of the OS that's working, why not just add a couple of new partitions to Linux from the free space gained?

Example: all the programs you install yourself should go in /usr/local/bin or /opt. You could make a new partition and mount in these directories. Also a /home partition of about 10GB is recommended, as it would be required to store all of your own data. As well as this, some advise that /var be a partition of it's own, as well as /boot. Personally, I have neither of these, but there is a legitimate security/stability argument for it.

The compartmentalising of partitions makes the system easier to deal with. /boot stores the compiled version of the kernel. It's required at boot-time during which the kernel is loaded into main memory, but not needed again. Some people think that not having a seperate /boot partition is a bad idea because system instability, power outage, user error can mean that data in /boot is lost, effectively making the machine unbootable. It's usually advisable to make a small partition for /boot (about 30-50MB?) and mount it as read-only in normal operation.

It's a VERY good idea to have a seperate /home partition. Picture the scene: 6 months from now, you want to update your distribution. Installing the new distro requires that the partition of the old one be formatted and over-written with the new one. Except, that means you lose your data as well, which should really remain unchanged regardless of a new install. Additionally, I've known for mistakes that I've made in my /home to make the machine almost unbootable, i.e. fillling the hard-drive completely to the point that it groaned. If my /home was on a seperate partition, this wouldn't have been a problem, as /home as it's own partition is a seperate entity to the OS.

I've rambled on a bit. Oh well. Hopefully it was helpful somehow :D

Chrissi 06-08-2003 05:55 PM

michaelk: I was looking around at Partition Magic but as far as I saw, it was only for Windows? I couldn't find a Linux version. Did I not look hard enough? Can you point me in the right direction?

Obi: Oh no, I saw the Linux swap partition, it's not the partition I was talking about. I guess I forgot to mention it. The "mystery" partition was completely blank. It has absolutely nothing on it. And well how can I transfer the data to another partition if I can't really see the current partition? Hmmm. I'm feeling kind of mixed up now. All confused. :-p Obi, how to go about doing all that is getting me mightily confused.

michaelk 06-08-2003 06:58 PM

My fault... since you don't have XP running any more it isn't going to be of any use to you. PM is only windows but it can manipulate linux filesystems.

It might be easier for you since you just installed linux a few days ago to just start over. You can then repartition the drive like you want. Reinstall XP if you desire.

The following command (need to be root)
fdisk -l (thats a small L)

will list all of the partitions on the hard drive.

Chrissi 06-08-2003 07:16 PM

Yeah, I was thinking of starting over... but how do I get all those partitions in check? How do I make them all be one partition and cleared so that Linux can just do its work when I install?

Obi Perrin 06-08-2003 08:19 PM

I just meant that before you go deleting your XP partition entirely you might need to backup your data. Music, work, documents, etc. Does Mandrake not mount your XP partition automatically at boot? If it does it should be in /mnt/win or something similar to that. By creating a directory in your user directory and copying files to it from /mnt/win is in effect backing up your important data to another partition. Linux interacts with different partitions seamlessly, so what often seems like one large partition is often the logical amalgamation of many. None of those crazy C:, D:, E: drives here :D

If Mandrake doesn't mount your windows partition by default (i.e. you're not able to see your Windows files in any of the /mnt subdirectories) then it should be a simple matter to set this up. This is of course assuming that you actually want to back anything up from XP :D. If not then you can skip straight on to the next stage.

To give more specific instructions though would require that you give a break-down of your hard-disk layout. Order of partitions, sizes, layout, that kind of thing. Install parted (there might even be a version of it on the Mandrake install CDs) then go into a terminal or your choice. Run parted with 'parted /dev/hda' (I'm assuming here that your hard disk is the primary disk on the first IDE chain. If it's not, the /dev/hda part will have to change). When parted has started type 'print' to display partition information and copy it here. After you've got that, quit parted and be sure not to save any changes.

The parted documentation is very thorough and should help a lot. You can read it at http://www.gnu.org/manual/parted-1.6...no/parted.html if you are unsure on any parts of the program.

After we've determined the structure of partitions on your disk, you can then make the decision either to expand the one partition (requires the creation of a bootdisk) or to make a bunch of new partitions.

Chrissi 06-08-2003 08:36 PM

Yeah but see, what I mean by Windows being killed is that it isn't availible to Linux nor will it boot up. The windows drive mounts but it gives me an error when I try to view it. I backed up my important data onto CD before I tried this, as I always do.

I'll take a look at that stuff. Right now I'm bogged with homework ;)


All times are GMT -5. The time now is 09:12 PM.