# How do I resize ext3 partition?

## andrewwalker27

I've tried to migrate my system from a 20Gig to a 160Gig hard disk. I mounted the drive as a slave and did 

dd if=/dev/hda of=/dev/hdb

I then deleted the / partition and recreated it using the full capacity of the new disk with cfdisk.

Upon rebooting every thing came up ok but it still thinks it's on a 20Gig drive! I checked with QTparted and that reports no spare space and /dev/hda3 reports the full disk space is available for /.

How do I get my system to use the whole space? KDE seems unable to see past the old disk size and keeps complaining, I must have done something very wrong!

----------

## davidgurvich

You used dd instead of something like tar.  When you use dd it cloned the raw image.  What you actually wanted was a copy of everything on your old disk.  What you got was a copy of your old disk.

You will need to backup your disk, repartition, and reinstall from the backup.

----------

## andrewwalker27

I was following this in the forum

https://forums.gentoo.org/viewtopic-t-73146.html

but as I didn't have reiserfs and used ext3 instead I tried to use ext2resize. I think it only works on ext2 but I think you can revert to ext2 if you are using ext3 but I don't know how!

Anyone got any advice?

----------

## davidgurvich

Can you create a partition on the new disk from free-space?

What does fdisk or cfdisk tell you about your hd?

----------

## davidgurvich

I've looked at man resize2fs.  It appears that if you use fdisk to delete the partition and create a new partition in it's place with the same starting cylinder, you can then use resize2fs.  I've never done that and have no idea if it works.  

Regardless, you cannot use fdisk upon your hd from that hd.  You need to boot with some other media so that you can change the partition table.

----------

## andrewwalker27

Here's the result of fdisk /dev/hda

Disk /dev/hda: 122.9 GB, 122942324736 bytes

255 heads, 63 sectors/track, 14946 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/hda1   *           1           5       40131   83  Linux

/dev/hda2               6          68      506047+  82  Linux swap / Solaris

/dev/hda3              69       14946   119507535   83  Linux

Partitions are as follows:

/dev/hda1 is /boot

/dev/hda2 is swap

/dev/hda3 is  /

It looks ok to me!

----------

## linuxtuxhellsinki

You'd boot from LiveCD & mount that partition without journal (ext2), or U can get journal away with.

```
tune2fs -O ^has_journal /dev/hda3
```

& after that you've to resize it to the full partition size with   :Cool: 

```
resize2fs /dev/hda3
```

----------

