2

How can I increment space for /home? My first /boot directory was 5 gigabytes and next I changed to 1 gigabyte. Now I'm confused because the change give me unallocated with size 5.02GiB. How can I add this unallocated 5.02GiB to /home?

gparted](https://i.stack.imgur.com/Ucise.png) click to see full resolution

grooveplex
  • 2,486
  • 3
  • 25
  • 35

1 Answers1

2

Follow these steps to increase your /home partition.

  • Create a Ubuntu Live USB and boot from it.

  • Go to Gparted and turn off your swap partition. (Rightclick-->swap off)

    enter image description here

  • Rightclick on swap partition-- > "Resize/Move"--> Move it to the Rightmost area.

  • Right click on home partition (/dev/sda6) --> "Resize/Move" --> Increase its size by dragging it.

  • Apply changes.

Now you need to Correct the UUID entries in the fstab file.

(If you move your /boot partition)

Chroot to your original / partition and reinstall grub:

Execute the following commands in sequence.

sudo mount /dev/sda5 /mnt
sudo mount /dev/sda8 /mnt/boot
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done

sudo chroot /mnt

grub-install /dev/sda
update-grub  
exit

Update the UUID entries in fstab file as given below:

Open another terminal and execute :

sudo blkid  

Open one more terminal and execute :

sudo gedit /mnt/etc/fstab

Replace the UUID entries of sda6 & sda7 (& sda8 if you move the boot partition too) with those of the output given from the blkid command.

Reboot.

Severus Tux
  • 9,736
  • 9
  • 58
  • 97
  • thanks for your Answer. but How can i get UUID ? and why I need boot live ubuntu via usb ? I install it ubuntu on laptop . no live – Rayan_DPROGMEL Jun 15 '16 at 08:36
  • You need to be in a live session as you can't safely operate on the disk partitions while the system is in use. The `sudo blkid` command is the one that gives you the UUIDs for the partitions. – Arronical Jun 15 '16 at 09:01
  • wow .Thanks man I try your solution it worked for me thanks. – Rayan_DPROGMEL Jun 15 '16 at 09:02
  • I have edited the question. You can get the UUIDs by `sudo blkid` . You need to do this on a LIVE usb because you are editing Swap and /boot partition. Otherwise its like [Cutting off the branch one is sitting on](http://i.stack.imgur.com/JcWMh.jpg) ! . – Severus Tux Jun 15 '16 at 09:05
  • I have some question I have 2 users, userA and userB then userA have 1G space and userB have 1G space so I need increment sapce userA to 4G How can I do this? – Rayan_DPROGMEL Jun 15 '16 at 09:13
  • 1
    @Rayan_skofw if you have a new question, please [ask it](http://askubuntu.com/questions/ask) separately. Remember to explain your partition setup clearly (tell us why each user only has a limited amount of disk space, are you using separate partitions for each home directory?) – terdon Jun 15 '16 at 09:35
  • You do *not* need to update `/etc/fstab` here as moving a partition does not change its UUID. You must only do that if you delete a partition to recreate it elsewhere or if you create an entirely new partition that needs to get mounted automatically at boot. Also, if you don't modify the `/boot` (or maybe also root `/`) partition, there's absolutely no need to reinstall GRUB. Even if you moved one of those, I am not sure it would be necessary in any case as long as the order and the UUIDs stay the same. – Byte Commander Jun 15 '16 at 09:45