Merge two partitions(drives) in ubuntu

Asked by Ashish

Hi,
I wanted to merge two partitions(drives) in Ubuntu. One partition has Ubuntu installed on it while other is a blank partition with ext2 format. Please telll me how to merge second partition to the first one?

Thanks in advance.
Ashish AGARWAL

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gparted Edit question
Assignee:
No assignee Edit question
Solved by:
marcobra (Marco Braida)
Solved:
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

Create the desired partition using gparted (install it) then copy files from origin partition to destination partition

Created partition must have size big enough to contains origin files...

Revision history for this message
Ashish (eragarwal) said :
#2

Hi Marco,
Thanks for the reply. It didn't solved my problem.
I have 3 partitions on my harddisk apart from the swap area.
1) Ubuntu installed on this partition having ext2 filesystem. And free space on this is around 900MB.
2) ntfs filesystem on this partition with no data.
3) ext2 filesystem on this partition with no data.

I want to merge partition 1 and partition 3. I am using GParted software.
Please tell me the steps hot to do this.

Thanks,
Ashish

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

Please copy and paste the result of this terminal command:

sudo fdisk -l

Revision history for this message
Ashish (eragarwal) said :
#4

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002347f

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 619 4966400 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 6993 7296 2437121 5 Extended
/dev/sda3 619 3806 25600000 7 HPFS/NTFS
/dev/sda4 3806 6993 25598976 7 HPFS/NTFS
/dev/sda5 6993 7296 2437120 82 Linux swap / Solaris

Partition table entries are not in disk order

Hi Marco,
Above is the result of the command.
Thanks,
Ashish

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#5

You want to merge two partitions(drives) in Ubuntu.

One partition has Ubuntu installed on it

/dev/sda1 * 1 619 4966400 83 Linux

Then you say "while other is a blank partition with ext2 format" as you can see there is not ext2 format the sda3 and sda4 are ntfs partitions so please tell us what do you want to do...

/dev/sda3 619 3806 25600000 7 HPFS/NTFS
/dev/sda4 3806 6993 25598976 7 HPFS/NTFS
/dev/sda5 6993 7296 2437120 82 Linux swap / Solaris

Revision history for this message
Ashish (eragarwal) said :
#6

Hi Marco,

I wrote something wrong.

I wanted to merge partition(having Ububntu installed on it)

/dev/sda1 * 1 619 4966400 83 Linux

with

/dev/sda3 619 3806 25600000 7 HPFS/NTFS
/dev/sda4 3806 6993 25598976 7 HPFS/NTFS

I can format the above partitions to any filesystem if required.

My requirement is just to merge the two partitions and ubuntu installation is not lost.

Thanks,
Ashish

Revision history for this message
Best marcobra (Marco Braida) (marcobra) said :
#7

Ha! ok very easy please boot from Ubuntu live install cd and using gparted delete the

/dev/sda3 619 3806 25600000 7 HPFS/NTFS
/dev/sda4 3806 6993 25598976 7 HPFS/NTFS

and then resize the /dev/sda1 * 1 619 4966400 83 Linux partitions...

Revision history for this message
Ashish (eragarwal) said :
#8

Hi Marco,
Thanks.
This solved my problem.

Thanks for your help.
Ashish

Revision history for this message
Ashish (eragarwal) said :
#9

Thanks marcobra (Marco Braida), that solved my question.