Files in /

Polytropon freebsd at edvax.de
Tue Dec 4 19:21:04 UTC 2018


On Tue, 04 Dec 2018 12:25:23 -0600, Paul Schmehl wrote:
> --On December 4, 2018 at 9:43:06 AM +0100 Michael Schuster 
> <michaelsprivate at gmail.com> wrote:
> 
> >
> >
> > Paul,
> >
> >
> > first, you show 'df' output of "/", whereas later on you only work with
> > "/root" - there's probably other stuff in "/" that's not in "/root" -
> > /etc comes to mind, /sbin ... 
> >
> 
> That's helpful. When I run ls on / I get this:
> 
>  ls / .cshrc	 COPYRIGHT cdrom dist home media rescue sys	 var .profile bin 
> compat entropy lib mnt root tmp .snap boot dev etc libexec proc sbin usr

Except for formatting, this looks completely valid.



> Since I have separate partitions for /var, /tmp, and /usr, that would mean 
> everything not included under those would be part of the / partition?

Correct. You can easily check with the command

	# mount

which directories serve as a mountpoint for partitions.
Everything else is on /.



> I'm not sure I understand entropy.

This file is part of the system's random number generator.
See "man 4 random" as well as /etc/rc.d/initrandom and
/etc/rc.d/random.



> Using file, I can see that /home and 
> /compat are symlinks, [...]

That's usually true, but _can_ be different depending
on installation. For example, on my home system, /home
is an (initially empty) directory serving as a mountpoint
for a second disk that contains the home directories.

In your case, /home would also be on the /usr partition.



> [...] but what is entropy? File says it's data.

Correct. This file is being maintained by system scripts
as mentioned above.



> If I use find to get the directories directly under root, it returns this:
> 
> # find / -type d -maxdepth 1
> /
> /.snap
> /dev
> /tmp
> /usr
> /var
> /etc
> /cdrom
> /dist
> /bin
> /boot
> /lib
> /libexec
> /media
> /mnt
> /proc
> /rescue
> /root
> /sbin
> 
> So, I can eliminate /tmp, /usr, and /var, and the rest is in the root 
> partition, correct?

If they aren't mounted somewhere else (which would be the
typical state, and can be verified with the "mount" or the
"df" command), that's correct.

You can use the following sh one-liner to check which
directories at / serve as a mountpoint:

	$ for DIR in `find / -type d -maxdepth 1`; do mount -v | grep " on ${DIR} " | cut -d '(' -f 1; done

YOu should then only see the directories which are currently
used as mountpoints.



> It seems the most disk consumption is in /boot/
> 
> # du -h /boot/
>  28K	/boot/defaults
> 2.0K	/boot/firmware
> 497M	/boot/kernel
> 2.0K	/boot/modules
> 2.0K	/boot/zfs
> 2.0K	/boot/dtb
>  91M	/boot/kernel.old
> 591M	/boot/
> 
> I can remove /boot/kernel.old, right? (I'm not sure I will. Just asking.)

Basically yes, but then you won't be able to boot kernel.old.

The kernel and the modules have grown in size over the years.
The times where a 512 MB (or 256 MB) / partition would be
sufficiently big are long gone. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list