0

When am trying to increase the root partition (/) on Ubuntu 16.04 using Gparted it failed and gave me this message.

# umount -v "/"
umount: /: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)

What other method can I use to extend my root partition.

While doing df -h returns

Filesystem      Size  Used Avail Use% Mounted on
udev            2.9G     0  2.9G   0% /dev
tmpfs           591M  8.9M  582M   2% /run
/dev/sda1       138G  111G   20G  85% /
tmpfs           2.9G  336K  2.9G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.9G     0  2.9G   0% /sys/fs/cgroup
/dev/sda5        20G  243M   18G   2% /boot
tmpfs           591M   68K  591M   1% /run/user/1000
/dev/sda3       197G   25G  173G  13% /media/kilasa/Personal-db
/dev/sda7       116G   17G   99G  15% /media/kilasa/Water
/dev/sda6       194G   59G  125G  33% /media/kilasa/Tutorials
/dev/sda4       176G   51G  125G  29% /media/kilasa/Wind

While lsblk returns

 NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0 139.9G  0 part /
├─sda3   8:3    0 196.6G  0 part /media/kilasa/Personal-db
├─sda4   8:4    0 175.8G  0 part /media/kilasa/Wind
├─sda5   8:5    0  19.6G  0 part /boot
├─sda6   8:6    0 196.5G  0 part /media/kilasa/Tutorials
└─sda7   8:7    0 115.2G  0 part /media/kilasa/Water
sr0     11:0    1  1024M  0 rom  
sr1     11:1    1   128M  0 rom  

The screenshot I took from Gparted shows this

View Gparted Screenshot

Kafiti
  • 151

4 Answers4

1

The error you received was because the partition was currently being used by your current session.

The only way to safely move/resize partitions is to boot from a Ubuntu LiveCD and use gparted. This way, the partitions on hard disk are not actively being used.

If you need further help, please post a screenshot of how gparted see's your disk configuration now. Please explain more about your intent for the final/new disk configuration. Then I can give a better recommendation.

heynnema
  • 73,649
0

Answer for final partitioning:

sda2 extended partition

- sda5 boot
- sda1 Ubuntu ~300-400GB (check UUID in /etc/fstab)
- sdax swap ~6-8GB (edit/add /etc/fstab with UUID)

sda4 Windows ~300-400GB

It sounds like I should let you figure out how to accomplish this on your own. It's taking too much of my time. Cheers, Al

heynnema
  • 73,649
0

As the extended partition starts immediately after your root partition it is not that easy to extend your root partition, even when booting from Live CD, without destroying the data in your other partitions.

One simple way could be:

Find out which subfolder could fit into the empty space on your disk (> 80GiB):

sudo du -hs /* (this will show the usage of the toplevel directories).

Those mounted in /media, /boot, etc are not interesting, so do system directories as you cannot move them in a running system. Maybe your /home directory is worth moving and fits into 80 GiB. Or some subdirectory - just for the idea.

Create a partition in the empty space and format it (e.g. ext4).

Mount the newly created partition with sudo mount /dev/sdax /mnt. Move the contents of the respective folder to /mnt. In case of /home, you will meet some errors as not all files may be moved (when logged in as normal user). You may temporary create a user with sudo rights and home directory outside /home.

Umount /mnt and add a line in fstab to permanently mount the new partition at the directory whose contents you moved (e.g. /home).

This is contrary to what heynnema stated (folders contra partitions), but to me has been a proved solution throughout the last 25 years.

Edit:

I just read the comments on your question completely. My solution would not give you the space you require for / and windows (> 250GiB). Maybe if you backup the data in /dev/sda7 (/media/kilasa/Water) and delete this partition then gparted allows you to move the start of the extended partiotion (I never tried this; do it at your own risk). Then you can extend the root partition and the filesystem in it (as it is ext4, it is possible even if the partition is mounted, see man resize2fs; don't know if gparted allows to do so). You may the create a new NTFS-FS in the empty space after /dev/sda5 and restore your files from the backup. Thus you would not have to touch your windows system partition.

ridgy
  • 2,516
-3

In gparted, Rclick the partition to the R of /, select 'unmount'. Rclick on the unmounted partition, delete it. Then Rclick on your / partition (doesn't matter if it is mounted), select 'resize', and expand into the empty space.

If you don't want to delete the partition that is to the right of /, you can delete a partition to the left of /, then copy the partition to the right of / into the empty space by opening a terminal (ctrl+alt+t) then $ sudo dd if=/dev/sd!!! of=/dev/sd@@@ where sd!!! is the partition you want to copy, and sd@@@ is the partition you want to delete. Make sure sd@@@ is unmounted. You may prefer to use $ copy if=/dev/sd!!! of=/dev/sd@@@, if you have formatted sd@@@ as ext4.

If you want to move / to the left, you will have to close the computer then reboot into a live usb/CD, unmount / partition, then shift it to the left (which can be very time consuming).

Of course, you can only copy a partition into a space at least as large as that which you copy. You may need to shrink a partition by unmounting it, then (using gparted) resizing it. After you copy it, you can expand it to fill empty space in the partition. To do this, in gparted Lclick the partition, select 'Partition' from the dropdown menu, then select 'Disks' from the menu, and the next option for repair or somesuch.

In effect, you can use gparted to totally re-arrange your partitions' alignment. You can delete the swap space (after first Rclick and select 'swapoff', then recreate it.

The drawback to doing this is boot-up time blows out, I suspect root partition is not sure where swap has moved to. Perhaps someone can enlighten...

aarn
  • 80