0

I made a miscalculation on my Ubuntu install and now need more space for my Windows (NTFS) partition (sda2). The problem is that I allocated ~ 100GiB to what I thought would be a shared media storage directory; this was placed in an extended partition (sda4), comprised of ~ 7GiB in a swap file (sda5) and ~ 100GiB in an ext4 storage partition (sda6), respectively. I no longer require this partitioning and am now looking to allocate this sda6 space more judiciously.

As I understand it, I need to be able to have unallocated space in a partition next to the partition that I would like to add space to. There I have a problem, as I need to move ~55GiB from sda6 (ext4) to sda2 (NTFS). Please note that sda1 is a small NTFS Windows boot partition and sda3 is my ext4 Ubuntu install partition that does not have any unallocated space (at present), and only 22GiB unused.

Lastly, I am presently in GParted off of a USB boot and have a pending operation of shrinking /dev/sda6/ from 99.96GiB to 44.18GiB, but alas, I cannot add to sda2 as was my intention. I have backed up my system, though I would prefer not to undertake anything with a large probability of file loss or grub2 failure. May I please have any relevant recommendations? Thanks so much in advance.

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8d769ec6

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      409599      203776    7  HPFS/NTFS/exFAT
/dev/sda2          409600   341301247   170445824    7  HPFS/NTFS/exFAT
/dev/sda3       341301248   399894527    29296640   83  Linux
/dev/sda4       399896574   625141759   112622593    5  Extended
/dev/sda5       399896576   415518719     7811072   82  Linux swap / Solaris
/dev/sda6       415520768   625141759   104810496   83  Linux

Disk /dev/sdb: 4022 MB, 4022337024 bytes
255 heads, 63 sectors/track, 489 cylinders, total 7856127 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          38     7839719     3919841    b  W95 FAT32
2
  • 1
    Can you post a screenshot of Gparted showing partitions. Meawhile, I'd recommend cancelling the pending job Jan 18, 2013 at 3:45
  • I don't believe I am permissioned to post images; further I don't know how to capture the gparted screenshot. I can, however, provide the sudo fdisk -l as posted subsequent to the original question. Jan 18, 2013 at 3:55

1 Answer 1

1

sda6 is actually a logical partition sitting inside sda4, an extended partition, which means that what you actually need to do is shrink sda6, resize and move sda4, move sda3, and then extend sda2. I'm not actually sure if the changes you'll need to make to sda4 are doable without doing some number crunching and fdisk magic (unless gParted can do it for you). Most of these operations I would consider dangerous for a beginner or even intermediate user, so you probably don't want to do that.

So your safest and easiest choice is: get a spare hard drive, do the partitioning right this time, and then copy all your data over (use rsync for Linux partitions and ntfsclone for NTFS partitions). Finally copy over your MBR and you should be all set. A 320GB hard drive is pretty cheap nowadays anyways.

There's a good guide here on how to do the copy.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .