LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-08-2008, 12:04 AM   #1
elsheepo
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Slackware
Posts: 90

Rep: Reputation: 20
Merging two partitons ?????


I originaly had 3 partitons on my HD.

1> NTFS
2> Linux logic
3> Linux swap

i just used cfdisk and deleted the NTFS partition. So now i have this:

1> Free Space
2> Linux logic
3> linux swap

So how do i merge the free space with my linux logic partition?

I am semi-familure with cfdisk, and not familure at all with fdisk
 
Old 03-08-2008, 12:34 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
If you just deleted the windows partition using cfdisk, did you save and exit? If so, there is a new partition table. If you try to reboot, Linux will not boot until you edit /boot/grub/menu.lst and /etc/fstab. Skip down to the fourth paragraph for instructions on editing those files before rebooting. After editing those files, then reboot so that you are working with the new partition table.

Cfdisk is the ncurses variant of fsidk, so there should be no problem if you continue to use cfdisk.

To merge the partitions, use a live cd. Partition operations should be carried out on unmounted partitions.

You have Linux installed on partition 2. So, resizing 2 to take up the free space that was partition 1 puts the Linux partition as risk. The first thing to do is make a backup of Linux and store that backup somewhere else, such as a DVD.

Now, was partition 1 a primary partition? Is partition 2 a primary parition? If the answer is yes to both questions, then extend partition 2 to take up the free space. While the liveCD is running, edit the Linux /boot/grub/menu.lst to change references to partition 2 to partition 1 (the original 1 is gone; the extended 2 becomes the new 1). Edit /etc/fstab to change the partition references for Linux to /dev/hda1 and swap to /dev/hda2, and delete references to Windows on /dev/hda1.

Now the grub menu.lst and /etc/fstab are corrected to reflect the new partition structure. Reboot and remove the liveCD. It if boots up, great. If it does not boot, then you will have to restore the backup in order to regain a bootable system.

If the windows partition was primary, and Linux and swap are in an extended partition, then you should make a Linux primary partition where windows was and copy your Linux partition into it. Then delete the extended partition (with your original Linux and swap partitions). Then extend the new Linuxpartition into the free space and make a new swap partition.

It isn't terribly difficult, but it is detailed. Do the planning before you begin. Have the plan written down on paper, step by step. Follow that plan, step by step. Make certain you understand what it is that you need to do at each step before you begin. Lack on understanding is your greatest enemy.

And the first step is usually, make a backup of anything you want to preserve before you begin.

Last edited by bigrigdriver; 03-08-2008 at 12:44 AM.
 
Old 03-09-2008, 11:10 PM   #3
crispx
LQ Newbie
 
Registered: Dec 2006
Location: NW, Georgia
Distribution: Fedora
Posts: 12

Rep: Reputation: 0
BigRigDriver --
Very detailed reply.
Exploring options:
Would a lower risk option have been to just delete most of the windows files, pagefile, etc. Shrink the ntfs partition to negligible size, then grow the ext3 partition to fill the void? The windows boot option could be deleted from grub.conf and everything else remain the same.

I know, I might not trust myself deleting partitions, messing with grub. Depending on how /etc/fstab was structured, such actions could lead to a cascade of reference errors. I know using labels in fstab has saved me on one occasion when a tech hooked up a an Oracle database server backwards, swapping the scsi channels.
 
  


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
Merging two partitons ????? elsheepo Linux - Hardware 3 03-08-2008 10:49 AM
windows partitons prospekrisal Linux - Newbie 7 07-24-2006 03:32 PM
Partitons (again) mykrob Linux - Newbie 8 08-02-2004 03:51 PM
RHE Partitons brentos Red Hat 14 07-26-2004 06:56 AM
Other partitons from ext3? Zenox Linux - Software 1 11-08-2003 03:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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