-2

Problem Description:

My partition table is look like as following:

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   254523001   127260477   83  Linux
/dev/sda2       254523390   488396799   116936705    5  Extended
/dev/sda5       486397952   488396799      999424   82  Linux swap / Solaris
/dev/sda6       254523392   486397951   115937280   83  Linux

and file system disk space usage as following:

Filesystem     1K-blocks     Used Available Use% Mounted on
udev             4013888        8   4013880   1% /dev
tmpfs             805480     1172    804308   1% /run
/dev/sda6      113986168 28178352  79994568  27% /
none                   4        0         4   0% /sys/fs/cgroup
none                5120        0      5120   0% /run/lock
none             4027392      152   4027240   1% /run/shm
none              102400       40    102360   1% /run/user
/dev/sda1      125132488  6778988 111974096   6% /media/mms/3d35f615-d0f3-4af6-8fe1-597eac0c9b07

I would like to increase the disk space of /dev/sda6.

Is there any possiblity to make some free space from /dev/sda1 and allocate them in /dev/sda6 without hamparing my linux installtion, which I guess is in /dev/sda6.

Thanks in Advance.

Q/A

1) Which version of Ubuntu do you use?

#uname -a
Linux Falcon 4.4.0-142-generic #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

2) Do you use Hibernation?

No

3) Have you generated a screenshot of gparted to show the layout of your partitions and added it to your question with edit? enter image description here

Q. As both sda1 and sda6 appear to be underutilized, why move space from sda1 to sda6?

I was running a build process in /dev/sda6 and at some point the build process failed, because /dev/sda6 was getting full and build aborted. May be there are some other way to fix that (which i haven't found yet), and i just curious about reallocation method.

Solution following the steps provided by @heynnema:

  1. backup an image of /dev/sda. DONE.
  2. Boot ubuntu from USB and gparted from that ubuntu system.
  3. "resize sda1 by moving the right side of the partition towards the left, by the size that you wish to add to sda6". DONE.
  4. "carefully resize the left side of sda2 extended partition all the way left". Precondition: unmount /dev/sda6 partition. After that its successful. DONE.
  5. "carefully move the sda6 partition all the way left". DONE. However, it show a notification as attached. I take a deep breath and click OK. DONE. notification
  6. "click the Apply icon" in the top. It take some time to apply the changes. After I come back from Lunch it looks finished :) before apply after applying
  7. Shutdown the ubuntu from the USB. Start the Machine and boot from hard-drive.

Fortunately there is no problem occur during boot-up. So, taking the risk is payed off.

Thanks a lot @heynnema for your great assistance.

Falcon
  • 1
  • 1
  • 4
  • As both sda1 and sda6 appear to be underutilized, why move space from sda1 to sda6? – heynnema Nov 19 '19 at 22:08
  • Edit your question and show us a screenshot of gparted. – heynnema Nov 19 '19 at 22:10
  • Edit your question and show us the output of free -h. – heynnema Nov 19 '19 at 22:41
  • 1
    Version 14.04 is end-of-public-support; it is only supported directly from Canonical with an ESM agreement. https://ubuntu.com/esm Therefore, we do not support it here, except to assist you in migrating to a supported version (16.04 LTS,, 18.04 LTS, or 19.10). Please see https://askubuntu.com/questions/91815/how-to-install-software-or-upgrade-from-an-old-unsupported-release – K7AAY Nov 20 '19 at 16:52
  • I created an answer for you. Please start comments to me with @heynnema or I may miss them. I almost missed your edits to the question, as you didn't inform me that you had added the requested info. – heynnema Nov 21 '19 at 04:12

1 Answers1

0

Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or loose data.

Keep these things in mind:

  • always start the entire procedure with issuing a swapoff on any mounted swap partitions, and end the entire procedure with issuing a swapon on that same swap partition

  • a move is done in gparted by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor

  • a resize is done in gparted by dragging the left/right side of a partition to the left/right with the directional arrow cursor

  • if any partition can't be moved/resized graphically with gparted, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)

  • you begin any move/resize by right-clicking on the partition in the lower pane of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window

Do the following...

Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.

  • boot to a Ubuntu Live DVD/USB
  • start gparted
  • resize sda1 by moving the right side of the partition towards the left, by the size that you wish to add to sda6
  • carefully resize the left side of sda2 extended partition all the way left
    • resizing sda2 can be tricky, and we may have to use an alternate method to do it
  • carefully move the sda6 partition all the way left
  • you may wish to resize your swap partition sda5 at this time, as it's too small
  • resize sda6 by moving the right side of the partition all the way right
  • click the Apply icon
K7AAY
  • 17,202
heynnema
  • 70,711
  • Thanks for suggestion. I just think, i would take an image of /dev/sda first to stay in the safe side. – Falcon Nov 21 '19 at 08:47
  • @Falcon that's a good idea! Let me know how you do. – heynnema Nov 21 '19 at 09:49
  • @Falcon status please... – heynnema Nov 22 '19 at 14:51
  • I have succeed reallocation of hard drive space from one partition to another following your steps. I have written the steps i followed in the description, as here in the comment has not much space.

    Thanks a lot for your great assistance.

    – Falcon Nov 26 '19 at 13:16
  • @Falcon Great news! Thanks for the update. Did you also resize your sda5 swap? – heynnema Nov 26 '19 at 14:54