Even more proof - using du on individual directories in /
the only directories of any real size are /usr, /var, /opt, /root
$ du -sh /usr
15G /usr
$ du -sh /opt
969M /opt
$ sudo du -sh /var
1.3G /var
$ sudo du -sh /root
1.9G /root
Still adds to 19G
The mystery remains (at least in my mind)
Seem to have strayed a bit from the original topic.
Altho not really because if my system is only using 19G the original problem was never there in the first place {:
Part of your filesystem is also being used by the ext4 journal. I’m not sure of the percentage, but I believe the maximum size for the journal on an ext4 filesystem with 4K block size to be 2 GiB.
Another thing that’s possible — I should have thought about this earlier — could be that you have at one point dumped a whole lot of stuff into /home without that /home was mounted. As a result, all of those files would still be there and consuming space on the root filesystem, but they would be invisible for as long as your /home partition is mounted.
You have to keep in mind that in and of itself, /home is only a directory on the root filesystem, and if nothing is mounted there, then whatever gets written to /home will be taking up space on the root filesystem itself. If you then mount another filesystem on /home later without having cleaned out the directory first, then that content is simply hidden by the new mount, but that doesn’t mean it’s no longer there.
The best way of checking this is to boot up from the live USB — without chrooting! — and mount your root filesystem (/dev/sdb3) to /mntwithout also mounting your /home filesystem (/dev/sdb2), and then checking whether there is anything under /mnt/home. I’m willing to bet that there’s a lot of stuff there.
OK I did as you suggested - I booted up with a debian usb and mounted /dev/sdb3 to /mnt/manjaro and /dev/sdb2 to /mnt/manjaro-home.
When I looked into /mnt/manjaro/home there was a dir with my username, but the dir is empty - no contents.
This separate home partition was set up when I installed manjaro a few years back. It’s unlikely that /home has ever been unmounted
If there is a directory with your username under the unmounted /home, then it must have been used unmounted at some point, because if /home was always a mountpoint, then the /home on the root filesystem would be empty — no directory with your username.
And just because the directory with your username appears empty doesn’t mean that it is. There could be hidden directories and hidden files in there.
And what about swap files? Do you have any of those on your root partition?
OK, that makes sense …
I have another (fake) user registered … I noticed that there was only one user name under /home on the debian mount - the other user name was not there
What if I remount sdb3 in the debian system and delete the dir with my username under /home?
What if there is a bunch of files and directories under /mnt because you copied/moved that stuff there without that /dev/sda1 and/or /dev/sda2 were mounted?
So, considering that nothing under /mnt is needed by the system, I would suggest that you temporarily unmount /dev/sda1 and /dev/sda2 and then take a look at what still lives under /mnt/data and /mnt/touro.
Very nice tip, thanks - it’s in my regular toolbox now (:
I mounted sdb3 on a live USB and ran du
It shows a total usage of 19G
As @Aragorn suspected above, the home folder did have some hidden folders dated 2018 which I deleted. Only amounted to 1.5M
But wait, there’s more …
There were indeed a bunch of files inside /mnt/touro and /mnt/data, when I unmounted those partitions … some pacman packages (2.7G) and some old duplicity backup files (15G). I have removed those now. How they got there I can’t say - at some point when duplicity or pacman were writing to disc but those partitions were not mounted - it’s hard to see when a situation like that could have arisen seeing that those are mounted by fstab …
The best way is to ensure that all filesystems are mounted at boot, either by way of /etc/fstab or by way of a systemd mount, instead of relying on automounting on login. It’s really not hard to do, and it can save you a lot of trouble later.
Yes, I deleted the main offending files under /mnt inside my usual machine, before scanning sdb3 with du under the debian usb. The offending files under /home were only 1.5M so didn’t really register in the du output
Thanks for the excellent tutorials - you have gone to a lot of trouble to write everything out so clearly in so much detail - nice.
They inspired me to tidy up my fstab and refresh my mind about all those tricky mount options.
One issue came up - I assigned the ssd option to /home which cause boot to stall with the message - unrecognized option ssd - home not mounted … not sure why that would happen … still investigating that one
I agree - I’ve been searching around for any uses of ssd as an option
Strangely, in the same boot that /home would not mount, / mounted fine and both had the ssd option
Think I’ll remove that option
It is a whole new topic but the intricacies of the various mount options is probably poorly understood by many …
MOUNT OPTIONS
BTRFS SPECIFIC MOUNT OPTIONS
This section describes mount options specific to BTRFS. For the generic mount options please refer to mount(8) manual page. The options are sorted alphabetically (discarding the no prefix).
[...]
ssd, ssd_spread, nossd, nossd_spread
(default: SSD autodetected)
Options to control SSD allocation schemes. By default, BTRFS will enable or disable SSD optimizations depending on status of a device with respect to rotational or non-rotational type. This is
determined by the contents of /sys/block/DEV/queue/rotational). If it is 0, the ssd option is turned on. The option nossd will disable the autodetection.