Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running ubuntu 12.04 64bit. I used the dd command to clone my 80gb drive (filesystem) to a clean 500gb. It worked flawlessly. Afterwards , I took out the 80gb and replaced it with the new 500gb. It boots up perfectly and the entire filesystem is as it was. However , when I right click inside a directory and click properties or when I tupe df -h , it shows that there is only 10gb free space. Howrver , in the disk utility it shows the 500gb as the filesystem and nothing seems wrong. How can I make ubuntu see that there is more than just 10gb free space on the new hdd ?

EDIT:

Here is the result I get in gparted and then also the contradictory result when right clicking in a directoryenter image description here and selecting properties:

share|improve this question

1 Answer 1

up vote 2 down vote accepted

If you copied one drive to another using dd, the partition table is copied from one drive to another as-is, so all your partitions are of exactly the same size as they were on the old drive. The rest of your new drive is unallocated space.

You need to boot from Ubuntu LiveCD/USB and use gparted to resize the partition(s).

Here's an example how unallocated space looks in gparted:

enter image description here

The above is true if you dd'ed the whole device to another, something like dd if=/dev/sda of=/dev/sdb. In case you created partitions on the target drive first and then copied a partition from one drive to another (something like dd if=/dev/sda1 of=/dev/sdb1), then the partition table on the target drive is correct (i.e. it has one partition which is ~500Gb), however, the filesystem on that partition is of the same size it was on the source drive.

To resize an ext4 partition you need to use resize2fs command.

   resize2fs [ -fFpPM ] [ -d debug-flags ] [ -S RAID-stride ] device [ size ]


   The resize2fs program will resize ext2, ext3, or ext4 file systems.  It can be used to enlarge or shrink an
   unmounted file system located on device.  If the filesystem is mounted, it can be used to expand  the  size
   of  the  mounted filesystem, assuming the kernel supports on-line resizing.  (As of this writing, the Linux
   2.6 kernel supports on-line resize for filesystems mounted using ext3 and ext4.).

   The size parameter specifies the requested new size of the filesystem.  If  no  units  are  specified,  the
   units  of  the  size  parameter  shall be the filesystem blocksize of the filesystem.  Optionally, the size
   parameter may be suffixed by one of the following the units designators: 's', 'K', 'M',  or  'G',  for  512
   byte  sectors,  kilobytes,  megabytes, or gigabytes, respectively.  The size of the filesystem may never be
   larger than the size of the partition.  If size parameter is not specified, it will default to the size  of
   the partition.

See man resize2fs for more details.

share|improve this answer
    
I will try that when i get home and then give feedback. Thx ! –  Janpan Feb 10 '13 at 8:48
    
Please see the edit above. I only have a few mb's of unallocated space... –  Janpan Feb 10 '13 at 15:32
    
@Janpan: I've updated the answer –  Sergey Feb 10 '13 at 21:32
    
I have followed your advice, but I decided, before dd'ng, I formatted and partitioned the hdd into one partition that is the same size as the one I am cloning and the the rest of the free space is the other partition. Then I dd'd to the correct size partition and afterwards just resized and now it works great and is correct in the partition table. Thx for your help. Really like dd... its so simple. And gparted did the job. –  Janpan Feb 12 '13 at 4:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.