2

In the last couple of days, Ubuntu 19.04 (Disco Dingo) has been flashing at me saying I've got about 360 MB left and my / folder shows a pie chart with 37.5 GB in the middle of it. It is a 3 year old HP ProBook with an 1 TB disk that came with Ubuntu pre-installed

Surely Ubuntu doesn't suddenly take up nearly a terabyte of space?

Output of df -h -x{tmp,devtmp,squash}fs:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda7        38G   35G  989M  98% /
/dev/sda4       487M     0  487M   0% /media/neil/HP_TOOLS
/dev/sda5       868G  113M  823G   1% /media/neil/HOME
/dev/sda1       200M   30M  170M  15% /media/neil/BOOT

Does this help explain the missing GB? Screenshot of Disk

  • 4
    Can you edit your question and include the output of typing df -h -x{tmp,devtmp,squash}fs in a terminal please? – Byte Commander Jun 8 at 21:54
  • 1
    Got a trash bin on that disk? And do a smart test... It could just be broken. Or also possible a filesystem check – Rinzwind Jun 8 at 22:09
  • 1
    @Genius149 Open a terminal, and run df -h -x{tmp,devtmp,squash}fs . Edit the full output into your question. – vidarlo Jun 8 at 22:45
  • 1
    Run sudo chown $USER: /media/neil/HOME to get permission. This partition is not a /home-partition, thus all your files in /home reside in your root-partition. The root-partition seems to hold all your documents and videos and so on. The big partition is empty, probably meant to be a /home-partition but not mounted at /home. – mook765 Jun 9 at 7:21
  • 1
    Also sda1 looks strange, from size and usage I'd say it is the EFI System Partition, but why it's not mounted at /boot/efi? – mook765 Jun 9 at 7:30
11

You have a quite small root partition for system files and applications, most of the disk space is in your home partition for user data.

You will either need to clean up the root partition mainly by uninstalling applications, or also removing log and cache files and such things, or you have to modify your partition layout and shrink your home and grow the system partition. The latter will be a better long-term solution, as you're not going to need less system space in the future, naturally.

To modify partitions, you will have to boot into a live system, as partitions can usually not be resized while they are mounted. To do this, you can boot from the Ubuntu installer USB/DVD and select "Try Ubuntu without installing". This gives you a live desktop where you can use GParted to edit your partitions.

As your home partition is nearly empty currently and it does not look like you'll fill it up soon, I'd be generous and give the root partition around 200GB. Even 100GB should be more than necessary, but you have the space anyway.

Note that any partitioning or file system resize operation always comes with a small risk of data loss or corruption, so making a backup of your data is advisable.

  • 8
    I'm guessing that the actual home directory is also on /. Moving files from ~ to the /media/neil/HOME and mounting it on /home would probably help... – vidarlo Jun 9 at 7:56
5

Let's see:

/dev/sda7        38G   35G  989M  98% /
/dev/sda4       487M     0  487M   0% /media/neil/HP_TOOLS
/dev/sda5       868G  113M  823G   1% /media/neil/HOME
/dev/sda1       200M   30M  170M  15% /media/neil/BOOT

All four volumes are on that same 1 terabyte hard drive named /dev/sda. You have a 38G root partition, but your /media/neil/HOME is 868G. That's the bulk of the disk. Someone partitioned things this way, and so that's what it is.

Note that under df, the unsuffixed K, M or G units are 1024-based, whereas the size of your 1TB drive is 1000-based. 907 classic gigabytes (907 x 1024 x 1024 x 1024) works out to 973 GB. There is still a bit missing there toward a terabyte; maybe you have a large swap partition, or perhaps more than one? Note that we are not seeing partitions /dev/sda2, /dev/sda3 and /dev/sda6. From the df output, which shows only mounted filesystems, we have no idea how large these are and what they are used for, if anything.

  • Yes @Kaz That may have either happened when I first got it as that is what I used to do with Windows partitions and just used the space on the other partition for storage, or it arrived like that. It's taken me 3 years to get to this stage though. I've a vague understanding of your second paragraph but being a relative Ubuntu/Linux noob, I'm afraid it doesn't really mean much. I think as I investigate this it might start to make sense. – Genius149 Jun 9 at 9:23
  • @Genius149 the 1024-based units and are what Windows uses and are binary prefixes in Ubuntu. Ubuntu GUI nowadays uses SI prefixes where 1 kB = 1000 byte. A 1 TB drive contains 1000 TB which is only 973 GiB but your drive has 38 GiB + 487 MiB + 868 GiB + 200 MiB ≈ 907 GiB so you're missing 66 GiB in your list. Note that it's not 360Mb, 37.5Gb or 1Tb as you said because they're units of bits. 1TB = 8Tb. You should show gparted's screenshot to have a better look of how partitions are arranged – phuclv Jun 9 at 11:25
1

What's wrong with 'du -sh /*' ? It will show you what root folder takes up the space, then you can go from there. Though I agree most probably your home folder is on the wrong partition.. you could check with 'echo ~neil'

1

I think 40gb is enough for root file system. 1tb hard drive was partitioned well enough but not mounted correctly. In current scheme your personal files(aside of system files) was reside on the root partition. /dev/sda5 that mounted on /media/neil/HOME should be mounted on /home. I assume the username you're using was Neil. You should make folder on /media/neil/home/Neil and move all files from your home folder /home/Neil to there. Then you should make changes to /etc/fstab to mount /dev/sda5 at /home.

  • I've learnt a lot in the last couple of days and almost understand your answer lol. I'm taking the easy route and am hopefully clone it all on to a shiny second-hand 128Gig SSD. Need to get a T8 bit so I can open up the laptop first though. – Genius149 Jun 10 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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