Re: .sh check for numeric content

2010-06-23 Thread Giorgos Keramidas
On Thu, 24 Jun 2010 05:19:53 +0200, Thomas Keusch 
 wrote:
> t...@eternity:~$ b=5
> t...@eternity:~$ case "$b" in
>> [0-9] )
>> echo numeric
>> ;;
>> * )
>> echo alpha
>> ;;
>> esac
> numeric
> t...@eternity:~$
>
> Works for me.

Depending on what "numeric" means, this may be ok.  For other numeric
values (e.g. floating point numbers) There are simple, fast and correct
ways to check but you have to escape from the shell, e.g.:

$ var=3.1415926535897931
$ python -c "$var + 0.0" >/dev/null 2>&1 ; echo $?
0

$ var=3a.1415926535897931
$ python -c "$var + 0.0" >/dev/null 2>&1 ; echo $?
1

The overhead of spawning a full-blown language interpreter like Perl or
Python may be acceptable if you have to check "a few" values.  Then it
may be overkill if you want to check a million values.  It's really up
to you, as a programmer, to pick the right method.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: .sh check for numeric content

2010-06-23 Thread Aiza

Aiza wrote:

Thomas wrote:

On Thu, Jun 24, 2010 at 09:24:39AM +0800, Aiza wrote:

Hello,


Receiving a variable from the command line that is suppose
to contain numeric values.

How do I code a test to verify the content is  numeric?


http://www.google.com/search?q=shell+test+if+variable+numeric

First link =>
http://www.unix.com/shell-programming-scripting/46276-check-variable-if-its-non-numeric.html 



Gosh, Google is full of answers these days..



yea but none of them are for freebsd style .sh shell


I'm, using

[ "${dup_times}" != [0-9] ] && exerr "value not numeric"

and get the errot messahe no mater what value is in dup_times.

What is wrong with this code?




Tried this suggestion from a reply and it worked.
Only valid numeric value is whole numbers.

if expr "${dup_times}" : "[0-9]*$"
then
   echo "value is numeric"
else
   echo "value is not numeric"
fi


But when I tried this format
[ expr "${dup_times}" : "[0-9]*$" ] || echo "value is not numeric"

I get the error message no mater what the value is.

What am I doing wrong?



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: before i even =touch= my server again....

2010-06-23 Thread Gary Kline
On Wed, Jun 23, 2010 at 08:10:13PM +0200, Polytropon wrote:
> On Wed, 23 Jun 2010 13:03:03 -0500, Kirk Strauser  wrote:
> > On 06/23/10 11:35, Polytropon wrote:
> > > Of course, all write attempts to /var will then fail.
> > 
> > Or even worse: they'll succeeded. And then when you re-mount /var, 
> > you'll lose access to all the files you've written in the mean time.
> 
> True, an important advice. In case /var is not mounted, the
> /var directory on / will be just a "plain directory". Depending
> on program behaviour, it is possible that logging programs
> create a new file when missing a file to append. In this case,
> / will fill with such files in /var. It's important to remove
> them prior to re-mounting /var. It is possible to move them,
> e. g. to /tmp, and immediately append them to the correct files
> after re-mounting /var. But if (small) data loss is acceptable
> for the time needed to fix /var, it is an option.
> 
> Another possibility is - but I never tried it - to force fsck
> to check a mounted partition that is in use.
> 
>   # fsck -yf /var
> 
> This may (!) cause other forms of damage, allthough fsck should
> be able to correct most usual problems.
> 
> It's a good approach to stop as many services as possible that
> could want to write to /var, and restart them after /var is clean
> and mounted again.
> 


yeah, ive had it; some 40 minutes ago i rebooted into [3][safe] and i
think fsck resolved the inode troubles and since my email work, i'll
wait until my pal gets back.  i can't see under there so the KVM 
config will have to wait.



> 
> 
> 
> -- 
> Polytropon
> Magdeburg, Germany
> Happy FreeBSD user since 4.0
> Andra moi ennepe, Mousa, ...
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

-- 
 Gary Kline  kl...@thought.org  http://www.thought.org  Public Service Unix
The 7.83a release of Jottings: http://jottings.thought.org/index.php
   http://journey.thought.org  99 44/100% Guaranteed Novel

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Problem running fdisk via sysinstall

2010-06-23 Thread Adam Vande More
On Wed, Jun 23, 2010 at 6:28 PM, Mark Costlow  wrote:

> I hope this question isn't too stupid.
>
> Any hints or clue-by-fours?
>
>
What's the output of 'gpart show'?

-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: .sh check for numeric content

2010-06-23 Thread Karl Vogel
>> On Thu, 24 Jun 2010 09:24:39 +0800, 
>> Aiza  said:

A> Receiving a variable from the command line that is suppose to contain
A> numeric values.  How do I code a test to verify the content is numeric?

   The script below will work with the Bourne or Korn shell.
   Results for "0 1 12 1234 .12 1.234 12.3 1a a1":

 0 is numeric
 1 is numeric
 12 is numeric
 1234 is numeric
 .12 is numeric
 1.234 is numeric
 12.3 is numeric
 1a is NOT numeric
 a1 is NOT numeric

-- 
Karl Vogel  I don't speak for the USAF or my company

I place economy among the first and most important virtues, and public debt
as the greatest of dangers to be feared.  To preserve our independence, we
must not let our rulers load us with perpetual debt.--Thomas Jefferson

---
#!/bin/sh
# Test an argument to see if it's numeric.  Handles decimals, but
# a minus sign in the regex will throw an error: "expr: illegal option".

PATH=/bin:/usr/bin:/usr/local/bin
export PATH

case "$#" in
0)  echo need an argument. ; exit 1 ;;
*)  ;;
esac

for arg
do
if expr "$arg" : "[0-9]*[\.0-9]*$" > /dev/null
then
echo "$arg is numeric"
else
echo "$arg is NOT numeric"
fi
done

exit 0
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: .sh check for numeric content

2010-06-23 Thread Thomas Keusch
On Thu, Jun 24, 2010 at 03:44:34AM +0100, RW wrote:

Hello,

> On Thu, 24 Jun 2010 03:37:55 +0200
> Thomas  wrote:
> 
> > On Thu, Jun 24, 2010 at 09:24:39AM +0800, Aiza wrote:
> > 
> > Hello,
> > 
> > > Receiving a variable from the command line that is suppose
> > > to contain numeric values.
> > > 
> > > How do I code a test to verify the content is  numeric?
> > 
> > http://www.google.com/search?q=shell+test+if+variable+numeric
> > 
> > First link =>
> > http://www.unix.com/shell-programming-scripting/46276-check-variable-if-its-non-numeric.html
> > 
> > Gosh, Google is full of answers these days..
> 
> I'd suggest looking a bit further down the list since the quoted first
> link is patently wrong.

t...@eternity:~$ b=5
t...@eternity:~$ case "$b" in 
> [0-9] ) 
> echo numeric 
> ;;
> * ) 
> echo alpha 
> ;;
> esac
numeric
t...@eternity:~$

Works for me.

Another solution would be like this:

if echo "$b" | egrep -q '^[0-9]+$'; then

and eventual variants of it.


Regards
Thomas
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Network card attaching to the wrong driver

2010-06-23 Thread Tim Judd
On 6/23/10, Nicholas Mills  wrote:
> All,
>
> I am running 8.0-RELEASE and having trouble with the ed driver that is
> compiled by default into GENERIC. My machine is actually a VM running under
> Parallels Server Bare Metal 4. I would like my card to be attached to the
> Parallels driver in ports (pvmnet) instead of ed. Is there some boot option
> I could use? Both device drivers are looking for the same PCI vendor/device
> id in their probe routines, and both drivers return the same value from
> their probe functions (so they have equal priority).
>
> Thanks,
>
> Nick Mills

