Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My NAS runs Ubuntu Server 12.04, it runs this from an 8gb USB disk which is getting quite full so I have transferred that to a 32gb key using

dd if=/dev/sdc of=/dev/sdb bs=512

Now, this is great, it now boots as it should - problem is that the new drive is reporting as being the same size

/dev/sdb1       6.4G  5.3G  837M  87% /media/f8772a74-ab0a-450c-9453-0ea91422051f

so i try

$ sudo resize2fs /dev/sdb1

and get

The filesystem is already 1694208 blocks long.  Nothing to do!

Soooo.. i try

sudo fdisk -l

and get

   Device Boot      Start         End      Blocks   Id  System
   /dev/sdb1   *        2048    13555711     6776832   83  Linux
   /dev/sdb2        13557758    15632383     1037313    5  Extended
   /dev/sdb5        13557760    15632383     1037312   82  Linux swap / Solaris

Now I'm out of ideas - do i need to 'merge' sdb2 and sdb5 ? what should i do to use the full space.

Thx in advance

share|improve this question

2 Answers 2

up vote 2 down vote accepted

do i need to 'merge' sdb2 and sdb5 ? what should i do to use the full space.

Yes, that's it, essentially. To use the available space you must:

  • expand the partition
  • then expand the file system

You used resize2fs correctly, but it cannot use more space than the partition provides, so the partition must be expanded first. You can do that with fdisk or cfdisk, or use some frontend like Gparted (graphical) or GNU Parted (console).

Note that this case is a bit special because you have one primary partition (sdb1) and one extended partition (sdb2) containing a logical partition (sdb5). You'll have to delete sdb2 (thus deleting sdb5 that lies inside), then expand sdb1.

Note: I hope I don't need to mention that before doing this, you should check that the backups which you certainly have are up-to-date and complete...

Also, check what the other partitions contain before deleting them.

share|improve this answer
2  
DO NOT MERGE sdb2 and sdb5 - sdb2 is a "Virtual" partition to allow more then 4 primary partitions. –  davidgo Jan 7 at 17:11
    
@davidgo: Thanks for the hint. I incorporated it into my answer. –  sleske Jan 7 at 20:33

Simply copying the entire disk (or stick) from a lower capacity to a higher capacity does not take advantage of the larger size. You'll need to first resize the partition, then resize the file system. I'm a fan of Gparted http://gparted.org/

share|improve this answer

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.