|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
/dev/sd0a is full?
Hi,
File system mounted on /dev/sd0a on / result as full. Code:
Filesystem Size Used Avail Capacity Mounted on /dev/sd0a 600M 600M -29.9M 105% / Any idea on how to free space and why it happened? Thanks. Last edited by J65nko; 9th September 2022 at 07:05 PM. Reason: Added [code] and [/code] tags |
|
|||
To figure it out we would have to know the partition layout. What is the output of
$ df -h and $ ls -l / | grep '^d' ?On an old decommissioned Alix system : Code:
# df -h Filesystem Size Used Avail Capacity Mounted on /dev/wd0a 873M 72.4M 757M 9% / /dev/wd0e 376M 86.9M 271M 24% /home /dev/wd0d 2.2G 185M 1.9G 9% /usr mfs:19936 37.7M 3.3M 32.5M 9% /var A listing of the root partition: Code:
# ls -l / ls -l / total 35142 -rw-r--r-- 1 root wheel 578 Dec 12 2015 .cshrc -rw-r--r-- 1 root wheel 522 Dec 13 2015 .profile drwxr-xr-x 3 root wheel 512 Jan 11 2016 Template.mfs drwxr-xr-x 2 root wheel 512 Dec 12 2015 altroot drwxr-xr-x 2 root wheel 1024 Dec 12 2015 bin -rw-r--r-- 1 root wheel 71836 Dec 13 2015 boot -rw-r--r-- 1 root wheel 10752916 Dec 13 2015 bsd -rw-r--r-- 1 root wheel 7052251 Dec 13 2015 bsd.rd drwxr-xr-x 3 root wheel 19456 Aug 18 08:41 dev drwxr-xr-x 20 root wheel 2048 Aug 21 15:02 etc drwxr-xr-x 4 root wheel 512 Jun 2 2021 home -rwxrw---- 1 root wheel 251 Dec 13 2015 install.site drwxr-xr-x 2 root wheel 512 Dec 12 2015 mnt -rwxrw---- 1 root wheel 10640 Dec 13 2015 postinstall_alix drwx------ 4 root wheel 2048 Aug 21 12:25 root drwxr-xr-x 2 root wheel 1536 Dec 12 2015 sbin drwxrwxrwt 3 root wheel 512 Aug 25 09:14 tmp drwxr-xr-x 15 root wheel 512 Dec 13 2015 usr drwxr-xr-x 20 root wheel 512 Dec 13 2015 var To see only the files that could be the culprits for filling up the root directory: Code:
# ls -l / | grep -v '^d' total 35142 -rw-r--r-- 1 root wheel 578 Dec 12 2015 .cshrc -rw-r--r-- 1 root wheel 522 Dec 13 2015 .profile -rw-r--r-- 1 root wheel 71836 Dec 13 2015 boot -rw-r--r-- 1 root wheel 10752916 Dec 13 2015 bsd -rw-r--r-- 1 root wheel 7052251 Dec 13 2015 bsd.rd -rwxrw---- 1 root wheel 251 Dec 13 2015 install.site -rwxrw---- 1 root wheel 10640 Dec 13 2015 postinstall_alix Code:
# ls -l / | grep '^d' drwxr-xr-x 3 root wheel 512 Jan 11 2016 Template.mfs drwxr-xr-x 2 root wheel 512 Dec 12 2015 altroot drwxr-xr-x 2 root wheel 1024 Dec 12 2015 bin drwxr-xr-x 3 root wheel 19456 Aug 18 08:41 dev drwxr-xr-x 20 root wheel 2048 Aug 21 15:02 etc drwxr-xr-x 4 root wheel 512 Jun 2 2021 home drwxr-xr-x 2 root wheel 512 Dec 12 2015 mnt drwx------ 4 root wheel 2048 Aug 21 12:25 root drwxr-xr-x 2 root wheel 1536 Dec 12 2015 sbin drwxrwxrwt 3 root wheel 512 Aug 25 09:14 tmp drwxr-xr-x 15 root wheel 512 Dec 13 2015 usr drwxr-xr-x 20 root wheel 512 Dec 13 2015 var # df -h output. Because they are mounted on "/" they show up in this listing, but could never be the cause of filling up '/". But a big file in all the other ones could be the cause.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump Last edited by J65nko; 25th August 2022 at 07:57 AM. |
|
|||
Knowing the directories where the big ones could be hanging out, we can use the following command to sort sub-directories by size. For /etc/ this would be:
Code:
# du /etc | sort -rnk1 | less 9056 /etc 4624 /etc/firmware 636 /etc/ssl 292 /etc/rc.d 172 /etc/examples 148 /etc/mail 80 /etc/mtree 72 /etc/ldap 64 /etc/signify [snip] 4 /etc/iked/ca 4 /etc/hotplug 4 /etc/authpf See du(1) and sort(1) The options for sort:
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump Last edited by J65nko; 25th August 2022 at 08:18 AM. |
|
|||
Hi,
thanks for Your reply. I tried with : Code:
BSD_Network_test# ls -l / | grep -v '^d' total 143944 -rw-r--r-- 1 root wheel 578 Apr 12 08:45 .cshrc -rw-r--r-- 1 root wheel 468 Apr 12 08:45 .profile -rw-r--r-- 1 root wheel 88136 Apr 21 19:45 boot -rwx------ 1 root wheel 22992197 Aug 25 13:50 bsd -rwx------ 1 root wheel 22980141 Aug 25 13:27 bsd.booted -rw------- 1 root wheel 4606368 Apr 21 19:43 bsd.rd -rw------- 1 root wheel 22876084 Apr 21 19:43 bsd.sp lrwxrwx--- 1 root wheel 11 Apr 12 08:45 sys -> usr/src/sys But I can see all these bsd.* which are taking a lot of space inside the directory Any idea about them? Last edited by J65nko; 9th September 2022 at 06:56 PM. Reason: Added [code] and [/code] tags |
|
|||
Quote:
Code:
# awk -f file-size.awk root-files .cshrc : 578 .profile : 468 boot : 88136 bsd : 22992197 bsd.booted : 22980141 bsd.rd : 4606368 bsd.sp : 22876084 sys : 11 ==================== : ==================== Total bytes : 73543983 $ echo 'scale = 2; 73543983 / 1024^2' | bc 70.13 You have to run # ls -l / | grep '^d' to see the size of the sub-directories in the "/" directory.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
Quote:
Code:
BSD_Network_test# find /dev -type f -ls 39683 24 -r-xr-xr-x 1 root wheel 12142 Apr 12 08:45 /dev/MAKEDEV 40994 0 -rw------- 1 root wheel 0 Aug 25 13:49 /dev/slaacd.lock 40996 0 -rw------- 1 root wheel 0 Aug 25 13:49 /dev/dhcpleased.lock 40998 0 -rw------- 1 root wheel 0 Aug 25 13:49 /dev/resolvd.lock |
|
|||
Quote:
Code:
BSD_Network_test# ls -lah / | grep '^d' drwxr-xr-x 13 root wheel 512B Aug 25 13:50 . drwxr-xr-x 13 root wheel 512B Aug 25 13:50 .. drwxr-xr-x 2 root wheel 512B Apr 12 08:45 altroot drwxr-xr-x 2 root wheel 1.0K Apr 12 08:46 bin drwxr-xr-x 6 root wheel 19.0K Aug 25 13:49 dev drwxr-xr-x 27 root wheel 2.0K Jun 24 01:30 etc drwxr-xr-x 3 root wheel 512B Apr 21 19:45 home drwxr-xr-x 2 root wheel 512B Apr 12 08:45 mnt drwx------ 7 root wheel 1.0K Jul 18 13:41 root drwxr-xr-x 2 root wheel 1.5K Apr 12 08:46 sbin drwxrwxrwt 6 root wheel 512B Sep 15 01:31 tmp drwxr-xr-x 17 root wheel 512B May 6 16:48 usr drwxr-xr-x 24 root wheel 512B May 4 16:52 var BSD_Network_test# df -h Filesystem Size Used Avail Capacity Mounted on /dev/sd0a 600M 600M -29.9M 105% / /dev/sd0k 3.7G 464M 3.0G 13% /home /dev/sd0d 848M 10.0K 806M 0% /tmp /dev/sd0f 2.3G 1.8G 386M 83% /usr /dev/sd0g 643M 299M 312M 49% /usr/X11R6 /dev/sd0h 2.3G 453M 1.8G 20% /usr/local /dev/sd0j 5.2G 2.0K 4.9G 0% /usr/obj /dev/sd0i 1.6G 2.0K 1.5G 0% /usr/src /dev/sd0e 1.2G 165M 1.0G 14% /var |
|
||||
The ls(1) command shows the size of the directories, but not the consumption of storage by the files within. Try something like
# du -chxd 1 / to get the total size consumed by the files within, and then you may be able to find the directory structure to investigate further. I'm recommending the du(1) disk utilization utility to be used with -c to show the total at the end of the report, with -h to show human-readable output, with -x to only inspect the single root filesystem, and with -d 1 to only go one directory deep. For example, on this laptop, I am consuming 168 MB in the root filesystem, with about 42 MB in /etc configuration files. If there was a directory that I wanted to dig into further, I would run du(1) in that directory, looking for the cause of the problem.Code:
# du -chxd 1 / 2.0K /altroot 41.9M /etc 4.0K /mnt 15.7M /sbin 2.0K /usr 5.9M /bin 40.0K /dev 4.0K /home 12.3M /root 2.0K /tmp 2.0K /var 6.0K /lost+found 2.0K /.cache 168M / 168M total |
|
|||
This are your different file systems:
Code:
BSD_Network_test# df -h Filesystem Size Used Avail Capacity Mounted on /dev/sd0a 600M 600M -29.9M 105% / /dev/sd0k 3.7G 464M 3.0G 13% /home /dev/sd0d 848M 10.0K 806M 0% /tmp /dev/sd0f 2.3G 1.8G 386M 83% /usr /dev/sd0g 643M 299M 312M 49% /usr/X11R6 /dev/sd0h 2.3G 453M 1.8G 20% /usr/local /dev/sd0j 5.2G 2.0K 4.9G 0% /usr/obj /dev/sd0i 1.6G 2.0K 1.5G 0% /usr/src /dev/sd0e 1.2G 165M 1.0G 14% /var Code:
BSD_Network_test# ls -lah / | grep '^d' drwxr-xr-x 13 root wheel 512B Aug 25 13:50 . drwxr-xr-x 13 root wheel 512B Aug 25 13:50 .. drwxr-xr-x 2 root wheel 512B Apr 12 08:45 altroot drwxr-xr-x 2 root wheel 1.0K Apr 12 08:46 bin drwxr-xr-x 6 root wheel 19.0K Aug 25 13:49 dev drwxr-xr-x 27 root wheel 2.0K Jun 24 01:30 etc drwxr-xr-x 3 root wheel 512B Apr 21 19:45 home drwxr-xr-x 2 root wheel 512B Apr 12 08:45 mnt drwx------ 7 root wheel 1.0K Jul 18 13:41 root drwxr-xr-x 2 root wheel 1.5K Apr 12 08:46 sbin drwxrwxrwt 6 root wheel 512B Sep 15 01:31 tmp drwxr-xr-x 17 root wheel 512B May 6 16:48 usr drwxr-xr-x 24 root wheel 512B May 4 16:52 var Code:
BSD_Network_test# ls -lah / | grep '^d' drwxr-xr-x 2 root wheel 512B Apr 12 08:45 altroot drwxr-xr-x 2 root wheel 1.0K Apr 12 08:46 bin drwxr-xr-x 6 root wheel 19.0K Aug 25 13:49 dev drwxr-xr-x 27 root wheel 2.0K Jun 24 01:30 etc drwxr-xr-x 2 root wheel 512B Apr 12 08:45 mnt drwx------ 7 root wheel 1.0K Jul 18 13:41 root drwxr-xr-x 2 root wheel 1.5K Apr 12 08:46 sbin you do : Code:
# du /altroot/* | sort -rnk1 | less # du /bin/* | sort -rnk1 | less [snip] # du /root/* | sort -rnk1 | less # du /sbin/* | sort -rnk1 | less
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump Last edited by J65nko; 15th September 2022 at 03:34 AM. |
|
|||
Quote:
Yup, this did the trick. I had two huge files inside the /root dir (TCP dump captures) Thanks! |
|
|||
[solved]
[solved]
|
Tags |
du, file system full, filesystem free space, filesystem full |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
/ is full | leave0 | OpenBSD General | 5 | 4th August 2022 12:32 PM |
filesystem full? | amandus | FreeBSD General | 11 | 11th June 2013 12:10 PM |
/usr became full while updating via cvs | IronForge | OpenBSD Installation and Upgrading | 3 | 6th January 2010 01:08 PM |
/usr is full (OpenBSD 4.5 current) | valorisa | OpenBSD Packages and Ports | 7 | 10th June 2009 01:28 PM |
/ is full, can't installkernel | thevirtuesofxen | FreeBSD General | 4 | 18th August 2008 06:33 AM |