Disable it from the kernel config and make a custom kernel.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: .sh check for numeric content

2010-06-23 Thread Aiza

Thomas wrote:

On Thu, Jun 24, 2010 at 09:24:39AM +0800, Aiza wrote:

Hello,


Receiving a variable from the command line that is suppose
to contain numeric values.

How do I code a test to verify the content is  numeric?


http://www.google.com/search?q=shell+test+if+variable+numeric

First link =>
http://www.unix.com/shell-programming-scripting/46276-check-variable-if-its-non-numeric.html

Gosh, Google is full of answers these days..



yea but none of them are for freebsd style .sh shell


I'm, using

[ "${dup_times}" != [0-9] ] && exerr "value not numeric"

and get the errot messahe no mater what value is in dup_times.

What is wrong with this code?




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: .sh check for numeric content

2010-06-23 Thread RW
On Thu, 24 Jun 2010 03:37:55 +0200
Thomas  wrote:

> On Thu, Jun 24, 2010 at 09:24:39AM +0800, Aiza wrote:
> 
> Hello,
> 
> > Receiving a variable from the command line that is suppose
> > to contain numeric values.
> > 
> > How do I code a test to verify the content is  numeric?
> 
> http://www.google.com/search?q=shell+test+if+variable+numeric
> 
> First link =>
> http://www.unix.com/shell-programming-scripting/46276-check-variable-if-its-non-numeric.html
> 
> Gosh, Google is full of answers these days..

I'd suggest looking a bit further down the list since the quoted first
link is patently wrong.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: .sh check for numeric content

2010-06-23 Thread Anh Ky Huynh
On Thu, 24 Jun 2010 09:24:39 +0800
Aiza  wrote:

> Receiving a variable from the command line that is suppose
> to contain numeric values.
> 
> How do I code a test to verify the content is  numeric?

echo "$your_variable" | grep -E "^[0-9]+(\.[0-9]*)*[0-9]+$"

If $your_variable is numeric (123, or 123.123, etc), the return code should be 
0. You can custom to script to support negative numbers.

-- 
Anh Ky Huynh
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Problem running fdisk via sysinstall

2010-06-23 Thread Mark Costlow
Since I don't have any other ideas yet, I'll give that a try.  I'll
let you know if it works tomorrow if it has finished by then :-)

Mark

