Re: df(1) shows strange Avail and Capacity info

2015-05-20 Thread Alex Greif
thanks for the clarifictions.
I will read the FAQs more throroughly in future.

Alex.



On Tue, May 19, 2015 at 02:31:34PM -0400, Josh Grosse wrote:

 I believe FAQ 14.14 may clarify df(1) reporting.  Here's a link for
 convenience: http://www.openbsd.org/faq/faq14.html#NegSpace



Re: df(1) shows strange Avail and Capacity info

2015-05-19 Thread Josh Grosse

On 2015-05-19 14:25, Alex Greif wrote:

Hi,

I experienced a strange output of df(1) for the root partition.
The Size is greater than Used but Avail and Capacity are miscalculated

/root/snaps # df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/sd0a  494M488M  -18.4M   104%/
/dev/sd0k 27.6G4.7G   21.5G18%/home
/dev/sd0d  492M   86.0K467M 0%/tmp
/dev/sd0f  2.0G367M1.5G19%/usr
/dev/sd0g 1001M200M751M21%/usr/X11R6
/dev/sd0h  2.0G215M1.7G11%/usr/local
/dev/sd0j 1001M2.0K951M 0%/usr/obj
/dev/sd0i 1001M2.0K951M 0%/usr/src
/dev/sd0e  2.9G9.9M2.8G 0%/var


I believe FAQ 14.14 may clarify df(1) reporting.  Here's a link for
convenience: http://www.openbsd.org/faq/faq14.html#NegSpace



Re: df(1) shows strange Avail and Capacity info

2015-05-19 Thread Theo de Raadt
 I experienced a strange output of df(1) for the root partition.
 The Size is greater than Used but Avail and Capacity are miscalculated

That is an incorrect assessment.

There is spare space in the filesystem, only available for root, and
this is how it is handled.



df(1) shows strange Avail and Capacity info

2015-05-19 Thread Alex Greif
Hi,

I experienced a strange output of df(1) for the root partition.
The Size is greater than Used but Avail and Capacity are miscalculated

/root/snaps # df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/sd0a  494M488M  -18.4M   104%/
/dev/sd0k 27.6G4.7G   21.5G18%/home
/dev/sd0d  492M   86.0K467M 0%/tmp
/dev/sd0f  2.0G367M1.5G19%/usr
/dev/sd0g 1001M200M751M21%/usr/X11R6
/dev/sd0h  2.0G215M1.7G11%/usr/local
/dev/sd0j 1001M2.0K951M 0%/usr/obj
/dev/sd0i 1001M2.0K951M 0%/usr/src
/dev/sd0e  2.9G9.9M2.8G 0%/var

I am running a snapshot from 18. Mai 2015 on amd64 in a VM.
Please tell me if more log or other output is needed.

Thanks,
Alex.

dmesg output:

OpenBSD 5.7-current (GENERIC) #926: Mon May 18 09:52:25 MDT 2015
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
real mem = 520085504 (495MB)
avail mem = 500588544 (477MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xfd9c0 (10 entries)
bios0: vendor Bochs version Bochs date 01/01/2007
bios0: Bochs Bochs
acpi0 at bios0: rev 0
acpi0: sleep states S3 S4 S5
acpi0: tables DSDT FACP SSDT APIC HPET SSDT
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz, 2394.22 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AES,HV,NXE,PAGE1GB,LONG,LAHF
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu0: ITLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
cpu0: DTLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 1000MHz
ioapic0 at mainbus0: apid 1 pa 0xfec0, version 11, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 1
acpihpet0 at acpi0: 1 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel 82441FX rev 0x02
pcib0 at pci0 dev 1 function 0 Intel 82371SB ISA rev 0x00
pciide0 at pci0 dev 1 function 1 Intel 82371SB IDE rev 0x00: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
pciide0: channel 0 disabled (no drives)
atapiscsi0 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: QEMU, QEMU DVD-ROM, 1.1. ATAPI 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
uhci0 at pci0 dev 1 function 2 Intel 82371SB USB rev 0x01: apic 1 int 11
piixpm0 at pci0 dev 1 function 3 Intel 82371AB Power rev 0x03: apic 1 int 10
iic0 at piixpm0
iic0: addr 0x18 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
iic0: addr 0x1a 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
iic0: addr 0x29 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
iic0: addr 0x2b 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
iic0: addr 0x4c 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
iic0: addr 0x4e 00=00 01=00 02=00 03=00 04=00 05=00 06=00 07=00 08=00 words 
00= 01= 02= 03= 04= 05= 06= 07=
vga1 at pci0 dev 2 function 0 Cirrus Logic CL-GD5446 rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
virtio0 at pci0 dev 3 function 0 Qumranet Virtio Network rev 0x00: Virtio 
Network Device
vio0 at virtio0: address 52:54:c1:10:f2:79
virtio0: apic 1 int 11
virtio1 at pci0 dev 4 function 0 Qumranet Virtio Storage rev 0x00: Virtio 
Block Device
vioblk0 at virtio1
scsibus2 at vioblk0: 2 targets
sd0 at scsibus2 targ 0 lun 0: VirtIO, Block Device,  SCSI3 0/direct fixed
sd0: 40960MB, 512 bytes/sector, 83886080 sectors
virtio1: apic 1 int 11
virtio2 at pci0 dev 5 function 0 Qumranet Virtio Memory rev 0x00: Virtio 
Memory Balloon Device
viomb0 at virtio2
virtio2: apic 1 int 10
isa0 at pcib0
isadma0 at isa0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: density unknown
fd1 at fdc0 drive 1: density unknown
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot): using irq 1
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot): using irq 12
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
usb0 at uhci0: USB 

Re: df(1) shows strange Avail and Capacity info

2015-05-19 Thread John Merriam
On Tue, 19 May 2015, Theo de Raadt wrote:

  I experienced a strange output of df(1) for the root partition.
  The Size is greater than Used but Avail and Capacity are miscalculated
 
 That is an incorrect assessment.
 
 There is spare space in the filesystem, only available for root, and
 this is how it is handled.
 

Yes, df is functioning correctly.  It looks like you have 5% of the space 
on your / partition reserved for the root user.  You have less than 5% of 
the space on / available.  When you have less than the reserved amount of 
space available on a partition df will show greater than 100% capacity 
used and a negative amount of space available.  It's sort of a warning.  
If any process that is not owned by root tries to write something to your 
/ partition, it will fail.  You can see the percentage of reserved space 
on your / partition with:

tunefs -N /

You can also see a description of this feature in the notes for the -m 
option in the tunefs(8) man page.

-- 

John Merriam