Re: USB repeater cable on Soekris net5501

2013-03-03 Thread Ingo Feinerer
On Sat, Mar 02, 2013 at 03:26:55PM -0700, Theo de Raadt wrote:
 Is your cable a usb2.0 only cable, or a usb1.1 only cable or some
 combination that won't work?

The product description of the USB repeater cable claims:

- Compatible with USB specification revision 2.0 and 1.1
- Supports USB low speed (1.5Mbps), full speed (12Mbps) and high speed 
(480Mbps)
- USB connection supports plug and play

Thanks.

Best regards,
Ingo



Re: pppoe repeated disconnects

2013-03-03 Thread Pim van Pelt
Hoi once more,

Closure on this.

2013/2/24 Stuart Henderson s...@spacehopper.org:
 On 2013-02-24, Pim van Pelt p...@ipng.nl wrote:
 .. , or the DSL has untrained

 It does seem like the line could well be dropping out then.
.. and that was it. I have since replaced the DSL modem with a
Fritz!Box 7390 and the line has been up for 6 days without pretty much
a single packet dropped. As a bonus, it now trains at 50/10 where it
used to be 30/6 or something significantly weaker. That is sufficient
for me to prove that (a) the OpenBSD pppoe(4) and pppoe(8) setups were
fine, and (b) DSL modem vendors make a difference :)

Thanks Stuart, for helping me think this through, and others on this
list for lurking.

groet,
Pim
-- 
Pim van Pelt p...@ipng.nl
PBVP1-RIPE - http://www.ipng.nl/



scanf(3) return value

2013-03-03 Thread Jan Stary
The following part of the scanf(3) manpage
probably needs to be reworded:

  The value
  .Dv EOF
  is returned if an input failure occurs before any conversion such as an
  end-of-file occurs.

(I won't even attempt it, as I am not sure
what the behaviour actually is.)



Firefox 18 library link error

2013-03-03 Thread James Griffin
Hi

I did a fresh install of the latest snapshot Feb 27. Installed Firefox
18 package. When it loads, I get an error I do not understand:

firefox:/usr/lib/libstdc++.so.55.0: /usr/local/lib/libestdc++.so.14.0 :
WARNING: symbol(_ZN11__gnu_debug17_S_debug_messagesE) size mismatch,
relink your program


Could someone explain what this means and help me to fix it. Firefox
does appear to function normally.

I'm using the i386 platform; was previously using the amd64 platform on
the same machine and did not get this error message then - not that i'm
assuming it's related.

dmesg below:


OpenBSD 5.3 (GENERIC.MP) #53: Fri Mar  1 09:34:37 MST 2013
dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Pentium(R) Dual-Core CPU E5500 @ 2.80GHz (GenuineIntel 686-class) 2.80 
GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,XSAVE,LAHF,PERF
real mem  = 1992413184 (1900MB)
avail mem = 1948856320 (1858MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 06/09/10, BIOS32 rev. 0 @ 0xfdbba, SMBIOS 
rev. 2.5 @ 0xef3f0 (64 entries)
bios0: vendor LENOVO version 5CKT63AUS date 06/09/2010
bios0: LENOVO 4099A2G
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT TCPA FACP _MAR SLIC MCFG HPET APIC BOOT ASF! SSDT SSDT SSDT 
SSDT SSDT SSDT SSDT SSDT SSDT
acpi0: wakeup devices PEG_(S5) LAN_(S5) USB4(S3) USB5(S3) USB7(S3) ESB2(S3) 
EXP1(S4) EXP2(S4) EXP3(S4) EXP4(S4) EXP5(S4) EXP6(S4) USB1(S3) USB2(S3) 
USB3(S3) USB6(S3) ESB1(S3) PCIB(S5) COM1(S4) COM2(S4) KBC0(S4) MSE0(S4) PWRB(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0 addr 0xf800, bus 0-16
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 199MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Pentium(R) Dual-Core CPU E5500 @ 2.80GHz (GenuineIntel 686-class) 2.80 
GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,XSAVE,LAHF,PERF
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEG_)
acpiprt2 at acpi0: bus -1 (EXP1)
acpiprt3 at acpi0: bus -1 (EXP2)
acpiprt4 at acpi0: bus -1 (EXP3)
acpiprt5 at acpi0: bus -1 (EXP4)
acpiprt6 at acpi0: bus -1 (EXP5)
acpiprt7 at acpi0: bus -1 (EXP6)
acpiprt8 at acpi0: bus 17 (PCIB)
acpicpu0 at acpi0: C2, C1, PSS
acpicpu1 at acpi0: C2, C1, PSS
acpibtn0 at acpi0: PWRB
acpivideo0 at acpi0: IGD0
bios0: ROM list: 0xc/0xc600! 0xcc600/0x1000 0xcd600/0x3200!
cpu0: Enhanced SpeedStep 2793 MHz: speeds: 2800, 2400, 2000, 1600, 1200 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 Intel Q45 Host rev 0x03
vga1 at pci0 dev 2 function 0 Intel Q45 Video rev 0x03
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xe000, size 0x1000
inteldrm0 at vga1: apic 2 int 16
drm0 at inteldrm0
Intel Q45 Video rev 0x03 at pci0 dev 2 function 1 not configured
Intel Q45 HECI rev 0x03 at pci0 dev 3 function 0 not configured
pciide0 at pci0 dev 3 function 2 Intel Q45 PT IDER rev 0x03: DMA 
(unsupported), channel 0 wired to native-PCI, channel 1 wired to native-PCI
pciide0: using apic 2 int 18 for native-PCI interrupt
pciide0: channel 0 ignored (not responding; disabled or no drives?)
pciide0: channel 1 ignored (not responding; disabled or no drives?)
Intel Q45 KT rev 0x03 at pci0 dev 3 function 3 not configured
em0 at pci0 dev 25 function 0 Intel ICH10 D BM LM rev 0x02: msi, address 
70:f3:95:08:36:06
uhci0 at pci0 dev 26 function 0 Intel 82801JD USB rev 0x02: apic 2 int 16
uhci1 at pci0 dev 26 function 1 Intel 82801JD USB rev 0x02: apic 2 int 17
uhci2 at pci0 dev 26 function 2 Intel 82801JD USB rev 0x02: apic 2 int 18
ehci0 at pci0 dev 26 function 7 Intel 82801JD USB rev 0x02: apic 2 int 18
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 Intel EHCI root hub rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 Intel 82801JD HD Audio rev 0x02: msi
azalia0: codecs: Analog Devices AD1882
audio0 at azalia0
uhci3 at pci0 dev 29 function 0 Intel 82801JD USB rev 0x02: apic 2 int 16
uhci4 at pci0 dev 29 function 1 Intel 82801JD USB rev 0x02: apic 2 int 17
uhci5 at pci0 dev 29 function 2 Intel 82801JD USB rev 0x02: apic 2 int 18
ehci1 at pci0 dev 29 function 7 Intel 82801JD USB rev 0x02: apic 2 int 16
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 Intel EHCI root hub rev 2.00/1.00 addr 1
ppb0 at pci0 dev 30 function 0 Intel 82801BA Hub-to-PCI rev 0xa2
pci1 at ppb0 bus 17
pcib0 at pci0 dev 31 function 0 Intel 82801JDO LPC rev 0x02
ahci0 

Re: Firefox 18 library link error

2013-03-03 Thread Marc Espie
On Sun, Mar 03, 2013 at 11:58:40AM +, James Griffin wrote:
 Hi
 
 I did a fresh install of the latest snapshot Feb 27. Installed Firefox
 18 package. When it loads, I get an error I do not understand:
 
 firefox:/usr/lib/libstdc++.so.55.0: /usr/local/lib/libestdc++.so.14.0 :
 WARNING: symbol(_ZN11__gnu_debug17_S_debug_messagesE) size mismatch,
 relink your program

That one is totally innocuous. It's just because the debug messages in
those libraries are not exactly the same size, it doesn't really matter.



Re: Firefox 18 library link error

2013-03-03 Thread James Griffin
[- Sun  3.Mar'13 at 13:35:15 +0100  Marc Espie :-]

 On Sun, Mar 03, 2013 at 11:58:40AM +, James Griffin wrote:
  Hi
  
  I did a fresh install of the latest snapshot Feb 27. Installed Firefox
  18 package. When it loads, I get an error I do not understand:
  
  firefox:/usr/lib/libstdc++.so.55.0: /usr/local/lib/libestdc++.so.14.0 :
  WARNING: symbol(_ZN11__gnu_debug17_S_debug_messagesE) size mismatch,
  relink your program
 
 That one is totally innocuous. It's just because the debug messages in
 those libraries are not exactly the same size, it doesn't really matter.

Ok, cheers Mark.



Re: Disk layout: OpenBSD OT

2013-03-03 Thread Alexander Hall

On 03/03/13 00:04, Shoufu Luo wrote:

usually, the inner tracks are fast, as I know


Since the RPM is constant and they can fit more data can on the outer, 
longer, tracks, I believe you are wrong.


Not that it matters, since we don't know which ones we're served.

/Alexander



-Shoufu

Live, Love, Laugh

On Mar 2, 2013, at 14:55, Friedrich Locke friedrich.lo...@gmail.com wrote:


Hi folks,

just wonder in a typical hard drive nowadays (SATA/SAS), the sector 0
is in the inner or outter track ?
Which tracks are faster: the inner ones or the outter ?

Thanks in advance.




Re: Disk layout: OpenBSD OT

2013-03-03 Thread Michał Markowski
2013/3/2 Friedrich Locke friedrich.lo...@gmail.com:
 just wonder in a typical hard drive nowadays (SATA/SAS), the sector 0
 is in the inner or outter track ?
 Which tracks are faster: the inner ones or the outter ?

First track is outer-most, hence faster linear transfer rates at
beginning of disk, e.g.
http://mralpha.s3.amazonaws.com/SAMSUNG-HD501LJ-690G-MrAlpha.png

But it's generalization in terms of modern firmware.

-- 
Michał Markowski



Get total size of all files in directory using unit Bytes?

2013-03-03 Thread f5b
for example

1.
there is only two file in /home/test/
# ls -l /home/test/
total 8
-rw-r--r--  1 root  wheel  2 Mar  3 23:29 a.txt
-rw-r--r--  1 root  wheel  3 Mar  3 23:29 b.txt

So the total size of all files ( a.txt + b.txt ) should be 5 Bytes.
How to get total size ( 5 Bytes ) directly but not the 8 Bytes.


2.
# man du
says,
 -h  Human-readable output.  Use unit suffixes: Byte, Kilobyte,
 Megabyte, Gigabyte, Terabyte, Petabyte, Exabyte in order to
 reduce the number of digits to four or less.

but 
# du -h /home/test
6.0K/home/test

How to let unit suffixes: Byte  display (come out)  but not Kilobyte?

just like 
# du -b /home/test   ( option -b not exist)
5B  /home/test   



Re: Softraid 3TB Problems

2013-03-03 Thread Brandon Tanner
Joel,

Would the fact that my two 3TB drives (ST3000DM001) use 4k sectors be the
reason I wasn't getting it working then?

I will try to zero the drives and start from scratch again, and see if that
works too. I had a feeling that deleting the disklabels with 'z' option
wasn't actually getting things back to the way they were when I first
started out.

Thank you for your input!

-Brandon


On Sat, Mar 2, 2013 at 11:38 PM, Joel Sing j...@sing.id.au wrote:

 On Sun, 3 Mar 2013, Brandon Tanner wrote:
  By the way, does softraid on amd64 support 4096 bytes per sector?

 No. There is a large amount of work required to fix this since everything
 in
 softraid was originally designed around 512-byte blocks. It is somewhere on
 my TODO list, however I do not currently even have the hardware for
 development/testing.
 --

 Reason is not automatic. Those who deny it cannot be conquered by it.
  Do not count on them. Leave them alone. -- Ayn Rand



Re: USB repeater cable on Soekris net5501

2013-03-03 Thread Christian Weisgerber
Ingo Feinerer feine...@logic.at wrote:

 I have a problem with a Digitus USB 2.0 repeater cable in combination with a
 Soekris net5501 running OpenBSD 5.2 (see full dmesg at the very end of this
 mail).

Is this an active device?  Essentially a single-port hub?

 However, the problem occurs when I attach the repeater cable with the UMTS
 stick at its end. The stick is not recognized anymore.

I suspect the net5501's USB port is too weak to power the combination
of repeater and UMTS stick.

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: Softraid 3TB Problems

2013-03-03 Thread Kenneth R Westerback
On Sun, Mar 03, 2013 at 11:15:54AM -0600, Brandon Tanner wrote:
 Joel,
 
 Would the fact that my two 3TB drives (ST3000DM001) use 4k sectors be the
 reason I wasn't getting it working then?

Both of the drives in the dmesg you posted report 512-byte sectors.

 Ken

 
 I will try to zero the drives and start from scratch again, and see if that
 works too. I had a feeling that deleting the disklabels with 'z' option
 wasn't actually getting things back to the way they were when I first
 started out.
 
 Thank you for your input!
 
 -Brandon
 
 
 On Sat, Mar 2, 2013 at 11:38 PM, Joel Sing j...@sing.id.au wrote:
 
  On Sun, 3 Mar 2013, Brandon Tanner wrote:
   By the way, does softraid on amd64 support 4096 bytes per sector?
 
  No. There is a large amount of work required to fix this since everything
  in
  softraid was originally designed around 512-byte blocks. It is somewhere on
  my TODO list, however I do not currently even have the hardware for
  development/testing.
  --
 
  Reason is not automatic. Those who deny it cannot be conquered by it.
   Do not count on them. Leave them alone. -- Ayn Rand



Re: USB repeater cable on Soekris net5501

2013-03-03 Thread Matthias Appel

Am 03.03.2013 18:26, schrieb Christian Weisgerber:

Ingo Feinerer feine...@logic.at wrote:


I have a problem with a Digitus USB 2.0 repeater cable in combination with a
Soekris net5501 running OpenBSD 5.2 (see full dmesg at the very end of this
mail).

Is this an active device?  Essentially a single-port hub?


However, the problem occurs when I attach the repeater cable with the UMTS
stick at its end. The stick is not recognized anymore.

I suspect the net5501's USB port is too weak to power the combination
of repeater and UMTS stick.

It is just an idea...why not choose a UMTS Sick with the possibility to 
attach an external antena?


With a little soldering-foo you will be able to make a decent external 
WLAN antenna.



Even if you cant attach an external antenna, you can disassemble the 
stick and with a little bit sodering knowledge you can solder a coax 
cable in place, where you can attach an external antenna.


Shure, you wont't get approval from Funkraumüberwachung, which is 
responsible for approval of such things in .at, but if the antenna gain 
is not too high, they won't notice at all.


Bot if you choose an antenna with the right gain, it won't make a 
difference if you move the stick, or just the antenna itself.


If you want, I disassebmle my dead USB stick (which is exact your type), 
tho help you with this!



Regards,

Matthias



PS: I would not choose DIGITUS as the vendor of choice...they only sell 
rebadged chinese crap, so I tend to NOT use DIGITUS!



Regards,

Matthias



Re: Softraid 3TB Problems

2013-03-03 Thread Robert
On Sun, 3 Mar 2013 12:35:29 -0500
Kenneth R Westerback kwesterb...@rogers.com wrote:
 On Sun, Mar 03, 2013 at 11:15:54AM -0600, Brandon Tanner wrote:
  Joel,
  
  Would the fact that my two 3TB drives (ST3000DM001) use 4k sectors be the
  reason I wasn't getting it working then?
 
 Both of the drives in the dmesg you posted report 512-byte sectors.
 
  Ken

The Seagate datasheet [1] claims that this drive (ST3000DM001) uses 4k sectors.

Otherwise can I confirm that a Western Digital WD30EFRX 3TB drive with 512b 
sectors works fine with crypto softraid.

kind regards,
Robert

[1] 
http://www.seagate.com/files/staticfiles/docs/pdf/datasheet/disc/barracuda-desktop-hdd-ds-1770-1-1212us.pdf



Re: Softraid 3TB Problems

2013-03-03 Thread Otto Moerbeek
On Sun, Mar 03, 2013 at 07:54:07PM +0100, Robert wrote:

 On Sun, 3 Mar 2013 12:35:29 -0500
 Kenneth R Westerback kwesterb...@rogers.com wrote:
  On Sun, Mar 03, 2013 at 11:15:54AM -0600, Brandon Tanner wrote:
   Joel,
   
   Would the fact that my two 3TB drives (ST3000DM001) use 4k sectors be the
   reason I wasn't getting it working then?
  
  Both of the drives in the dmesg you posted report 512-byte sectors.
  
   Ken
 
 The Seagate datasheet [1] claims that this drive (ST3000DM001) uses 4k 
 sectors.

Seagate confusion in this 
http://www.seagate.com/staticfiles/support/docs/manual/desktop/Barracuda%207200.14/100686584d.pdf

It says: Bytes per sector (4K physical emulated at 512-byte sectors) 4096

Other numbers are reported using 512 byte sectors.

-Otto

 
 Otherwise can I confirm that a Western Digital WD30EFRX 3TB drive with 512b 
 sectors works fine with crypto softraid.
 
 kind regards,
 Robert
 
 [1] 
 http://www.seagate.com/files/staticfiles/docs/pdf/datasheet/disc/barracuda-desktop-hdd-ds-1770-1-1212us.pdf



Re: Softraid 3TB Problems

2013-03-03 Thread Nick Holland
On 03/03/13 00:34, Joel Sing wrote:
 On Sun, 3 Mar 2013, Brandon Tanner wrote:
...
 OpenBSD area: 64-5860533168; size: 2.7T; free: 0.0T
 #size   offset  fstype [fsize bsize  cpg]
   a: 2.7T   64RAID
   c: 2.7T0  unused

 # bioctl -c 1 -l /dev/sd1a,/dev/sd2a softraid0
 softraid0: SR RAID 1 volume attached as sd3
 
 This will assemble the volume from existing metadata if it exists. Any chance 
 you created a 2TB 'a' partition to start with and created a softraid volume 
 with it, then resized/recreated the disklabels? I'd certainly suggest zeroing 
 the drives (via dd or similar), or using -C force (dd is more certain).
 
 The size is read directly from the disklabel, but only when the metadata is 
 first created (after the metadata exists, we read the size from the 
 metadata). All of the variables involved appear to be 64-bit types so I do 
 not think that 32-bit truncation is occurring, although there are some 
 signed/unsigned issues that should be addressed at some point.
 
 If zeroing and recreating the metadata fails to solve the issue, I can 
 provide 
 a diff that adds some debug info.

I just took my pair of test 3TB disks (thanks to the donor!) and
verified that, if zeroed first, there is no issue setting up a (most of)
3TB RAID1 via softraid.

Nick.



Re: Softraid 3TB Problems

2013-03-03 Thread Alexander Hall

On 03/03/13 20:17, Nick Holland wrote:

On 03/03/13 00:34, Joel Sing wrote:

On Sun, 3 Mar 2013, Brandon Tanner wrote:

...

OpenBSD area: 64-5860533168; size: 2.7T; free: 0.0T
#size   offset  fstype [fsize bsize  cpg]
   a: 2.7T   64RAID
   c: 2.7T0  unused

# bioctl -c 1 -l /dev/sd1a,/dev/sd2a softraid0
softraid0: SR RAID 1 volume attached as sd3


This will assemble the volume from existing metadata if it exists. Any chance
you created a 2TB 'a' partition to start with and created a softraid volume
with it, then resized/recreated the disklabels? I'd certainly suggest zeroing
the drives (via dd or similar), or using -C force (dd is more certain).

The size is read directly from the disklabel, but only when the metadata is
first created (after the metadata exists, we read the size from the
metadata). All of the variables involved appear to be 64-bit types so I do
not think that 32-bit truncation is occurring, although there are some
signed/unsigned issues that should be addressed at some point.

If zeroing and recreating the metadata fails to solve the issue, I can provide
a diff that adds some debug info.


I just took my pair of test 3TB disks (thanks to the donor!) and
verified that, if zeroed first, there is no issue setting up a (most of)
3TB RAID1 via softraid.

Nick.



Nick. Sigh. You know very well that neither you nor miod are supposed to 
possess that kind of recent hardware. ;-)




Re: Get total size of all files in directory using unit Bytes?

2013-03-03 Thread Paul de Weerd
Not really an answer to your question, I know, but what would such a
number mean ?  What use do you have for it ?

On Mon, Mar 04, 2013 at 12:01:25AM +0800, f5b wrote:
| for example
| 
| 1.
| there is only two file in /home/test/
| # ls -l /home/test/
| total 8
| -rw-r--r--  1 root  wheel  2 Mar  3 23:29 a.txt
| -rw-r--r--  1 root  wheel  3 Mar  3 23:29 b.txt
| 
| So the total size of all files ( a.txt + b.txt ) should be 5 Bytes.
| How to get total size ( 5 Bytes ) directly but not the 8 Bytes.

a.txt is 2 bytes long, but occupies the minimum allocation unit of
your filesystem (2 kilobytes, in your case).  The total 8 is a
reference to the total number of sectors (512 bytes low level disk
allocation units) in use (2 files of 2 kilobytes use 4 kilobytes in
total and 4 kilobytes of storage require 8 physical disk sectors).

| 2.
| # man du
| says,
|  -h  Human-readable output.  Use unit suffixes: Byte, Kilobyte,
|  Megabyte, Gigabyte, Terabyte, Petabyte, Exabyte in order to
|  reduce the number of digits to four or less.
| 
| but 
| # du -h /home/test
| 6.0K/home/test
| 
| How to let unit suffixes: Byte  display (come out)  but not Kilobyte?

Note that du is reporting the correct size.  2K for a.txt, 2K for
b.txt and 2K for the directory itself for a total of 6K.

If you want du to show you a number in bytes, touch a non-existing
file (i.e. create an empty file):

[weerd@despair] $ touch /tmp/X
[weerd@despair] $ du -sh /tmp/X
0B  /tmp/X

| just like 
| # du -b /home/test   ( option -b not exist)
| 5B  /home/test   

/home/test is not 5 bytes.  It's way bigger.  As an upside, it won't
cost you any extra diskspace to grow a.txt with 10 more bytes.  Up
until 2048 bytes, the space allocated to this file on the filesystem
does not change.



If you really want to know how many bytes are stored in a set of files
you could go

[weerd@despair] $ mkdir /tmp/test
[weerd@despair] $ cd /tmp/test
[weerd@despair] $ echo a  a.txt
[weerd@despair] $ echo bb  b.txt
[weerd@despair] $ ls -l
total 4
-rw-r--r--  1 weerd  wheel  2 Mar  3 21:54 a.txt
-rw-r--r--  1 weerd  wheel  3 Mar  3 21:54 b.txt



[weerd@despair] $ ls -l /tmp/test/* | awk '{SUM+=$5} END {print SUM}'
5
[weerd@despair] $ cat * | wc -c
   5

The first approach iterates over the output of ls(1) and uses awk to
sum up the filesizes of all files in the listing.  The second
solutions simply reads all files and writes them to wc(1) which then
shows a count of the number of bytes it read.

Note that neither of these solutions take hardlinks into account (or
subdirectories, or other fancy stuff).  Also note that I have a
smaller minimum allocation unit on my /tmp partition, since the two
files consume 4 sectors worth of storage together.

You may want to read up on filesystem design.

Cheers,

Pau 'WEiRD' de Weerd

-- 
[++-]+++.+++[---].+++[+
+++-].++[-]+.--.[-]
 http://www.weirdnet.nl/ 



Re: Softraid 3TB Problems

2013-03-03 Thread Kenneth R Westerback
On Sun, Mar 03, 2013 at 07:54:07PM +0100, Robert wrote:
 On Sun, 3 Mar 2013 12:35:29 -0500
 Kenneth R Westerback kwesterb...@rogers.com wrote:
  On Sun, Mar 03, 2013 at 11:15:54AM -0600, Brandon Tanner wrote:
   Joel,
   
   Would the fact that my two 3TB drives (ST3000DM001) use 4k sectors be the
   reason I wasn't getting it working then?
  
  Both of the drives in the dmesg you posted report 512-byte sectors.
  
   Ken
 
 The Seagate datasheet [1] claims that this drive (ST3000DM001) uses 4k 
 sectors.
 
 Otherwise can I confirm that a Western Digital WD30EFRX 3TB drive with 512b 
 sectors works fine with crypto softraid.
 
 kind regards,
 Robert
 
 [1] 
 http://www.seagate.com/files/staticfiles/docs/pdf/datasheet/disc/barracuda-desktop-hdd-ds-1770-1-1212us.pdf
 

Many drives use 4K internally but still report to the outside world that
they use 512 byte sectors. Handling the translation/packing/unpacking
themselves. OpenBSD just reports (and trusts) what the drive reports
in response to READ_CAPACITY/READ_CAPACITY_16.

 Ken



802.11n on obsd

2013-03-03 Thread Sean Shoufu Luo
Hi,

Does OBSD support real 802.11n? It seems not. Although many 802.11n devices
are claimed supported, 802.11n capability is mostly not excluded, like
run(4), otus(4), urtwn(4).

And, btw, how to find the official status page, for example, about
supported hardward, the list provided in the page
http://openbsd.org/i386.html seems not updated.


-Shoufu

---
No randomness.



Re: Get total size of all files in directory using unit Bytes?

2013-03-03 Thread Ted Unangst
On Sun, Mar 03, 2013 at 22:02, Paul de Weerd wrote:
 [weerd@despair] $ ls -l /tmp/test/* | awk '{SUM+=$5} END {print SUM}'

heh. :)

~/bin cat filesizes  
#!/bin/sh
ls -l $@ | awk '{sum += $5} END { print sum }'



Re: Softraid 3TB Problems

2013-03-03 Thread Brandon Tanner
I got it working!!!

What Joel said was key. I had probably done it wrong the first time (didn't
use the b option in disklabel), and everytime I re-tried it after that, I
wasn't starting from scratch (zero'ing the two raid drives). So I booted
the SeaTools for DOS CD, and zero'ed the two 3TB drives this time, and then
re-installed with the March 1, 2013 snapshot of 5.3 (don't think this is
what fixed it though), and did the same procedure in my first post, and now
it works! When Joel said that, the light just went on in my head, cause I
had been wondering how to reverse the procedure and start over, but had
only been using the 'z' option in disklabel, and had only dd if=/dev/zero
the resulting softraid volume, not the 2 real volumes each time I started
over to try again.

A warm Thanks to everyone for their input.

Also, about the 4k sectors, I think Ken is right, I think Seagate's
smartalign technology takes care of it all behind the scenes so to speak,
and the OS still sees 512 byte sectors.

Might be worth a mention in the FAQ or something that if you don't setup
raid1 correctly the first time, to start over, you need to detach the raid
using bioctl, clear the disklabels, zero the raid volumes, and reinit them
in fdisk?


On Sun, Mar 3, 2013 at 3:53 PM, Kenneth R Westerback kwesterb...@rogers.com
 wrote:

 On Sun, Mar 03, 2013 at 07:54:07PM +0100, Robert wrote:
  On Sun, 3 Mar 2013 12:35:29 -0500
  Kenneth R Westerback kwesterb...@rogers.com wrote:
   On Sun, Mar 03, 2013 at 11:15:54AM -0600, Brandon Tanner wrote:
Joel,
   
Would the fact that my two 3TB drives (ST3000DM001) use 4k sectors
 be the
reason I wasn't getting it working then?
  
   Both of the drives in the dmesg you posted report 512-byte sectors.
  
    Ken
 
  The Seagate datasheet [1] claims that this drive (ST3000DM001) uses 4k
 sectors.
 
  Otherwise can I confirm that a Western Digital WD30EFRX 3TB drive with
 512b sectors works fine with crypto softraid.
 
  kind regards,
  Robert
 
  [1]
 http://www.seagate.com/files/staticfiles/docs/pdf/datasheet/disc/barracuda-desktop-hdd-ds-1770-1-1212us.pdf
 

 Many drives use 4K internally but still report to the outside world that
 they use 512 byte sectors. Handling the translation/packing/unpacking
 themselves. OpenBSD just reports (and trusts) what the drive reports
 in response to READ_CAPACITY/READ_CAPACITY_16.

  Ken



Re: 802.11n on obsd

2013-03-03 Thread Jérémie Courrèges-Anglas
Sean Shoufu Luo luosho...@gmail.com writes:

 Hi,

Hi,

 Does OBSD support real 802.11n? It seems not. Although many 802.11n devices
 are claimed supported, 802.11n capability is mostly not excluded, like
 run(4), otus(4), urtwn(4).

This has already been asked many times in the past.

From the manpage of one of the wifi card drivers I use:

CAVEATS
   The iwn driver does not support any of the 802.11n capabilities offered
   by the adapters.  Additional work is required in ieee80211(9) before
   those features can be supported.

The manpages you mention say the same.

 And, btw, how to find the official status page, for example, about
 supported hardward, the list provided in the page
 http://openbsd.org/i386.html seems not updated.

www.openbsd.org and openbsd.org aren't the same machines, you should
prefer the former.  But they're in sync and both have this cvs Id on the
i386.html page:

$OpenBSD: i386.html,v 1.713 2013/01/30 09:47:46 kirby Exp $

I can't think of something both official and more and up-to-date.

Regards,
-- 
Jérémie Courrèges-Anglas
GPG Key fingerprint: 61DB D9A0 00A4 67CF 2A90  8961 6191 8FBF 06A1 1494



dhclient not receiving dhcpoffers with wep connection but fine with wpa

2013-03-03 Thread Jeff Richards
I have been trying to configure a HP Pavilion dv5000(5210us) laptop to connect
to a WEP network.  I have tried OBSD 5.2 and CURRENT without success using WEP
but can connect with WPA --personal hotspot.


The network interfaces I have
tried are 


Integrated wireless (bwi0 at pci3 dev 2 function 0 Broadcom
BCM4318 rev 0x02: apic 1 int 21) 


USB adapter (rum0 at uhub0 port 1 Ralink
Technology RT2573 EV 2.00/0.01 addr 2 MAC/BBP RT2573 (rev 0x2573a), RF
RT2528)

Both adapters fail to obtain a DHCP configuration with No acceptable
DHCPOFFERS received when using WEP but have no issue when configured for WPA.
I have used ifconfig interface scan to extract information  to specify the
channel and BSSID for my hostname.if WEP configuration.

Any ideas will be
appreciated.

Thanks.



Re: USB repeater cable on Soekris net5501

2013-03-03 Thread Stuart Henderson
On 2013-03-03, Christian Weisgerber na...@mips.inka.de wrote:
 Ingo Feinerer feine...@logic.at wrote:

 I have a problem with a Digitus USB 2.0 repeater cable in combination with a
 Soekris net5501 running OpenBSD 5.2 (see full dmesg at the very end of this
 mail).

 Is this an active device?  Essentially a single-port hub?

 However, the problem occurs when I attach the repeater cable with the UMTS
 stick at its end. The stick is not recognized anymore.

 I suspect the net5501's USB port is too weak to power the combination
 of repeater and UMTS stick.


If this is the case, adding a powered hub may help.



Re: dhclient not receiving dhcpoffers with wep connection but fine with wpa

2013-03-03 Thread Kenneth R Westerback
On Sun, Mar 03, 2013 at 03:10:38PM -0800, Jeff Richards wrote:
 I have been trying to configure a HP Pavilion dv5000(5210us) laptop to connect
 to a WEP network.? I have tried OBSD 5.2 and CURRENT without success using WEP
 but can connect with WPA --personal hotspot.
 
 
 The network interfaces I have
 tried are 
 
 
 Integrated wireless (bwi0 at pci3 dev 2 function 0 Broadcom
 BCM4318 rev 0x02: apic 1 int 21) 
 
 
 USB adapter (rum0 at uhub0 port 1 Ralink
 Technology RT2573 EV 2.00/0.01 addr 2 MAC/BBP RT2573 (rev 0x2573a), RF
 RT2528)
 
 Both adapters fail to obtain a DHCP configuration with No acceptable
 DHCPOFFERS received when using WEP but have no issue when configured for WPA.
 I have used ifconfig interface scan to extract information? to specify the
 channel and BSSID for my hostname.if WEP configuration.
 
 Any ideas will be
 appreciated.
 
 Thanks.
 

Idea 1: Supply the information requested for problem reports in

http://openbsd.org/report.html

including your logs, and a tcpdump of any received DHCPOFFER packets.

Idea 2: manually configure the interface and see if ANY network
traffic (e.g. ping) makes it in or out.

 Ken



Broken dependency: automake 1.11.5 in sqlports

2013-03-03 Thread Alan Corey
While installing sqlports from ports under openbsd 5.2 I got

pass #2
+++ converters/ruby-json,rbx
+++ databases/db/v4,bootstrap,no_java,no_tcl
 Broken dependency: devel/automake/1.11.5 non existent
+++ databases/ruby-activerecord,ruby19
Died at /usr/ports/databases/sqlports/files/mksqlitedb line 114.
*** Error code 1

Stop in /usr/ports/databases/sqlports (line 25 of Makefile).
*** Error code 1

Stop in /usr/ports/databases/sqlports (line 2496 of
/usr/ports/infrastructure/mk/bsd.port.mk).
*** Error code 1

Stop in /usr/ports/databases/sqlports (line 1718 of
/usr/ports/infrastructure/mk/bsd.port.mk).
*** Error code 1

Of course there isn't any automake 1.11.5.
Maybe this should go to po...@openbsd.org, but I'm not signed up there.

  Alan
-- 
Credit is the root of all evil.  - AB1JX



automake 1.11.5: never mind

2013-03-03 Thread Alan Corey
I'm defining
setenv AUTOMAKE_VERSION 1.11.5
In my .cshrc, I don't know why exactly.
-- 
Credit is the root of all evil.  - AB1JX



Automake 1.11.5 IS an issue

2013-03-03 Thread Alan Corey
This is probably where it came from:

d530# pkg_info | grep automake
automake-1.10.3p6   GNU Standards-compliant Makefile generator
automake-1.11.5p1   GNU Standards-compliant Makefile generator
automake-1.9.6p10   GNU Standards-compliant Makefile generator

I was defining AUTOMAKE_VERSION to the latest one I had installed, and
pkg_info reports a 1.11.5p1.  I don't know why.

  Alan

-- 
Credit is the root of all evil.  - AB1JX



Re: USB repeater cable on Soekris net5501

2013-03-03 Thread Ingo Feinerer
On 2013-03-03, Christian Weisgerber na...@mips.inka.de wrote:
  I have a problem with a Digitus USB 2.0 repeater cable in
  combination with a Soekris net5501 running OpenBSD 5.2 (see full
  dmesg at the very end of this mail).

 Is this an active device?  Essentially a single-port hub?

Exactly.

  However, the problem occurs when I attach the repeater cable with
  the UMTS stick at its end. The stick is not recognized anymore.

 I suspect the net5501's USB port is too weak to power the combination
 of repeater and UMTS stick.

Thanks for the pointer. I will try with a USB hub with an external power
supply (as also suggested by Stuart Henderson).

Best regards,
Ingo



Re: automake 1.11.5: never mind

2013-03-03 Thread Brad Smith
On Mon, Mar 04, 2013 at 01:04:51AM -0500, Alan Corey wrote:
 I'm defining
 setenv AUTOMAKE_VERSION 1.11.5
 In my .cshrc, I don't know why exactly.

The value should be 1.11 not 1.11.5.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Serial and parallel port detection

2013-03-03 Thread Jacques Pelletier

Hi,

For use in the GUI of an application, I need to have a list of detected 
serial and parallel ports. This list is used to fill a combo box where 
the user select the port to use (example: in Windows, it would be a list 
with COM1,COM2, etc.


On OpenBSD, how can we retrieve the detected serial and parallel ports?

JP



Re: Serial and parallel port detection

2013-03-03 Thread Theo de Raadt
 For use in the GUI of an application, I need to have a list of detected 
 serial and parallel ports. This list is used to fill a combo box where 
 the user select the port to use (example: in Windows, it would be a list 
 with COM1,COM2, etc.
 
 On OpenBSD, how can we retrieve the detected serial and parallel ports?

There is no clean machine-independent way.

You could perhaps do something like use the output of pstat -t, but
remove the console and pseudo-ttys, and you would probably be OK.

The console devices will be somewhat machine dependent, but the pseudo-ttys
are easy to spot.



Re: automake 1.11.5: never mind

2013-03-03 Thread Alan Corey
The distfile name is automake-1.11.5.tar.gz and pkg_info reports
1.11.5, but sqlports rejects it.

In the ports tree there are 6 versions:
d530# cd automake
d530# ls
1.10 1.12 1.8  CVS  Makefile.inc
1.11 1.4  1.9  Makefile

  Alan




On 3/4/13, Brad Smith b...@comstyle.com wrote:
 On Mon, Mar 04, 2013 at 01:04:51AM -0500, Alan Corey wrote:
 I'm defining
 setenv AUTOMAKE_VERSION 1.11.5
 In my .cshrc, I don't know why exactly.

 The value should be 1.11 not 1.11.5.

 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.




-- 
Credit is the root of all evil.  - AB1JX