On Wed, Jun 23, 2010 at 07:46:38PM -0400, Nicholas Mills wrote:
>Mark,
>I'm certainly no expert, but I think I can point you in the right
>direction. The system appears to be attempting to read from a GPT
>stored on the disk from when you used it on Linux. I'm not sure of the
>specifics, but I do know that some GPT info is stored near the end of
>the drive. The easy (but slow) solution would be to use dd to write
>zeros to the entire drive (da1).
>Hope this helps,
>Nick
>On Wed, Jun 23, 2010 at 7:28 PM, Mark Costlow <[1]che...@swcp.com>
>wrote:
> 
>  I hope this question isn't too stupid.
>  I have a machine with a 3Ware RAID card, with 4 SATA drives
>  attached.
>  2 drives are 250GB in a RAID1 volume, and act as the boot disk with
>  a standard freebsd partiction map (/, /var, /usr, and swap on this
>  disk).
>  The other 2 drives are 1TB in a RAID1 volume, intended to be mounted
>  as a separate data partition.  At boot both volumes are recognized:
>  Jun 22 18:38:51 ebi7 kernel: da0 at twa0 bus 0 target 0 lun 0
>  Jun 22 18:38:51 ebi7 kernel: da0:  Fixed
>  Direct Access SCSI-5 device
>  Jun 22 18:38:51 ebi7 kernel: da0: 100.000MB/s transfers
>  Jun 22 18:38:51 ebi7 kernel: da0: 238408MB (488259584 512 byte
>  sectors: 255H 63S/T 30392C)
>  Jun 22 18:38:51 ebi7 kernel: da1 at twa0 bus 0 target 1 lun 0
>  Jun 22 18:38:51 ebi7 kernel: da1:  Fixed
>  Direct Access SCSI-5 device
>  Jun 22 18:38:51 ebi7 kernel: da1: 100.000MB/s transfers
>  Jun 22 18:38:51 ebi7 kernel: da1: 953664MB (1953103872 512 byte
>  sectors: 255H 63S/T 121575C)
>  da0 is fine, and the system boots off of it with no problem.
>  When I try to add da1 to the system, I get the following:
>  * Run systinstall, Configure, Fdisk, select da1
>  * Get the friendly warning about the large geometry, click "Yes"
>  * Hit "A" to use entire disk.  Hit "W" to save, click "Yes",
>  select "None" for boot record.
>  * Fdisk says: "Wrote FDISK partition information out successfully."
>  * Per handbook, get out of sysinstall and re-run it, then
>  try to Label.  In the label editor, it knows nothing about
>  da1 (the device can be selected when going into the label
>  editor, but I can't create any partitions).
>  At the time when Fdisk says "Wrote FDISK partition information out,
>  successfully." this gets logged to /var/log/messages:
>  Jun 23 17:11:18 ebi7 kernel: GEOM: da1: corrupt or invalid GPT
>  detected.
>  Jun 23 17:11:18 ebi7 kernel: GEOM: da1: GPT rejected -- may not be
>  recoverable.
>  I've tried several variations, including running the command-line
>  equivalents, but keep hitting this same error (fdisk thinks
>  everything
>  is good, but the GPT error is logged).  I've also noticed that
>  /dev/da1 exists, but there is no /dev/da1s1 or /dev/da1s1e ... I'm
>  not sure when those should get created.
>  And the final possibly-relevant tidbit: these drives used to be
>  part of a different RAID on a linux system.  They've been
>  re-initialized
>  into the RAID card on this system, and I've zero'd the first 1k of
>  the volume with dd, so I don't *think* that should be a factor.
>  I've worked with about a dozen systems with the same hardware in
>  the configuration outlined above and haven't seen this problem
>  before.  But I'm usually using fresh new disks so maybe it matters.
>  I've googled this issue and found several people reporting similar
>  symptoms over the years, but haven't found any posted solutions
>  aside from telling people to read geom(8).
>  Any hints or clue-by-fours?
>  Mark
>  --
>  Mark Costlow| Southwest Cyberport | Fax:   +1-505-232-7975
>  [2]che...@swcp.com | Web:   [3]www.swcp.com | Voice: +1-505-232-7992
>  [4]abq-strange.com -- Interesting photos taken in Albuquerque, NM
>Last post: Shoe Pole - 2009-07-07 20:18:22
>  ___
>  [5]freebsd-questi...@freebsd.org mailing list
>  [6]http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>  To unsubscribe, send any mail to
>  "[7]freebsd-questions-unsubscr...@freebsd.org"
> 
> References
> 
>1. mailto:che...@swcp.com
>2. mailto:che...@swcp.com
>3. http://www.swcp.com/
>4. http://abq-strange.com/
>5. mailto:freebsd-questions@freebsd.org
>6. http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>7. mailto:freebsd-questions-unsubscr...@freebsd.org

-- 
Mark Costlow| Southwest Cyberport | Fax:   +1-505-232-7975
che...@swcp.com | Web:   www.swcp.com | Voice: +1-505-232-7992

abq-strange.com -- Interesting photos taken in

Re: .sh check for numeric content

2010-06-23 Thread Thomas
On Thu, Jun 24, 2010 at 09:24:39AM +0800, Aiza wrote:

Hello,

> Receiving a variable from the command line that is suppose
> to contain numeric values.
> 
> How do I code a test to verify the content is  numeric?

http://www.google.com/search?q=shell+test+if+variable+numeric

First link =>
http://www.unix.com/shell-programming-scripting/46276-check-variable-if-its-non-numeric.html

Gosh, Google is full of answers these days..


Regards,
Thomas
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


.sh check for numeric content

2010-06-23 Thread Aiza

Receiving a variable from the command line that is suppose
to contain numeric values.

How do I code a test to verify the content is  numeric?

Thanks for for help.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Problem running fdisk via sysinstall

2010-06-23 Thread Nicholas Mills
Mark,

I'm certainly no expert, but I think I can point you in the right direction.
The system appears to be attempting to read from a GPT stored on the disk
from when you used it on Linux. I'm not sure of the specifics, but I do know
that some GPT info is stored near the end of the drive. The easy (but slow)
solution would be to use dd to write zeros to the entire drive (da1).

Hope this helps,

Nick

On Wed, Jun 23, 2010 at 7:28 PM, Mark Costlow  wrote:

> I hope this question isn't too stupid.
>
> I have a machine with a 3Ware RAID card, with 4 SATA drives attached.
>
> 2 drives are 250GB in a RAID1 volume, and act as the boot disk with
> a standard freebsd partiction map (/, /var, /usr, and swap on this disk).
>
> The other 2 drives are 1TB in a RAID1 volume, intended to be mounted
> as a separate data partition.  At boot both volumes are recognized:
>
> Jun 22 18:38:51 ebi7 kernel: da0 at twa0 bus 0 target 0 lun 0
> Jun 22 18:38:51 ebi7 kernel: da0:  Fixed Direct
> Access SCSI-5 device
> Jun 22 18:38:51 ebi7 kernel: da0: 100.000MB/s transfers
> Jun 22 18:38:51 ebi7 kernel: da0: 238408MB (488259584 512 byte sectors:
> 255H 63S/T 30392C)
> Jun 22 18:38:51 ebi7 kernel: da1 at twa0 bus 0 target 1 lun 0
> Jun 22 18:38:51 ebi7 kernel: da1:  Fixed Direct
> Access SCSI-5 device
> Jun 22 18:38:51 ebi7 kernel: da1: 100.000MB/s transfers
> Jun 22 18:38:51 ebi7 kernel: da1: 953664MB (1953103872 512 byte sectors:
> 255H 63S/T 121575C)
>
> da0 is fine, and the system boots off of it with no problem.
>
> When I try to add da1 to the system, I get the following:
>
> * Run systinstall, Configure, Fdisk, select da1
> * Get the friendly warning about the large geometry, click "Yes"
> * Hit "A" to use entire disk.  Hit "W" to save, click "Yes",
> select "None" for boot record.
> * Fdisk says: "Wrote FDISK partition information out successfully."
> * Per handbook, get out of sysinstall and re-run it, then
> try to Label.  In the label editor, it knows nothing about
> da1 (the device can be selected when going into the label
> editor, but I can't create any partitions).
>
> At the time when Fdisk says "Wrote FDISK partition information out,
> successfully." this gets logged to /var/log/messages:
>
> Jun 23 17:11:18 ebi7 kernel: GEOM: da1: corrupt or invalid GPT detected.
> Jun 23 17:11:18 ebi7 kernel: GEOM: da1: GPT rejected -- may not be
> recoverable.
>
>
> I've tried several variations, including running the command-line
> equivalents, but keep hitting this same error (fdisk thinks everything
> is good, but the GPT error is logged).  I've also noticed that
> /dev/da1 exists, but there is no /dev/da1s1 or /dev/da1s1e ... I'm
> not sure when those should get created.
>
> And the final possibly-relevant tidbit: these drives used to be
> part of a different RAID on a linux system.  They've been re-initialized
> into the RAID card on this system, and I've zero'd the first 1k of
> the volume with dd, so I don't *think* that should be a factor.
> I've worked with about a dozen systems with the same hardware in
> the configuration outlined above and haven't seen this problem
> before.  But I'm usually using fresh new disks so maybe it matters.
>
> I've googled this issue and found several people reporting similar
> symptoms over the years, but haven't found any posted solutions
> aside from telling people to read geom(8).
>
> Any hints or clue-by-fours?
>
> Mark
> --
> Mark Costlow| Southwest Cyberport | Fax:   +1-505-232-7975
> che...@swcp.com | Web:   www.swcp.com | Voice: +1-505-232-7992
>
> abq-strange.com -- Interesting photos taken in Albuquerque, NM
>   Last post: Shoe Pole - 2009-07-07 20:18:22
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscr...@freebsd.org"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Problem running fdisk via sysinstall

2010-06-23 Thread Mark Costlow
I hope this question isn't too stupid.

I have a machine with a 3Ware RAID card, with 4 SATA drives attached.

2 drives are 250GB in a RAID1 volume, and act as the boot disk with
a standard freebsd partiction map (/, /var, /usr, and swap on this disk).

The other 2 drives are 1TB in a RAID1 volume, intended to be mounted
as a separate data partition.  At boot both volumes are recognized:

Jun 22 18:38:51 ebi7 kernel: da0 at twa0 bus 0 target 0 lun 0
Jun 22 18:38:51 ebi7 kernel: da0:  Fixed Direct 
Access SCSI-5 device 
Jun 22 18:38:51 ebi7 kernel: da0: 100.000MB/s transfers
Jun 22 18:38:51 ebi7 kernel: da0: 238408MB (488259584 512 byte sectors: 255H 
63S/T 30392C)
Jun 22 18:38:51 ebi7 kernel: da1 at twa0 bus 0 target 1 lun 0
Jun 22 18:38:51 ebi7 kernel: da1:  Fixed Direct 
Access SCSI-5 device 
Jun 22 18:38:51 ebi7 kernel: da1: 100.000MB/s transfers
Jun 22 18:38:51 ebi7 kernel: da1: 953664MB (1953103872 512 byte sectors: 255H 
63S/T 121575C)

da0 is fine, and the system boots off of it with no problem.

When I try to add da1 to the system, I get the following:

* Run systinstall, Configure, Fdisk, select da1
* Get the friendly warning about the large geometry, click "Yes"
* Hit "A" to use entire disk.  Hit "W" to save, click "Yes",
select "None" for boot record.
* Fdisk says: "Wrote FDISK partition information out successfully."
* Per handbook, get out of sysinstall and re-run it, then
try to Label.  In the label editor, it knows nothing about
da1 (the device can be selected when going into the label
editor, but I can't create any partitions).

At the time when Fdisk says "Wrote FDISK partition information out,
successfully." this gets logged to /var/log/messages:

Jun 23 17:11:18 ebi7 kernel: GEOM: da1: corrupt or invalid GPT detected.
Jun 23 17:11:18 ebi7 kernel: GEOM: da1: GPT rejected -- may not be recoverable.


I've tried several variations, including running the command-line
equivalents, but keep hitting this same error (fdisk thinks everything
is good, but the GPT error is logged).  I've also noticed that
/dev/da1 exists, but there is no /dev/da1s1 or /dev/da1s1e ... I'm
not sure when those should get created.

And the final possibly-relevant tidbit: these drives used to be
part of a different RAID on a linux system.  They've been re-initialized
into the RAID card on this system, and I've zero'd the first 1k of
the volume with dd, so I don't *think* that should be a factor.
I've worked with about a dozen systems with the same hardware in
the configuration outlined above and haven't seen this problem
before.  But I'm usually using fresh new disks so maybe it matters.

I've googled this issue and found several people reporting similar
symptoms over the years, but haven't found any posted solutions
aside from telling people to read geom(8).

Any hints or clue-by-fours?

Mark
-- 
Mark Costlow| Southwest Cyberport | Fax:   +1-505-232-7975
che...@swcp.com | Web:   www.swcp.com | Voice: +1-505-232-7992

abq-strange.com -- Interesting photos taken in Albuquerque, NM
   Last post: Shoe Pole - 2009-07-07 20:18:22
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Network card attaching to the wrong driver

2010-06-23 Thread Nicholas Mills
All,

I am running 8.0-RELEASE and having trouble with the ed driver that is
compiled by default into GENERIC. My machine is actually a VM running under
Parallels Server Bare Metal 4. I would like my card to be attached to the
Parallels driver in ports (pvmnet) instead of ed. Is there some boot option
I could use? Both device drivers are looking for the same PCI vendor/device
id in their probe routines, and both drivers return the same value from
their probe functions (so they have equal priority).

Thanks,

Nick Mills
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


RE: sshd / tcp packet corruption ?

2010-06-23 Thread Martin Minkus
Thanks for the reply. I actually posted a response to this original 
message with more details showing just raw tcp data sent from one box to 
another box is getting corrupted.

The culprit is definitely kinetic.

Futhermore, i've determined both NICs are doing it.

kinetic:~# netstat -i
NameMtu Network   Address  Ipkts Ierrs Idrop
Opkts Oerrs  Coll
em01500   00:0e:0c:6b:d6:d3   49 0 0   
190062 0 0
em01500 10.64.10.0kinetic 198516 - -   
189315 - -
nfe0   1500   00:24:1d:15:11:4817932 0 0  
219 0 0
nfe0   1500 10.64.11.010.64.11.253 12675 - -  
217 - -
plip0  15000 0 0
0 0 0
lo0   16384  592 0 0  
592 0 0
lo0   16384 fe80:4::1 fe80:4::10 - -
0 - -
lo0   16384 localhost ::1  0 - -
0 - -
lo0   16384 your-net  localhost  552 - -  
592 - -
kinetic:~# 

Perhaps it is ram, though good point. I'll do a memtest.

Martin.

-Original Message-
From: Lowell Gilbert [mailto:freebsd-questions-lo...@be-well.ilk.org] 
Sent: Thursday, 24 June 2010 09:41
To: Martin Minkus
Cc: freebsd-questions
Subject: Re: sshd / tcp packet corruption ?

Martin Minkus  writes:

> It seems this issue I reported below may actually be related to some
> kind of TCP packet corruption ?

Possible.  Or memory errors.  Hard to say much at this point, when you
don't even know which side is actually causing the errors.

> Still same box. Ive noticed my SSH connections into the box will die
> randomly, with errors.
>
>  
>
> Sshd logs the following on the box itself:
>
>  
>
> Jun 18 11:15:32 kinetic sshd[1406]: Received disconnect from
> 10.64.10.251: 2: Invalid packet header.  This probably indicates a
> problem with key exchange or encryption. 
>

You might find more useful information by getting verbose messages from
the other end.  

I don't have time to check this in detail, but if I recall correctly,
that message means that the other side closed the connection based on an
apparent invalid header type in a packet that 'kinetic' received.
Random corruption isn't likely in that case, because the error is always
in the same place in the packet.  Check the 'netstat -i' numbers to see
if the drivers are picking up any packet errors.

It's hard to debug network problems in ssh, though, because (obviously)
you can't tell in general whether packet data is corrupt.  If you can
set up a test case with, say, UDP echo, that would be easier to see the
damage to the packets if they are, in fact, being corrupted.  

Unfortunately, I'm so used to having sophisticated test equipment in the
lab to look at these kinds of problems that I'm probably missing what
would be obvious to someone who deals with problems "in the field."
Hope I've been somewhat helpful anyway.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: sshd / tcp packet corruption ?

2010-06-23 Thread Lowell Gilbert
Martin Minkus  writes:

> It seems this issue I reported below may actually be related to some
> kind of TCP packet corruption ?

Possible.  Or memory errors.  Hard to say much at this point, when you
don't even know which side is actually causing the errors.

> Still same box. I’ve noticed my SSH connections into the box will die
> randomly, with errors.
>
>  
>
> Sshd logs the following on the box itself:
>
>  
>
> Jun 18 11:15:32 kinetic sshd[1406]: Received disconnect from
> 10.64.10.251: 2: Invalid packet header.  This probably indicates a
> problem with key exchange or encryption. 
>

You might find more useful information by getting verbose messages from
the other end.  

I don't have time to check this in detail, but if I recall correctly,
that message means that the other side closed the connection based on an
apparent invalid header type in a packet that 'kinetic' received.
Random corruption isn't likely in that case, because the error is always
in the same place in the packet.  Check the 'netstat -i' numbers to see
if the drivers are picking up any packet errors.

It's hard to debug network problems in ssh, though, because (obviously)
you can't tell in general whether packet data is corrupt.  If you can
set up a test case with, say, UDP echo, that would be easier to see the
damage to the packets if they are, in fact, being corrupted.  

Unfortunately, I'm so used to having sophisticated test equipment in the
lab to look at these kinds of problems that I'm probably missing what
would be obvious to someone who deals with problems "in the field."
Hope I've been somewhat helpful anyway.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: X not responding

2010-06-23 Thread Richard T C Farnes
On Tuesday 22 June 2010 19:52:54 Andy Balholm wrote:
> I am having a problem with Xorg under FreeBSD 8.0 RELEASE and 8.1 RC1:
>
> When I type startx, the X server starts, and some xterm windows open, but
> it will not respond to keyboard or mouse input. The mouse pointer won't
> move, and the only keyboard input that does anything is CTRL-ALT-F1 etc. to
> switch virtual terminals.
>
> If I install FreeBSD 7.1, which installs Xorg straight from the
> installation CD, it works fine. Under version 8, I've tried installing from
> ports and packages, and I get this problem.
>
> When I first had this problem, I was running it under VirtualBox, so I
> thought maybe it was because VirtualBox's FreeBSD support is incomplete.
> But now I've tried it on real PC hardware, and I have the same problem.
>
> Obviously some people must be running X under FreeBSD 8, so I must be doing
> something wrong in my installation or configuration, but I can't guess what
> it is.
>
> Andy Balholm
> (509) 276-2065
> a...@balholm.com
>
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscr...@freebsd.org"

Here it looks like you have made some mistakes in the configuring file for X. 
You did not mention that  you have configured it. After X has been installed 
you must  go into the X configuration file and configure  your keyboard and 
mouse etc  for use with it. When I installed X on my version 7 BSD I had to 
use some time tuning this file so X would work properly. The file gives you 
alternatives like which language keyboard you use and how your mouse works 
and other settings.

Regards
Richard Farnes
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Running Older Binaries under 8.0

2010-06-23 Thread b. f.
oklahoma wrote:
>>   /usr/ports/misc/compat6x
>>
>is there any difference between the port and kernel options
>compat_freebsd6 beside compiling of kernel vs installing port?

Yes. The kernel options provide kernel compatibility and the ports
provide userland compatibility.  You need both to run older binaries.

b.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: before i even =touch= my server again....

2010-06-23 Thread Polytropon
On Wed, 23 Jun 2010 13:03:03 -0500, Kirk Strauser  wrote:
> On 06/23/10 11:35, Polytropon wrote:
> > Of course, all write attempts to /var will then fail.
> 
> Or even worse: they'll succeeded. And then when you re-mount /var, 
> you'll lose access to all the files you've written in the mean time.

True, an important advice. In case /var is not mounted, the
/var directory on / will be just a "plain directory". Depending
on program behaviour, it is possible that logging programs
create a new file when missing a file to append. In this case,
/ will fill with such files in /var. It's important to remove
them prior to re-mounting /var. It is possible to move them,
e. g. to /tmp, and immediately append them to the correct files
after re-mounting /var. But if (small) data loss is acceptable
for the time needed to fix /var, it is an option.

Another possibility is - but I never tried it - to force fsck
to check a mounted partition that is in use.

# fsck -yf /var

This may (!) cause other forms of damage, allthough fsck should
be able to correct most usual problems.

It's a good approach to stop as many services as possible that
could want to write to /var, and restart them after /var is clean
and mounted again.




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: before i even =touch= my server again....

2010-06-23 Thread Kirk Strauser

On 06/23/10 11:35, Polytropon wrote:

Of course, all write attempts to /var will then fail.


Or even worse: they'll succeeded. And then when you re-mount /var, 
you'll lose access to all the files you've written in the mean time.


--
Kirk Strauser

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: iptables equivaelnt

2010-06-23 Thread krad
On 22 June 2010 20:36, Erik Norgaard  wrote:

> On 21/06/10 20.06, pete wright wrote:
>
>> On Jun 21, 2010, at 10:28 AM, Jean-Paul Natola wrote:
>>>
 I'm particuclary trying to implement some  type of rate control as we
 are getting hammered by spam.

>>>
>> I'd humbly suggest pf + spamd if you are concerned specifically about
>> stopping spam, both are supported by freebsd and i have had great
>> success using these tools to combat spam.
>>
>
> spamd does not stop spam. It is intented to increase the cost of sending
> spam at little cost to your server by keeping the spammer busy trying.
>
> If you're concerned with blocking spam from a limited set of known sources,
> then you can create block lists in your firewall. If you know that you will
> not receive legitimate mails from certain countries, you can block their
> assigned IP ranges.
>
> If you're trying to block large number of unknown sources, then I suggest
> subscribing to spamhaus' lists and configure your server to adhere strictly
> to the protocols.
>
> You may wish to subscribe to lists of dynamic ip-ranges. These are often
> considered spam sources hosting a large number of bot-nets  However, you may
> also block mail from legitimate servers run by people who like to run their
> own home server - such as FreeBSD users.
>
> There is only limited benefit of some kind of rate control and I believe
> that such controls must be implemented in your mail server. Implementing
> rate control mail also delay legitimate mail, and depending on how you do
> it, spammers may even cause a DOS against your server.
>
> Anyway, to avoid spammers eating up server resources, check your server
> config:
>
> 1. ensure that the spam decision is reached as fast as possible
> 2. consider early whitelisting of the most common legitimate mail sources
> 3. DNS block lists should be last as they add additional delay, possibly
> you can configure a local dns cache to shorten delay
>
> BR, Erik
> --
> Erik Nørgaard
> Ph: +34.666334818/+34.915211157  http://www.locolomo.org
>
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscr...@freebsd.org"
>


true spamd doesnt block spam it rates it. However these ratings on host can
be used to build an ip list which can be applied to a pf table.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: before i even =touch= my server again....

2010-06-23 Thread Polytropon
On Tue, 22 Jun 2010 22:14:20 -0700, Gary Kline  wrote:
> fsck seemed to fix most slices, but a check as root 
> told me the /var was//IS still dirty.   Q:  how can i umount /var 
> and run fsck -y without going single-user?  remember that in order to 
> regain keyboard control of ethic i have to crawl under deskm, muck
> around, etc.

There is a way that can be used (allthough it usually should not):

# umount -f /var
# fsck /var

Of course, all write attempts to /var will then fail. If /var is
in a clean state again, run

# mount /var

to make it accessible again. Before you re-mount, make sure that
there are no offending files in the mountpoint /var (which should
be empty while unmounted).


> how does fsck work, backgrounded? 

Bad. :-) No, seriously, I just don't trust it. I can stand downtine,
so I better let fsck do its work on unmounted partitions than letting
it run in the background, while the system boots up with possibly
dirty partitions... and you never know what else can happen. I
usually take the time neccessary for a foreground-fsck - it's not
that it needs to be done twice a day. :-)





-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Running Older Binaries under 8.0

2010-06-23 Thread oklahoma

Chuck Swiger wrote:



ises?



Yes, you want:

  /usr/ports/misc/compat6x

is there any difference between the port and kernel options 
compat_freebsd6 beside compiling of kernel vs installing port?


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: which /etc/src.conf options prevent moused rebuilding?

2010-06-23 Thread Dan Nelson
In the last episode (Jun 23), Anton Shterenlikht said:
> On Wed, Jun 23, 2010 at 09:47:25AM -0500, Dan Nelson wrote:
> > In the last episode (Jun 23), Anton Shterenlikht said:
> > > I've an old slow i386 running -current r209398
> > > 
> > > Because it's slow I don't build everything. Here's my
> > > /etc/src.conf:
> > > 
> > [...]
> > > WITHOUT_LEGACY_CONSOLE=
> > [...] 
> > > followed by the standard update procedure
> > > 
> > > # make buildworld
> > > # make buildkernel
> > > # make installkernel
> > > # reboot (single user)
> > > # make installworld
> > > # mergemaster
> > > # make delete-old
> > > # make delete-old-libs
> > > 
> > > I was left with old moused:
> > > 
> > > # moused
> > > /libexec/ld-elf.so.1: Shared object "libutil.so.8" not found, required by 
> > > "moused"
> > > #
> > 
> > >From /usr/src/usr.sbin/Makefile :
> > 
> > # XXX MK_SYSCONS
> > # XXX is moused w/ usb useful?
> > .if ${MK_LEGACY_CONSOLE} != "no"
> > _kbdcontrol=kbdcontrol
> > _kbdmap=kbdmap
> > _moused=moused
> > _vidcontrol=vidcontrol
> > .endif
> > 
> > Setting WITHOUT_LEGACY_CONSOLE= sets MK_LEGACY_CONSOLE=no, which
> > disables moused.  It should probably be removed and built
> > unconditionally, since yes, moused is useful with usb :)
> 
> Dan, many thanks
> 
> I wish src.conf(5) man page were more descriptive on this option.
> At present it only contains:
> 
>  WITHOUT_LEGACY_CONSOLE
>  Set to not build programs that support a legacy PC console;
>  e.g.  kbdcontrol(8) and vidcontrol(8).
> 
> so I though it doesn't affect moused.

