I'm running out of space very fast

It took me at least five years to get to 17GB of disk usage with Linux.
I installed FreeBSD four days ago and it already uses 12GB.

Maybe I'm doing something wrong?

There seem to be some kind of caches for pkg and ports. Do I have to keep those? Are they useful in the installation of future packages or ports?
I know that Debian keeps a lot of apt packages that can be safely deleted.
 
Have a look at pkg-clean(8). It can certainly clog up if you install/update a lot of packages.

If you've built a lot of ports you may have lots of work/ directories, make sure you run make clean after building and installing a port. You can also remove all the work directories easily; rm -rf /usr/ports/*/*/work
 
Only install the packages you really need & don't install gnome-desktop, kde-desktop ,cinnamon-desktop.
The size of all your packages is:
Code:
du -hs -Ahs /usr/local
 
Have a look at pkg-clean(8). It can certainly clog up if you install/update a lot of packages.

If you've built a lot of ports you may have lots of work/ directories, make sure you run make clean after building and installing a port. You can also remove all the work directories easily; rm -rf /usr/ports/*/*/work
pkg-clean removed a very meagre 38MB.

rm -rf /usr/ports/*/*/work removed about 600MB.

I still think it's too bloated.

I ran df -h and can account for 12GB. The whole disk has 16GB. Where have the other 4GB gone?
 

Attachments

  • space.png
    space.png
    132.5 KB · Views: 133
Are you using ZFS for your root? If so do you have a lot of boot environments? Are you building from ports? What kind of applications/packages do you have involved?
 
Please don't post pictures of text. Just copy/paste it, preferably in a [code]...[/code] block.

I still think it's too bloated.
The whole disk has 16GB.
It all depends on what else, besides the OS itself, you have installed. For a full KDE desktop with all the bells and whistles, that space probably isn't even enough.

I ran df -h and can account for 12GB.
Ok, your naming convention and disk layout is not exactly standard, can you tell us how you got to that number?

Where have the other 4GB gone?
What 'other' 4 GB? You accounted for the 12 that's in use, there's 4 free. That makes a total of 16. The size of the disk.
 
Are you using ZFS for your root? If so do you have a lot of boot environments? Are you building from ports? What kind of applications/packages do you have involved?
Yes, it's ZFS.

I don't know what a boot environment is, so I guess I only have one.

I have built a few ports, but I ran rm -rf /usr/ports/*/*/work.

Your last question is confusing. I don't know how to answer it.

Please don't post pictures of text. Just copy/paste it, preferably in a [code]...[/code] block.

It all depends on what else, besides the OS itself, you have installed. For a full KDE desktop with all the bells and whistles, that space probably isn't even enough.

I only have Openbox. The only large thing I have is Wine, I can see it's taking 2.1GB.

Here is my df -h again in text form.

Code:
root@fsd1:/usr/home # df -h
Filesystem        Size    Used   Avail Capacity  Mounted on
a/ROOT/default    8.9G    4.7G    4.2G    53%    /
devfs             1.0K    1.0K      0B   100%    /dev
procfs            4.0K    4.0K      0B   100%    /proc
a                 4.2G     96K    4.2G     0%    /a
a/tmp             4.2G     52M    4.2G     1%    /tmp
a/usr/home        6.9G    2.8G    4.2G    40%    /usr/home
a/usr/ports       5.7G    1.5G    4.2G    27%    /usr/ports
a/usr/src         4.2G     96K    4.2G     0%    /usr/src
a/var/audit       4.2G     96K    4.2G     0%    /var/audit
a/var/crash       4.2G     96K    4.2G     0%    /var/crash
a/var/log         4.2G    356K    4.2G     0%    /var/log
a/var/mail        4.2G    124K    4.2G     0%    /var/mail
a/var/tmp         4.2G    100K    4.2G     0%    /var/tmp
linprocfs         4.0K    4.0K      0B   100%    /compat/linux/proc
linsysfs          4.0K    4.0K      0B   100%    /compat/linux/sys
devfs             1.0K    1.0K      0B   100%    /compat/linux/dev
fdescfs           1.0K    1.0K      0B   100%    /compat/linux/dev/fd
tmpfs             1.1G    4.0K    1.1G     0%    /compat/linux/dev/shm
devfs             1.0K    1.0K      0B   100%    /compat/ubuntu/dev
tmpfs             1.0G    4.0K    1.0G     0%    /compat/ubuntu/dev/shm
fdescfs           1.0K    1.0K      0B   100%    /compat/ubuntu/dev/fd
linprocfs         4.0K    4.0K      0B   100%    /compat/ubuntu/proc
linsysfs          4.0K    4.0K      0B   100%    /compat/ubuntu/sys
/tmp              4.2G     52M    4.2G     1%    /compat/ubuntu/tmp
/usr/home         6.9G    2.8G    4.2G    40%    /compat/ubuntu/home
 
