2

I am using a dual boot windows 7 64-bit with Ubuntu 16.04 64-bit. I am new to Ubuntu as well as Linux.

I am getting a warning as I log in on Ubuntu about low space in home. Here is my disk space when checking through gparted.

1

Now what I want to do is reallocate some space from / to /home, since as you can see I have 59.66 GB space free in /. I want to know how to do this - the articles I read suggest it can be risky, and since I'm new I need detailed help.

I am also confused about the warning as in gparted I see that I have 1.75GB unused space in home but the warning says your home has just some 600+MB remaining. Why is that?

3
  • If the answers to that question don't help, then please let us know by editing this question to explain. Jul 23, 2017 at 15:51
  • In order to give you the best answer, I need to know if you're willing to resize or delete either sda2 or sda4. Please advise. Start new comments to me with @heynnema or I may miss them.
    – heynnema
    Jul 23, 2017 at 19:55
  • @heynnema I don't want to change or edit anything with my windows as there is already enough space for ubuntu allocation so please suggest things only for ubuntu .thank you !
    – user716691
    Aug 20, 2017 at 11:03

2 Answers 2

6

BACKUP IMPORTANT DATA BEFORE PROCEEDING

Even though the chances of losing data is slim but still

BACKUP IMPORTANT DATA BEFORE PROCEEDING


  1. Boot to a live environment using Ubuntu CD/DVD/USB.
  2. Open Gparted.
  3. Delete linux-swap (we will create it later).
  4. Resize /dev/sda5 to your desired size. See this answer for more information.
  5. Resize /dev/sda7 using the newly created unallocated space.
  6. Leave 4096 MB at the end for swap.
  7. Create new swap with the left out 4096 MB.
  8. Finally, apply all changes.
  9. Mount your / partition:

    sudo mkdir -p /media/dev && sudo mount /dev/sda5 /media/dev
    
  10. Edit /etc/fstab and change the UUID of the swap partition in the file:

    sudo gedit /etc/fstab
    
    • You can get the UUID of your swap partition from the command:

      sudo blkid
      
  11. Close everything and unmount mounted partition:

    sudo umount -R /media
    
  12. Reboot.

3
  • Basically wrong.
    – heynnema
    Jul 23, 2017 at 19:53
  • @heynnema - How? Please clarify so that I can improve my answer.
    – Raphael
    Jul 24, 2017 at 1:02
  • Fair question. 1. sda5 is / and as such 30-60G is already a good size. Reducing it will end up with /boot is full messages after a few system updates that include new kernels. 2. If you're going to delete/recreate swap, you'll have to use gparted and in terminal... mkswap and edit /etc/fstab with the new UUID. 3. The only clean way to increase sda7 is to reduce sda2 or sda4, then resize sda3 then sda7.
    – heynnema
    Jul 24, 2017 at 2:21
0

Yes, your root partition is much larger than needed.

You should never modify a mounted partition

Thus, you need a LiveCD or other boot medium in order to continue.

Boot from the live medium. and install gparted if not already there.

Use gparted to shrink the size of / partition to 15GB. This leaves room for growth.

Then, move the swap partition to the end of the / partition.

You should now have a block of unallocated space next to the /home partition.
Grow the /home partition to fill this space.

Reboot the system.

10
  • Instead of deleting and receating, try moving the swap to the left, so it does not change it's UUID. Otherwise, the system won't boot as it does not find the swap partition. Or, before starting the procedure as stated, comment the line regarding swap in your /etc/fstab, and after reboot with modified partitions, look for the UUID of the swap partition and modify /etc/fstab to reflect the new UUID.
    – ridgy
    Jul 23, 2017 at 11:59
  • @ridgy good point, thanks for the reminder about /etc/fstab. moving swap is the better option.
    – ravery
    Jul 23, 2017 at 12:00
  • Basically wrong too.
    – heynnema
    Jul 23, 2017 at 19:54
  • @ravery the biggest problem with your plan is reducing / to 15G. I guarantee that after 1 or 2 system updates that include new kernels, the user will receive "/boot is out of space" errors. When creating a separate root, 30-60G is recommended. Also, the only clean way to increase /home is to first reduce either sda2 or sda4, then resize sda3 then sda7.
    – heynnema
    Jul 24, 2017 at 2:42
  • @heynnema - he is currently using 8GB. 15 GB is double that. After having a successful kernel update,old kernels should be removed as they are unused..... I currently have 3 kernels with headers and only use 12GB. PS- everything is within the extended partition sda3 does not need to be changed.
    – ravery
    Jul 24, 2017 at 3:27

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