Also note that "legacy PC console" means syscons, so unless this is a
headless machine you only connect to via a serial port or ssh, you probably
want to leave it enabled.

-- 
Dan Nelson
dnel...@allantgroup.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: FreeBSD router - large scale

2010-06-23 Thread Kevin Wilcox
On 27 May 2010 12:12, Matthew Seaman  wrote:

> The hardest job I've had an OpenBSD firewall do is actually as a
> mid-level firewall between a DMZ full of web servers and a back-end
> database layer.  The thing to watch out for is running out of states in
> PF.  It's trivial to change that in the config, and given a machine with
> 1GB or so RAM dedicated to running PF, you can up the number of states
> by a factor of a hundred or more without problem.  Also if you know all
> your connections are from directly attached networks and very low
> latency, you can be a lot more aggressive about dropping old states.

Matthew -

thanks for the information! For other reasons I'm limited to about
500k states...since our typical hardware build has at least 4GB of
RAM, I'm not overly concerned about RAM exhaustion when routing. As I
stated in another post the potential for something like a squid cache
does exist, in which case I'll take all the RAM I can get my hands on
(a 16GB+ build is not out of the question at that point).

Preliminary testing has been favorable. My big concerns have mostly
been related to state and packets per second. The first test
environment was as follows:


| one NIC, 4 routable addresses
|
|
 --
 |   FreeBSD 8 Router  |
 --