I do not see 12G here. Some things come up twice like /home.
Or is that copies in a/*?
Anyhow look like a weird setup.
 
Well, a/usr/home seems to be /compat/ubuntu/home and then we have /tmp being /compat/ubuntu/tmp so yeah, what exactly are you showing and how did you get here?
 
If it's wrong then it's wrong.
No, it's not wrong. We're just trying to figure out how things are configured. Those are nullfs(5) mounted filesystems. In other words, they refer to other directories in the filesystem. The space it occupies is the same as the original directory, you might be counted those twice.

/usr/home and /compat/ubuntu/home are the same 2.8 GB on disk, it's not 5.6 GB (both added together).
 
Here is my math:

a/ROOT/default 4.7G
a/tmp 52M
a/usr/home 2.8G
a/usr/ports 1.5G

4.7 + 2.8 + 1.5 = 9GB
plus 52MB
and all the others are so small I'm not even counting them.

So yeah, I guess I counted something twice. It's not even 12GB, it's just 9GB.

I also have 1GB of swap, not shown in df -h.
(How do I check my swap by the way? I sorely miss cfdisk)

The disk has 16GB. Minus 10GB, I should have 6GB free.

df -h says I have 4.2G free. Something is using 1.8GB.

My hunch now is something related to ZFS. An ext4 default installation reserves up some 5% to 10% to journaling, it's very wasteful. I always set it to 1% and never had a problem. In fact, I use btrfs now but I'm sure I did something similar. I'm very stingy with my disk space. But I didn't make any such choice with ZFS. I just let is use all its defaults. So maybe ZFS is eating up the remaining 1.8GB for some reason I'm not aware of. I'm a total newbie with the ZFS.
 
Does FreeBSD have something analogous to Debian's dpkg --get-selections so I can get a list of all the packages and ports I have installed? I'm pretty sure I don't have enough of them to justify 4.7GB in a/ROOT/default.
 
The command zfs list -o space will show you a more complete picture of disk space usage by your zfs pool. This will include unmounted file systems, snapshots and zvols.
 
Responding to the stated topic/title of this thread, 16GB is not enough even for a phone or an SBC (Single Board Computer) these days.
I have built a few ports, but I ran rm -rf /usr/ports/*/*/work.
Instead of doing that, you can just run make clean, it will do the exact same thing.

/usr/ports/distfiles/ is another place to look for large ports tarballs. After install, those tarballs can be safely removed, as they are not necessary for running the program. If you stick with ports (as opposed to pkg, which I strongly recommend for flexibility), then it's in your best interests to keep those tarballs around to avoid re-downloading them on demand.

I only have Openbox. The only large thing I have is Wine, I can see it's taking 2.1GB.
Why do you even have Wine? By itself, it's pointless. And, it looks like you don't even have enough room to install any of the goodies that take advantage of Wine...

I strongly recommend a 128GB SSD, those can be had for around $25 these days.
 
Does FreeBSD have something analogous to Debian's dpkg --get-selections so I can get a list of all the packages and ports I have installed? I'm pretty sure I don't have enough of them to justify 4.7GB in a/ROOT/default.
yeah, FreeBSD equivalent is pkg info. You can read pkg(8) manpage and figure out why.
 
Responding to the stated topic/title of this thread, 16GB is not enough even for a phone or an SBC (Single Board Computer) these days.
Not true on Linux. I ran Debian with 10GB on the / partition for many years, including lots of additional software.

