3

I am trying to upgrade my ubuntu 14.04 to 16.04 but due to lack of space in my Ubuntu installed drive I was unable to proceed the process further and also I had 30 GB of unallocated space free in my computer. I used Gparted software from my Live USB and used it to move and shrink /dev/sda6 to get about 30 GB of unallocated space in the side of /dev/sda5. After the completion of moving and shrinking I tried to expand my ubuntu drive /dev/sda5 using move/resize option but in the middle of the process some error came and didnt allow the process to go further.

Then after a fresh reboot again opened Gparted from my Live USB but now its showing some error in my ubuntu partition(/dev/sda5) which is the same initial size and dosent allow me to expand the partition. enter image description here

enter image description here

I also tried to fix the root partition using this

sudo touch /forcefsck
sudo reboot

but it didnt reported any error. What should I do now? what happended to the unallocated space I can see it in the image but its not inside sda5?

EDIT:

result for 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: 0x2253336f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   136970189    68381671    7  HPFS/NTFS/exFAT
/dev/sda3       136986248   220984415    41999084    7  HPFS/NTFS/exFAT
/dev/sda4       220985343   625139711   202077184+   f  W95 Ext'd (LBA)
/dev/sda5       220985344   318570495    48792576   83  Linux
/dev/sda6       318572544   432474111    56950784    7  HPFS/NTFS/exFAT
/dev/sda7       432633856   625139711    96252928    7  HPFS/NTFS/exFAT

Now when I start gparted its giving this error (libparted bug found)

Error informing the kernel about modifications to partition /dev/sda4 -- Device or resource busy. This means Linux won't know about any changes you made to /dev/sda4 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.

15
  • So its my first time I am usin gparted so please forgive me. You are talking about the unallocated partition between sda6 and sda7 right?That unallocated space is only about 78 MB I am talking about approx 30GB which went missing
    – Eka
    Jul 30, 2016 at 18:24
  • @Rinzwind Something is wrong with sda5. It is broken and may show a wrong size.
    – Pilot6
    Jul 30, 2016 at 18:26
  • Pleas post output of sudo fdisk -l
    – Pilot6
    Jul 30, 2016 at 18:27
  • @Pilot6 added the result to the question
    – Eka
    Jul 30, 2016 at 18:30
  • 1
    The easiest way is to re-install anyway. There is always this risk when moving partitions.
    – Pilot6
    Jul 30, 2016 at 18:53

1 Answer 1

3

Looks like the partition /dev/sda5 got enlarged, but not the ext4 file system inside it which is still at the original size.

First of all, if you haven't done it yet, make a backup! Modifying partitions and file systems always has the risk of data loss!

Then make sure you are booting from a live system so that we can operate on the file system while it's unmounted.

First we must force a file system check using this command:

sudo e2fsck -f /dev/sda5

It should hopefully report no errors or be able to fix them.

After that we can resize the file system to match the size of the partition it's located in. We do that with the command below:

sudo resize2fs -p /dev/sda5

After that you might want to repeat the first command (e2fsck) to check everything is okay.

Then your partition and file system should have the same size again and cause no more trouble regarding this issue.

3
  • From the man page, you can increase the size of a mounted ext4 filesystem.
    – ubfan1
    Jul 30, 2016 at 21:02
  • @ubfan1 Yes, resize2fs can grow mounted ext4 file systems on modern kernels without problems, but you can not properly run e2fsck on mounted file systems. This command is required before resize2fs though, you will get an error if you don't run that one before. Therefore the file system must be unmounted.
    – Byte Commander
    Jul 30, 2016 at 21:13
  • it worked it fixed the problem . For safety i run the codes twice
    – Eka
    Jul 31, 2016 at 2:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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