|
| one NIC with aliases for
| 10.10.10.254
| 10.10.20.254
| 10.10.30.254
| 10.10.40.254
|
  
  |switch|
  

Attached to the switch are four workstations/laptops:

10.10.10.1/255.255.255.0
10.10.20.1/255.255.255.0
10.10.30.1/255.255.255.0
10.10.40.1/255.255.255.0

All connections are gigabit.

The idea is that in a production environment, we'll have multiple /22
networks coming in so I wanted to test having multiple network
aliases. There will be a pool of public addresses for the outside
interface(s), possibly as large as a class C but probably 20 - 30
addresses.

By using sticky-address on a NAT rule, we can watch each RFC-1918
address get mapped to a different outside address via round-robin
while enforcing that all connections from one inside host are
consistently mapped to the same external address. Generating 10k
active pings on each of the workstations/laptops, we were able to get
an idea of how the machine would respond with 80k active states (two
per connection, one in each direction). Adding in a couple of
BitTorrent and HTTP .iso downloads only supported the conclusions we
were beginning to form.

Currently I'm testing it with multiple BitTorrent downloads and a very
lively World of Warcraft installer. While nowhere near an indication
of what we could expect in production it is showing us RAM usage,
processor usage and state maintenance behaviour that gives us pretty
good indications that we can go ahead and test in a larger
environment. Like I said, we are otherwise limited to approximately
500k states (actually 250k connections) and only about half of that
will be allotted for the population this project is targeting so
testing with 100k states is actually pretty realistic at this point.
We will wait, of course, to attempt a production deployment until
after we have tested with a larger sample of the target population.

Thanks to everyone for their comments and suggestions, both on and off list!

kmw

-- 
A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: which /etc/src.conf options prevent moused rebuilding?

2010-06-23 Thread Anton Shterenlikht
On Wed, Jun 23, 2010 at 09:47:25AM -0500, Dan Nelson wrote:
> In the last episode (Jun 23), Anton Shterenlikht said:
> > I've an old slow i386 running -current r209398
> > 
> > Because it's slow I don't build everything. Here's my
> > /etc/src.conf:
> > 
> [...]
> > WITHOUT_LEGACY_CONSOLE=
> [...] 
> > followed by the standard update procedure
> > 
> > # make buildworld
> > # make buildkernel
> > # make installkernel
> > # reboot (single user)
> > # make installworld
> > # mergemaster
> > # make delete-old
> > # make delete-old-libs
> > 
> > I was left with old moused:
> > 
> > # moused
> > /libexec/ld-elf.so.1: Shared object "libutil.so.8" not found, required by 
> > "moused"
> > #
> 
> >From /usr/src/usr.sbin/Makefile :
> 
> # XXX MK_SYSCONS
> # XXX is moused w/ usb useful?
> .if ${MK_LEGACY_CONSOLE} != "no"
> _kbdcontrol=kbdcontrol
> _kbdmap=kbdmap
> _moused=moused
> _vidcontrol=vidcontrol
> .endif
> 
> Setting WITHOUT_LEGACY_CONSOLE= sets MK_LEGACY_CONSOLE=no, which disables
> moused.  It should probably be removed and built unconditionally, since yes,
> moused is useful with usb :)

Dan, many thanks

I wish src.conf(5) man page were more descriptive on this option.
At present it only contains:

 WITHOUT_LEGACY_CONSOLE
 Set to not build programs that support a legacy PC console; e.g.
 kbdcontrol(8) and vidcontrol(8).

so I though it doesn't affect moused.

Maybe I should post to @doc about this..

thank you again
anton

-- 
Anton Shterenlikht
Room 2.6, Queen's Building
Mech Eng Dept
Bristol University
University Walk, Bristol BS8 1TR, UK
Tel: +44 (0)117 331 5944
Fax: +44 (0)117 929 4423
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: FreeBSD router - large scale

2010-06-23 Thread Kevin Wilcox
On 28 May 2010 07:38, Bruce Cran  wrote:

> This is possibly the wrong place to be saying this, but isn't OpenBSD
> usually recommended for
> routers? I believe the version of pf, for example, is normally kept more
> up-to-date than than
> in FreeBSD.  The major downside I know of is that it's not nearly as
> user-friendly; for example
> my recollection of its installer is that you have to input sector offsets
> manually in the partition editor!

Bruce - sorry for taking so long to reply, this project has been slow-moving.

Yes, you are correct, OpenBSD is typically used in this situation and,
if the project were strictly for a routing component, it may indeed be
a better choice. My concern was that if we decided to add any proxy
capability then we would need much more RAM than OpenBSD could address
(this will front at least 8k users).

I have found the OpenBSD installer to be quite friendly but that's
probably because it is pretty minimal and just sort of "clicks" with
me. As long as you're dedicating the system to *BSD, I generally
prefer the OpenBSD installer for its flow but have found no particular
allegiance with either their installer or sysinstall. As long as I can
have a running system within four or five minutes of powering on with
the install CD, I don't really care.

kmw

-- 
A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: which /etc/src.conf options prevent moused rebuilding?

2010-06-23 Thread Dan Nelson
In the last episode (Jun 23), Anton Shterenlikht said:
> I've an old slow i386 running -current r209398
> 
> Because it's slow I don't build everything. Here's my
> /etc/src.conf:
> 
[...]
> WITHOUT_LEGACY_CONSOLE=
[...] 
> followed by the standard update procedure
> 
> # make buildworld
> # make buildkernel
> # make installkernel
> # reboot (single user)
> # make installworld
> # mergemaster
> # make delete-old
> # make delete-old-libs
> 
> I was left with old moused:
> 
> # moused
> /libexec/ld-elf.so.1: Shared object "libutil.so.8" not found, required by 
> "moused"
> #

>From /usr/src/usr.sbin/Makefile :

# XXX MK_SYSCONS
# XXX is moused w/ usb useful?
.if ${MK_LEGACY_CONSOLE} != "no"
_kbdcontrol=kbdcontrol
_kbdmap=kbdmap
_moused=moused
_vidcontrol=vidcontrol
.endif

Setting WITHOUT_LEGACY_CONSOLE= sets MK_LEGACY_CONSOLE=no, which disables
moused.  It should probably be removed and built unconditionally, since yes,
moused is useful with usb :)

-- 
Dan Nelson
dnel...@allantgroup.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: sparse image

2010-06-23 Thread Pieter de Goeje
On Wednesday 23 June 2010 12:54:48 Vincent Hoffman wrote:
> On 23/06/2010 11:26, Aiza wrote:
> > Is there an equivalent of the MAC sparseimage on FreeBSD?
> 
> If you mean you would like to make a sparse file and attach it using
> mdconfg then
> dd if=/dev/zero of=/path/to/outfile bs=1M seek=1024 count=0
> This will give you a sparse file that reports a gig in size, but only
> uses whats actually in use.

Note that "truncate -s 1G file" will do the same with IMHO easier syntax.

- Pieter
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


which /etc/src.conf options prevent moused rebuilding?

2010-06-23 Thread Anton Shterenlikht
I've an old slow i386 running -current r209398

Because it's slow I don't build everything. Here's my
/etc/src.conf:

WITHOUT_ACPI=
WITHOUT_AT=
WITHOUT_ATM=
WITHOUT_AUTHPF=
WITHOUT_BIND_DNSSEC=
WITHOUT_BIND_ETC=
WITHOUT_BIND_LIBS_LWRES=
WITHOUT_BIND_MTREE=
WITHOUT_BIND_NAMED=
WITHOUT_BLUETOOTH=
WITHOUT_BSNMP=
WITHOUT_CALENDAR=
WITHOUT_CDDL=
WITHOUT_CLANG=
WITHOUT_CTM=
WITHOUT_CVS=
WITHOUT_DICT=
WITHOUT_FREEBSD_UPDATE=
WITHOUT_GAMES=
WITHOUT_HTML=
WITHOUT_INFO=
WITHOUT_IPFILTER=
WITHOUT_IPFW=
WITHOUT_IPX=
WITHOUT_JAIL=
WITHOUT_KERBEROS=
WITHOUT_LEGACY_CONSOLE=
WITHOUT_NDIS=
WITHOUT_NIS=
WITHOUT_NS_CACHING=
WITHOUT_PF=
WITHOUT_PORTSNAP=
WITHOUT_PPP=
WITHOUT_QUOTAS=
WITHOUT_RCMDS=
WITHOUT_RCS=
WITHOUT_ROUTED=
WITHOUT_SHAREDOCS=
WITHOUT_WIRELESS=
WITHOUT_WPA_SUPPLICANT_EAPOL=

I did

# svn up
# svn diff
#

followed by the standard update procedure

# make buildworld
# make buildkernel
# make installkernel
# reboot (single user)
# make installworld
# mergemaster
# make delete-old
# make delete-old-libs

I was left with old moused:

# moused
/libexec/ld-elf.so.1: Shared object "libutil.so.8" not found, required by 
"moused"
#

So I had to manually do

# cd /usr/src/usr.sbin/moused/
# make cleandir && make obj && make && make install

and got moused updated:

# ldd /usr/sbin/moused
/usr/sbin/moused:
libutil.so.9 => /lib/libutil.so.9 (0x28095000)
libm.so.5 => /lib/libm.so.5 (0x280a6000)
libc.so.7 => /lib/libc.so.7 (0x280c)


So my question is:

Is it one of my /etc/src.conf options that prevented
moused from rebuilding?

Or is this caused by something else?

many thanks
anton

-- 
Anton Shterenlikht
Room 2.6, Queen's Building
Mech Eng Dept
Bristol University
University Walk, Bristol BS8 1TR, UK
Tel: +44 (0)117 331 5944
Fax: +44 (0)117 929 4423
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: sparse image

2010-06-23 Thread Matthew Seaman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 23/06/2010 11:26:43, Aiza wrote:
> Is there an equivalent of the MAC sparseimage on FreeBSD?

A filesystem image that only takes up as much space as the total of all
the files within it?

Not exactly.  There are many archiving formats -- dump, tar, cpio, etc.
etc. which fulfill the space usage criterion, but they aren't filesystem
images in the sense that you could mount them on your system.

Probably the closest thing is to create a .iso image using something
like growisofs(1m) (from the sysutils/dvd+rw-tools port), but while you
can mount a .iso as a file-backed metadevice you can't mount it read/write.

There is the Union FS type -- see mount_unionfs(8) -- where the overlay
layer just contains the changed files made since the filesystem was
mounted.  Which is sort-of what you're asking about, but not quite the
same thing.

Cheers,

Matthew

- -- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwh6sgACgkQ8Mjk52CukIwnygCff0nTR8a2JVstLTO02f3Fm48w
IMAAnisQv09vAHlgaTRXvIKRgvNeh4Ga
=ggfk
-END PGP SIGNATURE-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: sparse image

2010-06-23 Thread Vincent Hoffman
On 23/06/2010 11:26, Aiza wrote:
> Is there an equivalent of the MAC sparseimage on FreeBSD?
If you mean you would like to make a sparse file and attach it using
mdconfg then
dd if=/dev/zero of=/path/to/outfile bs=1M seek=1024 count=0
This will give you a sparse file that reports a gig in size, but only
uses whats actually in use.
you can then use mdconfig(8) to allow this to be partitioned formatted
and mounted.
Example below. see also
http://www.freebsd.org/doc/en/books/handbook/disks-virtual.html although
that example doesnt use a spare file.

[r...@ostracod /scratch/media]# dd if=/dev/zero of=foo.img bs=1M
seek=1024 count=0
0+0 records in
0+0 records out
0 bytes transferred in 0.66 secs (0 bytes/sec)
[r...@ostracod /scratch/media]# ls -lh foo.img
-rw-r--r--  1 root  wheel   1.0G Jun 23 11:45 foo.img
[r...@ostracod /scratch/media]# du -h foo.img
 48Kfoo.img
[r...@ostracod /scratch/media]# mdconfig -a -t vnode -f foo.img
md0
[r...@ostracod /scratch/media]# gpart create -s gpt md0
md0 created
[r...@ostracod /scratch/media]# gpart add -t freebsd-ufs md0
md0p1 added
[r...@ostracod /scratch/media]# newfs /dev/md0p1
/dev/md0p1: 1024.0MB (2097084 sectors) block size 16384, fragment size 2048
using 6 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
 160, 376416, 752672, 1128928, 1505184, 1881440
[r...@ostracod /scratch/media]# !ls
ls -lh foo.img
-rw-r--r--  1 root  wheel   1.0G Jun 23 11:46 foo.img
[r...@ostracod /scratch/media]# !du
du -h foo.img
736Kfoo.img
[r...@ostracod /scratch/media]# mount /dev/md0p1 /mnt/foo/
[r...@ostracod /scratch/media]# df -h | grep foo
/dev/md0p1  989M4.0K910M 0%/mnt/foo
[r...@ostracod /scratch/media]#

Hope this is helpful.
Vince
 
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscr...@freebsd.org"

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


sparse image

2010-06-23 Thread Aiza

Is there an equivalent of the MAC sparseimage on FreeBSD?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Copy a FreeBSD 8* install to larger HD

2010-06-23 Thread Manolis Kiagias
On 23/06/2010 5:52 π.μ., Al Plant wrote:
> Aloha,
>
> I am looking for the easiest way to copy a fresh working FreeBSD 8* HD
> install (Manolis version) to a bigger HD that I found.
>
> I plan to have the new HD in the same box for doing this copy.
>
> Can I use sysinstall to make the new default slices on the big HD and
> then move the OS and directories/files to them?
>
> What command (utility) do I use? dd or cp or some other to copy the
> files.
>
> Thanks
>
>

Hey Al!

Back to your FreeBSD adventures, heh ;)

You can certainly use sysinstall to create the slice.
I suggest you use the command line bsdlabel to create the partitions.
On your current system, use dump/restore to dump /, /var and /usr to the
new disk directly (or you can save the dumps to some external disk and
use it via fixit if you don't wish to mount both drives on the same
machine). It would be best to run dump/restore in single user mode,
without mounting /usr and /var, or at least with the minimum number of
processes running. If you do run on a live filesystem, use the -L flag
in dump (I've had some problems with this on large filesystems).
Email me if you need more detailed instructions, I am currently
investigating this method as a quick installation system for my custom
FreeBSD systems.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Problems running Bacula BAT

2010-06-23 Thread Alex Huth
On Tue, Jun 22, 2010 at 03:42:36PM +0200, Cato Myhrhagen wrote:
> 
> Now I checked the log (/var/db/backula/log) and got the following error
> message:
> 22-Jun 10:31 backupserver.domainname.no-dir: ERROR in authenticate.c:418
> Unable to authenticate console "*UserAgent*" at client:127.0.0.1:36131.
> 
Try first to connect to the director using bconsole. It seems the
passwords between director and fd or sd are different.

Greetings

Alex Huth
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


libneon.so: undefined reference to `SSL_SESSION_cmp'

2010-06-23 Thread Ewald Jenisch
Hi,

During upgrading my ports I run into very nasty problems compiling
e.g. sound-juicer or libmisicbrainz3, or more generally, ports that
depend on neon28:

Compilatino of e.g sound-juicer stops with the following error:

-- < Cut here > --

.
.
.
gmake[3]: Leaving directory 
`/usr/ports/audio/sound-juicer/work/sound-juicer-2.28.2/libjuicer'
gmake[2]: Leaving directory 
`/usr/ports/audio/sound-juicer/work/sound-juicer-2.28.2/libjuicer'
Making all in src
gmake[2]: Entering directory 
`/usr/ports/audio/sound-juicer/work/sound-juicer-2.28.2/src'
  CC sound_juicer-sj-main.o
  CC sound_juicer-sj-prefs.o
  CC sound_juicer-sj-play.o
  CC sound_juicer-sj-about.o
  CC sound_juicer-sj-extracting.o
  CC sound_juicer-sj-inhibit.o
  CC sound_juicer-sj-genres.o
  CC sound_juicer-gedit-message-area.o
  CC sound_juicer-gconf-bridge.o
  CC sound_juicer-egg-play-preview.o
  CC sound_juicer-bacon-message-connection.o
  CXXLD  sound-juicer
/usr/local/lib/libneon.so: undefined reference to `SSL_SESSION_cmp'
gmake[2]: *** [sound-juicer] Error 1
gmake[2]: Leaving directory 
`/usr/ports/audio/sound-juicer/work/sound-juicer-2.28.2/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory 
`/usr/ports/audio/sound-juicer/work/sound-juicer-2.28.2'
gmake: *** [all] Error 2
*** Error code 1

Stop in /usr/ports/audio/sound-juicer.

-- < Cut here > --

/usr/local/lib/libneon.so comes from /usr/ports/www/neon28, so I did a
de-install, make clean, make install of neon28. Compilation &
installation went OK, however when I tried to compile sound-juicer
again I got the error "/usr/local/lib/libneon.so: undefined reference
to `SSL_SESSION_cmp'.

Please note that I've got openssl installed from ports,
i.e. /usr/ports/security/openssl. neon28 correctly lists it as
dependency:

# pkg_info -rx neon28
Information for neon28-0.28.6_1:

Depends on:
Dependency: expat-2.0.1_1
Dependency: openssl-1.0.0_2
Dependency: libiconv-1.13.1_1
Dependency: gettext-0.18_1
#


I even tried to do a portupgrade -frR neon28 - again stops with the
error above :-(

So here are my questions:

o) Has anybody out there seen this before?

o) Any known cure against it?

Thanks much in advance for any clue,
-ewald






___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: portupgrade -af in FreeBSDupdate to 8.0

2010-06-23 Thread Matthew Seaman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 23/06/2010 08:29:41, n dhert wrote:
> Why does it stop? Can it be avoided? Or can I make portupgrade -af start
> from where it got so far in the first run ?

portupgrade is written in ruby -- having its command interpreter ripped
out from underneath it does tend to cramp its style somewhat.  Actually,
the specific reason it crashes is the ruby-18-dbXX module, which also
needs to be recompiled.

The best way around the problem is to delete portupgrade and everything
it depends on, and then reinstall from the ports directly:

# pkg_deinstall -Rf portupgrade-2.4.6_4,2
# cd /usr/ports/ports-mgmt/portupgrade
# make install
# make clean

If you do this first, you can then run portupgrade -af, which will
recompile ruby and dependencies, but because everything is already
recompiled, its compatible and you don't get a crash.

> I could do # portupgrade -af  again, but this is again "everything" (11
> hours)...

Fix portupgrade as shown above, then run something like this:

   # portupgrade -x ">=2010-06-23" -af

This says: "upgrade everything, except those packages installed more
recently than 2010-06-23."  You should chose the date where you
*started* your original portupgrade -af session.

Cheers,

Matthew

- -- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwhzMcACgkQ8Mjk52CukIzDsACeNRckO4634CcnAKcBPDduooos
afIAnRsAWncQzPAndKR7v6ulNYdHIEXF
=oSps
-END PGP SIGNATURE-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: portupgrade -af in FreeBSDupdate to 8.0

2010-06-23 Thread Chris Rees
On 23 June 2010 08:29, n dhert  wrote:
> in the process of upgrading 7.2 -> 8.0, the last step is to recompile all
> ports
> (section 24.2.3 of freebsd manual)
> # portupgrade -f ruby
> # rm /var/db/pkg/pkgdb.db
> # portugprade -f ruby18-bdb
> # rm /var/db/pkg/pkgdb.db /usr/ports/INDEX-*.db
>
> # portupgrade -af
>
> Did that for my 760 ports, but after 499 ports reinstalled (and 11 hours),
> it stopped




> Why does it stop? Can it be avoided? Or can I make portupgrade -af start
> from where it got so far in the first run ?
>
>
> I could do # portupgrade -af  again, but this is again "everything" (11
> hours)...
>
> I noticed on a different system (with only 64 ports), that it stopped at
> lang/ruby18 there as well,
> and after again # portugprade -af (which then continued past lang/ruby18),
> it stopped a second time
> in the same manner at
>  --->  Reinstallation of databases/ruby-bdb ended at: Mon, 14 Jun 2010
> 13:01:25
>  +0200 (consumed 00:00:28)

AFAICR, portupgrade is written in Ruby, so strange things can happen
if you pull the carpet out from under it like that. Not really your
fault...

I suggest you look at the man page for pkg_glob, and look for the kind
of glob to supply for portupgrade; for example:

 The following command line arguments are supported:

 pkgname_globSpecify one of these: a full pkgname, a pkgname with-
 out version, or a shell glob pattern to match against
 pkgnames or their origins in which you can use wild-
 cards `*', `?', and `[..]', an extended regular
 expression preceded by a colon `:' to match against
 pkgnames or their origins, or a date range specifica-
 tion preceded by either `<' or `>'.

So try

[ch...@amnesiac]~% sudo portupgrade -f '<2010-06-22'

That should reinstall all the ports that were installed before yesterday.

HTH

Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


portupgrade -af in FreeBSDupdate to 8.0

2010-06-23 Thread n dhert
in the process of upgrading 7.2 -> 8.0, the last step is to recompile all
ports
(section 24.2.3 of freebsd manual)
# portupgrade -f ruby
# rm /var/db/pkg/pkgdb.db
# portugprade -f ruby18-bdb
# rm /var/db/pkg/pkgdb.db /usr/ports/INDEX-*.db

# portupgrade -af

Did that for my 760 ports, but after 499 ports reinstalled (and 11 hours),
it stopped with
...
===>  Cleaning for ruby+nopthreads-1.8.7.248_2,1
--->  Removing temporary files and directories
--->  Removing old package'
--->  Installation of lang/ruby18 ended at: Wed, 23 Jun 2010 01:06:29 +0200
(con
sumed 00:00:12)
--->  Cleaning out obsolete shared libraries
[Updating the pkgdb  in /var/db/pkg ... Inappropriate file
type
 or format - /var/db/pkg/pkgdb; rebuild needed] [Rebuilding the pkgdb
 in /var/db/pkg ... - 760 packages found (-0 +760) 
700.
... done]
--->  Reinstallation of lang/ruby18 ended at: Wed, 23 Jun 2010 01:07:57
+0200 (c
onsumed 00:04:09)
--->  ** Upgrade tasks 748: 497 done, 12 ignored, 1 skipped and 0 failed
--->  Session ended at: Wed, 23 Jun 2010 01:07:57 +0200 (consumed 10:28:19)
/usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:215:in `origin':
/var/db/pkg/pkgdb.db
: unexpected file type or format -- Invalid argument (PkgDB::DBError)
from /usr/local/lib/ruby/site_ruby/1.8/pkginfo.rb:205:in `origin'
from /usr/local/lib/ruby/site_ruby/1.8/pkgtools.rb:245:in
`config_includ
e?'
from /usr/local/lib/ruby/site_ruby/1.8/pkgtools.rb:215:in
`config_ignore
_moved?'
from /usr/local/sbin/portupgrade:942:in `do_upgrade'
from /usr/local/sbin/portupgrade:816:in `main'
from /usr/local/sbin/portupgrade:812:in `each'
from /usr/local/sbin/portupgrade:812:in `main'
from /usr/local/lib/ruby/1.8/optparse.rb:791:in `initialize'
from /usr/local/sbin/portupgrade:229:in `new'
from /usr/local/sbin/portupgrade:229:in `main'
from /usr/local/sbin/portupgrade:2213
#
# pkgdb -F
--->  Checking the package registry database
#

Why does it stop? Can it be avoided? Or can I make portupgrade -af start
from where it got so far in the first run ?


I could do # portupgrade -af  again, but this is again "everything" (11
hours)...

I noticed on a different system (with only 64 ports), that it stopped at
lang/ruby18 there as well,
and after again # portugprade -af (which then continued past lang/ruby18),
it stopped a second time
in the same manner at
 --->  Reinstallation of databases/ruby-bdb ended at: Mon, 14 Jun 2010
13:01:25
 +0200 (consumed 00:00:28)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"