Instead of doing that, you can just run make clean, it will do the exact same thing.
I did that and I saw the output of a critter going into each directory individually. Considering the humongous size of the /usr/ports directory, I figured it would take a few weeks to finish so I killed it. The 'rm' method seems a lot faster.

/usr/ports/distfiles/ is another place to look for large ports tarballs.
That is good info. I just shed another 700MB.

Why do you even have Wine? By itself, it's pointless. And, it looks like you don't even have enough room to install any of the goodies that take advantage of Wine...
This is a virtual machine installation for me to explore FreeBSD as much as I can and I decide if it's good enough for me to go to the bare metal. It's just dating. If I decide to marry, we will move to a much bigger house with lots of bedrooms and bathrooms.
 
What does the following command give you ?
bectl list

The freebsd-update(8) utilities does by default a snapshot before upgrading the base system since 13.1-RELEASE if I recall, that would explain the missing spaces if you did not do snapshot manually of configured with a tool.
 
So, you obviously build software from source and then you're wondering it takes some extra space? (no, 16GiB isn't a lot nowadays...)

As already pointed out, for building software, you need the upstream sources (stored in /usr/ports/distfiles) and the work directories to actually carry out the build (these are cleaned with make clean in the ports' directory). And, if you build directly on the machine, you will end up having packages installed that were only needed to build other packages (build-dependencies). I'd assume pkg autoremove should remove them, never tried because I only ever build with poudriere to create a binary repository.

All in all, if you want to compare installed sizes, it makes no sense using one system with binary packages only and the other with software built locally on the machine. Just use pkg with official package repositories only to do that comparison (and don't install /usr/ports and /usr/src).

Chances are Debian with the same set of software installed will still be somewhat smaller, that's because they're doing things FreeBSD normally doesn't do: Extensively modify upstream software and split it into multiple packages. This saves some space of course if you only need part of the whole upstream package. But FreeBSD normally tries to deliver software as close to upstream as possible.

edit:
I did that and I saw the output of a critter going into each directory individually. Considering the humongous size of the /usr/ports directory, I figured it would take a few weeks to finish so I killed it. The 'rm' method seems a lot faster.
It's also wrong. Although work is the default name for the workdir, it can be overridden. It's unlikely many ports would do that, but there's a slight chance to miss something when just removing everything named "work".

Building in-tree is supported but cumbersome, I'd more or less call it a historic thing. If you do so, always do make clean instantly to avoid cluttering up your ports tree. For serious building of ports (IF you really need that because you want custom build options), have a look at poudriere.
 
What does the following command give you ?
bectl list

Code:
root@fsd1:~ # bectl list
BE            Active Mountpoint Space Created
230218-154642 -      -          768M  2023-02-18 15:46
default       NR     /          5.52G 2023-02-17 07:49

I don't know how to read that. What does it mean?
 
So, you obviously build software from source and then you're wondering it takes some extra space? (no, 16GiB isn't a lot nowadays...)

Just use pkg with official package repositories only to do that comparison (and don't install /usr/ports and /usr/src).
I seriously dislike the ports system, but there is a lot that is not available as pkg, only as port. It's not like I have a choice.
 
[I did that and I saw the output of a critter going into each directory individually. Considering the humongous size of the /usr/ports directory, I figured it would take a few weeks to finish so I killed it. The 'rm' method seems a lot faster.
If you add the following to /etc/make.conf

WRKDIRPREFIX= /scratch/ports_base (for example)

then all "work" directories will be created under /scratch/ports_base

(e.g. /scratch/ports_base/usr/ports/www/w3m/work )

You can then tidy that up then with a simple rm -r /scratch/ports_base (Of course, if you use "make.... clean" when building ports, this shouldn't even be necessary!)

This is a virtual machine installation for me to explore FreeBSD as much as I can and I decide if it's good enough for me to go to the bare metal. It's just dating. If I decide to marry, we will move to a much bigger house with lots of bedrooms and bathrooms.

:) Well one thing, she'll always be faithful, though it can't be guaranteed that she'll not gain weight in future!
 
Back
Top