1

I have a dual boot setup. On the original disk I have Windows installed (on a uefi setup) ... and on a second drive ubuntu. It all works fine.

Yet, when I installed ubuntu on the second drive ... I manually defined the partitions. Basically I defined a swap partition, a / root partition (5GB) and a /home partition as explained in various tutorials. I allocated most of the space to the /home (90GB) partition though.

When working (me as a user with sudo priviliges) now ... it seems like all my stuff (Downloads, Projects, ...) is stored on the / root partition ... in the home folder. Which is fine with me if it is supposed to be like that. (Or like the web projects in the var folder.). But slowly I'm running out of space and I'm not even using the rest of the 90GB.

For what is the originally defined /home partition even for? And how can I savely redefine the partition size? My first thought now is to move more space to the / root partition.

When I run gparted ... the partitions are looked and I can't resize/remove them. See here:

enter image description here

Edit:

$ df /home

Filesystem  1k-blocks   Used        Available   Use%    Mounted on
/dev/sda5   1876072     8552072     9057344     49%     /

Edit 2:

$ df

Filesystem     1K-blocks     Used Available Use% Mounted on
udev             1901092        0   1901092   0% /dev
tmpfs             386268     2100    384168   1% /run
/dev/sda5       18576072  8552616   9056800  49% /
tmpfs            1931340        0   1931340   0% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs            1931340        0   1931340   0% /sys/fs/cgroup
/dev/loop0          3840     3840         0 100% /snap/gnome-system-monitor/57
/dev/loop1         91648    91648         0 100% /snap/core/6130
/dev/loop2         35456    35456         0 100% /snap/gtk-common-themes/818
/dev/loop3         13312    13312         0 100% /snap/gnome-characters/103
/dev/loop4          2432     2432         0 100% /snap/gnome-calculator/180
/dev/loop5          3840     3840         0 100% /snap/gnome-system-monitor/51
/dev/loop6          2304     2304         0 100% /snap/gnome-calculator/260
/dev/loop7        150912   150912         0 100% /snap/skype/66
/dev/loop9         13312    13312         0 100% /snap/gnome-characters/139
/dev/loop8         14976    14976         0 100% /snap/gnome-logs/45
/dev/loop10       133760   133760         0 100% /snap/postman/80
/dev/loop11        35584    35584         0 100% /snap/gtk-common-themes/319
/dev/loop12        89088    89088         0 100% /snap/core/4917
/dev/loop13        14848    14848         0 100% /snap/gnome-logs/37
/dev/loop14       144128   144128         0 100% /snap/gnome-3-26-1604/74
/dev/loop15       144384   144384         0 100% /snap/gnome-3-26-1604/70
/dev/sda2         524272     6228    518044   2% /boot/efi
tmpfs             386268       20    386248   1% /run/user/121
tmpfs             386268       96    386172   1% /run/user/1000
/dev/mnnlk1p4   60439548 20301204  40138344  34% /media/mark/98F46CVFG76D9D6E

Edit 3:

$ less etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=ad139b04-0cf2-5183-ccf2-fb90cc1ac2b1 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=6E9C-A4F3  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
~
~
~
~
(END)
7
  • It doesn't look like your 90GB partition is mounted at /home from your gparted screenshot. If you boot into Ubuntu and run df /home from a terminal, what is the output?
    – Arronical
    Jan 8, 2019 at 12:09
  • 1
    Please see the above edit
    – Philipp M
    Jan 8, 2019 at 12:22
  • I think something has gone awry with the home partition creation. I'll put together an answer which will hopefully help.
    – Arronical
    Jan 8, 2019 at 12:39
  • What's the full mount point for /dev/sda4?
    – Arronical
    Jan 8, 2019 at 12:41
  • Please see Edit 2. That's the whole output of df. /dev/sda4 is not on the list ... and mnnlk1p4 is the other (orignal) drive with windows installed.
    – Philipp M
    Jan 8, 2019 at 12:54

2 Answers 2

2

The home partition you've created does not appear to be mounted in the filesystem. Ubuntu will use the /home directory for all users' homes, so the 90G /dev/sda4 partition needs to be mounted there. Unfortunately the stuff that's already in /home needs to be copied over, and your system reconfigured to mount the /dev/sda4/ partition in the correct place.

First, create somewhere to mount your /dev/sda4 partition:

sudo mkdir /media/newhome/

Then mount the partition there:

sudo mount /dev/sda4 /media/newhome

Now copy all current homes to the current /dev/sda4 mountpoint:

sudo cp -aR /home/* /media/newhome

Now you need to edit the /etc/fstab file, which is responsible for mounting your partitions on system boot. Beware, this is a seriously important system file and ruining or deleting would be very bad!

Make a backup of /etc/fstab

sudo cp /etc/fstab /etc/fstab.bak

Get the UUID of your partition, note this down for use in your next step:

blkid /dev/sda4

Now add a new entry into your /etc/fstab file with your preferred text editor using the UUID from the last command, make sure you're accurate with the UUID:

# Mount /dev/sda at /home
UUID=(put your UUID here) /home    ext4    defaults    0    2

Unmount your /dev/sda4 partition:

sudo umount /dev/sda4

Now check that the new /home mounts correctly:

sudo mount -a

If you issue df /home now the output should show that /dev/sda4 is the partition mounted there. After this, you should check that you have nothing missing from your relocated /home directory.

All that is left is to make sure it operates as you expect after a reboot. One thing to note is that you still have the same data stored in original /home on the root filesystem /, but you've now mounted /dev/sda4 over it, so cannot access it. In order to reclaim the space from / you would need to unmount /dev/sda4, delete the old /home and remount /dev/sda4. I would only do this once I'm entirely sure everything is as it should be and no files or functionality is missing.

To remove the old home directory, unmount the newly configured home partition:

sudo umount /dev/sda4

Delete the contents of the old home directory:

sudo rm -r /home/*

Remount /dev/sda4

sudo mount -a
5
  • Excellent. Everything is working as described. I very much appreciate your help.
    – Philipp M
    Jan 8, 2019 at 16:02
  • Regarding you last point ... the data stored in the original /home is very limited. Just some desktop icons and a couple of files that can be deleted. Would you recommend to 'reclaim the space from /'? Or would you leave the structure as it is right now? Do I have any disadvantages in the future if I leave as it is like now?
    – Philipp M
    Jan 8, 2019 at 16:13
  • @PhilippM No problem. I can't see any major issues with leaving it there if it is as small as you think. I'd thought you might have a lot more in there which was using up the space on /. I wonder if it's the stuff in /snap that's using up the space? The only minor issue I can think of would be that if ever /dev/sda4 failed to mount, you might not notice as there'd still be a /home directory with stuff in it, if you saved anything there and the partition mounted properly at a later attempt it might seem like files have disappeared.
    – Arronical
    Jan 8, 2019 at 16:22
  • What would be the exact steps to finalize this last step? Could you provide it as optional step in your comment above?
    – Philipp M
    Jan 8, 2019 at 20:03
  • I've edited to add those details @PhilippM
    – Arronical
    Jan 9, 2019 at 10:02
-1

Use your live USB, run Gparted from there, then resize your partitions. First take some space from /home, then 'Apply All Operations', then add free space to your / root.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .