RE: ZFS install on a partition

2013-05-18 Thread Ivailo Tanusheff
Hi,

The overhead depends of the quantity of the changes you made since the oldest 
snapshot and the current data on the ZFS pool.
The snapshots keep only the differences between the live system and each other, 
so if you have made 10GB changes over the last 7 days and your oldest snapshot 
is 7 days old - then the overhead will be a little more than 10GB (because of 
the system info) :)
So this is very efficient way to make the things run.

Just keep in mind that having a lot of snapshots can decrease performance when 
you create/delete a snapshot, as the system should calculate the changes.

Best regards,
Ivailo Tanusheff

-Original Message-
From: owner-freebsd-questi...@freebsd.org 
[mailto:owner-freebsd-questi...@freebsd.org] On Behalf Of b...@todoo.biz
Sent: Saturday, May 18, 2013 8:33 AM
To: Liste FreeBSD
Subject: Re: ZFS install on a partition


Le 18 mai 2013 à 06:49, kpn...@pobox.com a écrit :

 On Fri, May 17, 2013 at 08:03:30PM -0400, Paul Kraus wrote:
 On May 17, 2013, at 6:24 PM, b...@todoo.biz b...@todoo.biz wrote:
 3. Should I avoid using ZFS since my system is not well tuned and It would 
 be asking for trouble to use ZFS in these conditions. 
 
 No. One of the biggest benefits of ZFS is the end to end data integrity.
 IF there is a silent fault in the HW RAID (it happens), ZFS will 
 detect the corrupt data and note it. If you had a mirror or other 
 redundant device, ZFS would then read the data from the *other* copy 
 and rewrite the bad block (or mark that physical block bad and use another).
 
 I believe the copies=2 and copies=3 option exists to enable ZFS to 
 self heal despite ZFS not being in charge of RAID. If ZFS only has a 
 single LUN to work with, but the copies=2 or more option is set, then 
 if ZFS detects an error it can still correct it.
 
 This option is a dataset option, is inheritable by child datasets, and 
 can be changed at any time affecting data written after the change. To 
 get the full benefit you'll therefore want to set the option before 
 putting data into the relevant dataset.

Ok, good to know.
I planned to setup a consistent Snapshot policy and remote backup using zfs 
send / receive That should be enough for me. 

Is the overhead of this setup equal to double size used on disk ? 


 
 -- 
 Kevin P. Nealhttp://www.pobox.com/~kpn/
 
 Nonbelievers found it difficult to defend their position in \ 
the presense of a working computer. -- a DEC Jensen paper


«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§

BSD - BSD - BSD - BSD - BSD - BSD - BSD - BSD - 

«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§

PGP ID -- 0x1BA3C2FD

___
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


RE: ZFS install on a partition

2013-05-18 Thread Ivailo Tanusheff
Hi,

If you use HBA/JBOD then you will rely on the software RAID of the ZFS system. 
Yes, this RAID is good, but unless you use SSD disks to boost performance and a 
lot of RAM the hardware raid should be more reliable and mush faster.
I didn't get if you want to use the system to dual boot Linux/FreeBSD or just 
to share FreeBSD space with linux.
But I would advise you to go with option 1 - you will get most of the system 
and obviously you don't need zpool with raid, as your LSI controller will do 
all the redundancy for you. Making software RAID over the hardware one will 
only decrease performance and will NOT increase the reliability, as you will 
not be sure which information is stored on which physical disk.

If stability is a MUST, then I will also advise you to go with bunch of pools 
and a disk designated as hot spare - in case some disk dies you will rely on 
the automation recovery. Also you should run monitoring tool on your raid 
controller.
You can also set copies=2/3 just in case some errors occur, so ZFS can 
auto0repair the data. if you run ZFS over several LUNs this will make even more 
sense. 

Best regards,
Ivailo Tanusheff

-Original Message-
From: owner-freebsd-questi...@freebsd.org 
[mailto:owner-freebsd-questi...@freebsd.org] On Behalf Of b...@todoo.biz
Sent: Saturday, May 18, 2013 1:24 AM
To: Liste FreeBSD
Subject: ZFS install on a partition

Hi, 

I have a question regarding ZFS install on a system setup using an Intel 
Modular. 

This system runs various flavor of FreeBSD and Linux using a shared pool 
(LUNs). 
These LUNs have been configured in RAID 6 using the internal controller (LSI 
logic). 

So from the OS point of view there is just a volume available. 


I know I should install a system using HBA and JBOD configuration - but 
unfortunately this is not an option for this server. 

What would you advise ? 

1. Can I use an existing partition and setup ZFS on this partition using a 
standard Zpool (no RAID). 

2. Should I use any other solution in order to setup this (like full ZFS 
install on disk using the entire pool with ZFS). 

3. Should I avoid using ZFS since my system is not well tuned and It would be 
asking for trouble to use ZFS in these conditions. 


P.S. Stability is a must for this system - so I won't die if you answer 3 and 
tell me to keep on using UFS. 


Thanks. 


___
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: ZFS install on a partition

2013-05-18 Thread Ivailo Tanusheff
Hi,

If you go with RAID6 setup on your RAID I think you will not need spare so 
much, as you will actually have data redundancy distributed over 2 disks.
I think you can use 2 or 3 LUNS, just to have more flexibility in the solution, 
but it is not a must :)

For the usage of two copies on pool named mypool issue:
zfs set copies=2 mypool

Best regards,
Ivailo Tanusheff

-Original Message-
From: b...@todoo.biz [mailto:b...@todoo.biz] 
Sent: Saturday, May 18, 2013 10:46 AM
To: Ivailo Tanusheff
Subject: Re: ZFS install on a partition


Le 18 mai 2013 à 09:21, Ivailo Tanusheff ivailo.tanush...@skrill.com a écrit :

 Hi,
 
 If you use HBA/JBOD then you will rely on the software RAID of the ZFS system.

This is the config of my backup system - not the one I am planning to update. 

 Yes, this RAID is good, but unless you use SSD disks to boost performance and 
 a lot of RAM the hardware raid should be more reliable and mush faster.

Ok 

 I didn't get if you want to use the system to dual boot Linux/FreeBSD or just 
 to share FreeBSD space with linux.

Neither one ! 
I want to setup a full FreeBSD only system. 
Will be used to deploy jails. 

 But I would advise you to go with option 1 - you will get most of the system 
 and obviously you don't need zpool with raid, as your LSI controller will do 
 all the redundancy for you. Making software RAID over the hardware one will 
 only decrease performance and will NOT increase the reliability, as you will 
 not be sure which information is stored on which physical disk.

Ok

 
 If stability is a MUST, then I will also advise you to go with bunch of pools 
 and a disk designated as hot spare - in case some disk dies you will rely on 
 the automation recovery. Also you should run monitoring tool on your raid 
 controller.

I can't do that because of the design of the machine I will use. 
I only have LUN's available configured as volume on top of a RAID 6 pool of 
disks. 

This is presented as a block device to the system. 

 You can also set copies=2/3 just in case some errors occur, so ZFS can 
 auto0repair the data. if you run ZFS over several LUNs this will make even 
 more sense. 

Ok I'll try to figure out how to do that during install in order to have that 
as soon as possible during the system install. 


Thx. 

 
 Best regards,
 Ivailo Tanusheff
 
 -Original Message-
 From: owner-freebsd-questi...@freebsd.org 
 [mailto:owner-freebsd-questi...@freebsd.org] On Behalf Of 
 b...@todoo.biz
 Sent: Saturday, May 18, 2013 1:24 AM
 To: Liste FreeBSD
 Subject: ZFS install on a partition
 
 Hi,
 
 I have a question regarding ZFS install on a system setup using an Intel 
 Modular. 
 
 This system runs various flavor of FreeBSD and Linux using a shared pool 
 (LUNs). 
 These LUNs have been configured in RAID 6 using the internal controller (LSI 
 logic). 
 
 So from the OS point of view there is just a volume available. 
 
 
 I know I should install a system using HBA and JBOD configuration - but 
 unfortunately this is not an option for this server. 
 
 What would you advise ? 
 
 1. Can I use an existing partition and setup ZFS on this partition using a 
 standard Zpool (no RAID). 
 
 2. Should I use any other solution in order to setup this (like full ZFS 
 install on disk using the entire pool with ZFS). 
 
 3. Should I avoid using ZFS since my system is not well tuned and It would be 
 asking for trouble to use ZFS in these conditions. 
 
 
 P.S. Stability is a must for this system - so I won't die if you answer 3 
 and tell me to keep on using UFS. 
 
 
 Thanks. 
 
 


«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§

BSD - BSD - BSD - BSD - BSD - BSD - BSD - BSD - 

«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§

PGP ID -- 0x1BA3C2FD



___
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


pkg version -L howto?

2013-05-18 Thread Leslie Jensen


I ran into a little problem with my old crontab scripts.

I do the following:

portsnap -I cron update

/usr/local/sbin/portmaster -y --clean-distfiles

/usr/local/sbin/portmaster -aF

pkg version -vIL


After changing to pkg the check for outdated ports fails on the -L flag

pkg version -vIL
pkg: option requires an argument -- L
usage: pkg version [-IPR] [-hoqv] [-l limchar] [-L limchar] [[-X] -s string]
   [-r reponame] [-O origin] [index]
   pkg version -t version1 version2
   pkg version -T pkgname pattern



According to pkg help version the -l -L should be followed by limchar.

Unfortunately it is not clear what limchar can be. Looking at the 
examples in help I drew the conclusion that limchar can be one of the 
following:

=   ? !


And in my case I would need the -L  to show which packages need to be 
updated. But that is not the case.


root@blj01~:pkg version -vIL=

root@blj01~:pkg version -vIL
Missing name for redirect.

root@blj01~:pkg version -vIL
Missing name for redirect.

root@blj01~:pkg version -vIL?
pkg: No match.

root@blj01~:pkg version -vIL!
Lists all installed packages


I would very much like a suggestion on how to get this right.

Thank you

/Leslie


___
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


pkg version -L howto?

2013-05-18 Thread Robert Huff

Leslie Jensen writes:
  pkg version -vIL
  pkg: option requires an argument -- L
  usage: pkg version [-IPR] [-hoqv] [-l limchar] [-L limchar] [[-X] -s string]
  [-r reponame] [-O origin] [index]
  pkg version -t version1 version2
  pkg version -T pkgname pattern
  
  According to pkg help version the -l -L should be followed by limchar.
  
  Unfortunately it is not clear what limchar can be. Looking at the 
  examples in help I drew the conclusion that limchar can be one of the 
  following:
  =   ? !

The limchar needs to be escaped, otherwise it gets picked off
by the shell.
Grepped for my crontab:

pkg version -vl \


Robert Huff  
___
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: License on the original BSD diff

2013-05-18 Thread Dag-Erling Smørgrav
Clifford Yapp cliffy...@gmail.com writes:
 The issue is of some interest because the wiki page documenting
 candidates to replace GPL software in base list the OpenBSD copies of
 the diff tools: [...]

We already have working BSD-licensed versions of diff and diff3 in the
SoC repo.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: Compiling a lean kernel of 9.1 p3

2013-05-18 Thread Lowell Gilbert
Tommy Pham tommy...@gmail.com writes:

 On Wed, May 15, 2013 at 10:43 AM, Tommy Pham tommy...@gmail.com wrote:

 Hi everyone,

 I installed 9.1 from DVD with src only and did 'freebsd-update fetch
 install'.  Then I proceed to compile the lean kernel.  I'm unable to
 compile a lean (no SCSI, RAID, sound, USB, Firewire, NICs) kernel of 9.1 p3
 and without lib32 support.  I only needed SATA disk and em NIC support.
  The kernel compiled without errors.  However, on boot, it freezes after
 the menu screen.  My make.conf only have added (from default
 /usr/share/examples/etc):

 KERNCONF=custom
 CPUTYPE=?opteron

 I have no problem booting from GENERIC built kernel and buildworld with
 that make.conf.   Could someone please tell me how can I troubleshoot this?

 TIA,
 Tommy


 Hi again,

 I said that wrong... I meant that I was able to compile OK but unable to
 boot with a lean kernel.  I was able to boot buildworld and buildkernel of
 GENERIC.

The way to do this is to use a binary search. Start with a working
(GENERIC) kernel, then add half your changes in. If it fails, then you
know the problem is in the set of changes that you included. If it
works, the problem is in the set of changes you didn't include. It's a
little more complicated because there may well be a dependency, where
two options need to both be included or left out, but I'm sure you get
the idea.

Alternatively, you could include kernel debugging and see where the CPU
is executing after the hang. But this requires more programming knowledge.
___
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: ZFS install on a partition

2013-05-18 Thread Paul Kraus
On May 18, 2013, at 3:21 AM, Ivailo Tanusheff ivailo.tanush...@skrill.com 
wrote:

 If you use HBA/JBOD then you will rely on the software RAID of the ZFS 
 system. Yes, this RAID is good, but unless you use SSD disks to boost 
 performance and a lot of RAM the hardware raid should be more reliable and 
 mush faster.

Why will the hardware raid be more reliable ? While hardware raid is 
susceptible to uncorrectable errors from the physical drives (hardware raid 
controllers rely on the drives to report bad reads and writes), and the 
uncorrectable error rate for modern drives is such that with high capacity 
drives (1TB and over) you are almost certain to run into a couple over the 
operational life of the drive. 10^-14 for cheap drives and 10^-15 for better 
drives, very occasionally I see a drive rated for 10^-16. Run the math and see 
how many TB worth of data you have to write and read (remember these failures 
are generally read failures with NO indication that a failure occurred, bad 
data is just returned to the system).

In terms of performance HW raid is faster, generally due to the cache 
RAM built into the HW raid controller. ZFS makes good use of system, RAM for 
the same function. An SSD can help with performance if the majority of writes 
are sync (NFS is a good example of this) or if you can benefit from a much 
larger read cache. SSDs are deployed with ZFS as either write LOG devices (in 
which case they should be mirrored), but they only come into play for SYNC 
writes; and as an extension of the ARC, the L2ARC, which does not have to be 
mirrored as it is only a cache of existing data for spying up reads.

 I didn't get if you want to use the system to dual boot Linux/FreeBSD or just 
 to share FreeBSD space with linux.
 But I would advise you to go with option 1 - you will get most of the system 
 and obviously you don't need zpool with raid, as your LSI controller will do 
 all the redundancy for you. Making software RAID over the hardware one will 
 only decrease performance and will NOT increase the reliability, as you will 
 not be sure which information is stored on which physical disk.
 
 If stability is a MUST, then I will also advise you to go with bunch of pools 
 and a disk designated as hot spare - in case some disk dies you will rely on 
 the automation recovery. Also you should run monitoring tool on your raid 
 controller.

I think you misunderstand the difference between stability and 
reliability. Any ZFS configuration I have tried on FreeBSD is STABLE, having 
redundant vdevs (mirrors or RAIDzn) along with hot spares can increase 
RELIABILITY. The only advantage to having a hot spare is that when a drive 
fails (and they all fail eventually), the REPLACE operation can start 
immediately without you noticing and manually replacing the failed drive.

Reliability is a combination of reduction in MTBF (mean time between 
failure) and MTTR (mean time to repair). Having a hot spare reduces the MTTR. 
The other way to improve MTTR is to go with smaller drives to recede the time 
it takes the system to resilver a failed drive. This is NOT applicable in the 
OP's situation. I try very hard not so use drives larger than 1TB because 
resilver times can be days. Resilver time also depends on the total size of the 
the data in a zpool, as a resolver operation walks the FS in time, replaying 
all the writes and confirming that all the data on disk is good (it does not 
actually rewrite the data unless it finds bad data). This means a couple 
things, the first of which is that the resilver time will be dependent on the 
amount of data you have written, not the capacity. A zppol with a capacity of 
multiple TB will resilver in seconds if there is only a few hundred MB written 
to it. Since the resilver operation is not just a block by block copy,
  but a replay, it is I/Ops limited not bandwidth limited. You might be able to 
stream sequential data from a drive at hundreds of MB/sec., but most SATA 
drives will not sustain more than one to two hundred RANDOM I/Ops (sequentially 
they can do much more).

 You can also set copies=2/3 just in case some errors occur, so ZFS can 
 auto0repair the data. if you run ZFS over several LUNs this will make even 
 more sense. 

--
Paul Kraus
Deputy Technical Director, LoneStarCon 3
Sound Coordinator, Schenectady Light Opera Company

___
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: ZFS install on a partition

2013-05-18 Thread Paul Kraus
On May 18, 2013, at 12:49 AM, kpn...@pobox.com wrote:

 On Fri, May 17, 2013 at 08:03:30PM -0400, Paul Kraus wrote:
 On May 17, 2013, at 6:24 PM, b...@todoo.biz b...@todoo.biz wrote:
 3. Should I avoid using ZFS since my system is not well tuned and It would 
 be asking for trouble to use ZFS in these conditions. 
 
 No. One of the biggest benefits of ZFS is the end to end data integrity.
 IF there is a silent fault in the HW RAID (it happens), ZFS will detect
 the corrupt data and note it. If you had a mirror or other redundant device,
 ZFS would then read the data from the *other* copy and rewrite the bad
 block (or mark that physical block bad and use another).
 
 I believe the copies=2 and copies=3 option exists to enable ZFS to
 self heal despite ZFS not being in charge of RAID. If ZFS only has a single
 LUN to work with, but the copies=2 or more option is set, then if ZFS
 detects an error it can still correct it.

Yes, but …. What the copies=n parameter does is tell ZFS to make 
that many copies of every block written on the top level device. So if you set 
copies=2 and then write a 2MB file, it will take up 4MB of space since ZFS will 
keep two copies of it. ZFS will attempt to put them on different devices if it 
can, but there are no guarantees here. If you have a single vdev stripe and you 
lose that one device, you *will* lose all your data (assuming you did not have 
another backup copy someplace else). On the other hand, if the single device 
develops some bad blocks, with copies=2 you will *probably* not lose data as 
there will be other copies of those disk blocks elsewhere to recover from.

From my experience on the ZFS Discuss lists, the place people seem to 
use copies=more than 1 are on laptops where they only have one drive and 
copies=more than1 is better than no protection at all, it is just not 
complete protection.

 This option is a dataset option, is inheritable by child datasets, and can
 be changed at any time affecting data written after the change. To get the
 full benefit you'll therefore want to set the option before putting data
 into the relevant dataset.

You can change it any time and it will only effect data written from 
that point on. This can be useful if you have both high value data band low 
value and you can control when each is written. For example, you leave copies=1 
for most of the time, then you want to save your wedding photos, so you set 
copies=3 and write all the wedding photos, you then set copies=1. You will have 
three copies of the wedding photos and one copy of everything else.

--
Paul Kraus
Deputy Technical Director, LoneStarCon 3
Sound Coordinator, Schenectady Light Opera Company

___
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: License on the original BSD diff

2013-05-18 Thread Clifford Yapp
On Sat, May 18, 2013 at 7:59 AM, Dag-Erling Smørgrav d...@des.no wrote:

 Clifford Yapp cliffy...@gmail.com writes:
  The issue is of some interest because the wiki page documenting
  candidates to replace GPL software in base list the OpenBSD copies of
  the diff tools: [...]

 We already have working BSD-licensed versions of diff and diff3 in the
 SoC repo.


That's the repository here? (not coming up for me at the moment)

https://socsvn.freebsd.org/socsvn/soc2012/jhagewood/

Those files are using the 3-clause BSD license?

Thanks,
CY
___
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: ZFS install on a partition

2013-05-18 Thread Ivailo Tanusheff
The software RAID depends not only from the disks, but also from the changes on 
the OS, which will occur more frequently than an update of the firmware of the 
raid controller. So that makes the hardware raid more stable and reliable.
Also the resources of the hardware raid are exclusively used by the raid 
controller, which is not true for a software raid.
So I do not get your point of appointing that a software raid is same/better 
than the hardware one.

About the second part - I point over both stability and reliability. Having a 
spare disk reduces the risk as the recovery operation will start as soon as a 
disk fails. It may sound paranoid, but still the possibility of a failing disk 
which is detected after 8, 12 or even 24 hours is pretty big.
Not sure about your calculations, hope you trust them, but in my previous 
company we have a 3-4 months period when a disk fails almost every day on 2 
year old servers, so trust me - I do NOT trust those calculations, as I've seen 
the opposite. Maybe it was a failed batch of disk, shipped in the country, but 
no one is insured against this. Yes, you can use several hot spares on the 
software raid, but:
1. You still depend on the problems, related to the OS.
2. If you read what the mate asking has written - you will see that is not 
possible for him.

I agree on the mentioned about recovering bid chunks of data, that's why I 
suggested that he uses several smaller LUNs for the zpool.

Best regards,
Ivailo Tanusheff

-Original Message-
From: owner-freebsd-questi...@freebsd.org 
[mailto:owner-freebsd-questi...@freebsd.org] On Behalf Of Paul Kraus
Sent: Saturday, May 18, 2013 4:02 PM
To: Ivailo Tanusheff
Cc: Liste FreeBSD
Subject: Re: ZFS install on a partition

On May 18, 2013, at 3:21 AM, Ivailo Tanusheff ivailo.tanush...@skrill.com 
wrote:

 If you use HBA/JBOD then you will rely on the software RAID of the ZFS 
 system. Yes, this RAID is good, but unless you use SSD disks to boost 
 performance and a lot of RAM the hardware raid should be more reliable and 
 mush faster.

Why will the hardware raid be more reliable ? While hardware raid is 
susceptible to uncorrectable errors from the physical drives (hardware raid 
controllers rely on the drives to report bad reads and writes), and the 
uncorrectable error rate for modern drives is such that with high capacity 
drives (1TB and over) you are almost certain to run into a couple over the 
operational life of the drive. 10^-14 for cheap drives and 10^-15 for better 
drives, very occasionally I see a drive rated for 10^-16. Run the math and see 
how many TB worth of data you have to write and read (remember these failures 
are generally read failures with NO indication that a failure occurred, bad 
data is just returned to the system).

In terms of performance HW raid is faster, generally due to the cache 
RAM built into the HW raid controller. ZFS makes good use of system, RAM for 
the same function. An SSD can help with performance if the majority of writes 
are sync (NFS is a good example of this) or if you can benefit from a much 
larger read cache. SSDs are deployed with ZFS as either write LOG devices (in 
which case they should be mirrored), but they only come into play for SYNC 
writes; and as an extension of the ARC, the L2ARC, which does not have to be 
mirrored as it is only a cache of existing data for spying up reads.

 I didn't get if you want to use the system to dual boot Linux/FreeBSD or just 
 to share FreeBSD space with linux.
 But I would advise you to go with option 1 - you will get most of the system 
 and obviously you don't need zpool with raid, as your LSI controller will do 
 all the redundancy for you. Making software RAID over the hardware one will 
 only decrease performance and will NOT increase the reliability, as you will 
 not be sure which information is stored on which physical disk.
 
 If stability is a MUST, then I will also advise you to go with bunch of pools 
 and a disk designated as hot spare - in case some disk dies you will rely on 
 the automation recovery. Also you should run monitoring tool on your raid 
 controller.

I think you misunderstand the difference between stability and 
reliability. Any ZFS configuration I have tried on FreeBSD is STABLE, having 
redundant vdevs (mirrors or RAIDzn) along with hot spares can increase 
RELIABILITY. The only advantage to having a hot spare is that when a drive 
fails (and they all fail eventually), the REPLACE operation can start 
immediately without you noticing and manually replacing the failed drive.

Reliability is a combination of reduction in MTBF (mean time between 
failure) and MTTR (mean time to repair). Having a hot spare reduces the MTTR. 
The other way to improve MTTR is to go with smaller drives to recede the time 
it takes the system to resilver a failed drive. This is NOT applicable in the 
OP's situation. I try very hard not so use drives larger than 1TB because 

Re: Hot Swapping SATA drive?

2013-05-18 Thread Quartz



1)  Given a system running FreeBSD 9.1-RELEASE, is anything bad gonna
happen if I insert a drive into this thing while the system is running?


Assuming your board supports sata hotswap (too lazy to check) it'll be 
just fine. I've done this many times with the machine I'm messing with 
zfs on.



Will I be able to mount partitions contained on the drive in question
after I do so?


y



2)  Given a system running FreeBSD 9.1-RELEASE, is anything bad gonna
happen if I remove a drive from this thing while the system is running,
assuming that I have already properly umounted all relevant partitions
first?


No. On my test machine I've been yoinking drives without even any 
unmounting and it's just fine (up until I pull that last drive in my 
array and zfs shits the bed).


Honestly, the only thing you have to worry about is if you're in there 
messing with cable ends that you don't accidentally touch the cable clip 
to something else on the board and short it out.




3)  Assuming that I want to do this stuff, what BIOS options should I
be setting or unsetting on the motherboard?


You need the sata ports running in straight up pure ahci mode (as 
opposed to IDE mode or compatible or something that emulates old 
style parallel-ata). Be aware that Windows up through XP doesn't support 
ahci, so if you're dual booting an old system you'll have problems. 
You'll also almost certainly want to disable any motherboard-based raid 
options too, as they tend to be complete crap.




sata vs esata


esata is pin-identical to normal sata. The only difference is that esata 
has a more robust plug design meant to handle frequent [dis]connections 
and tighter electrical requirements in the cable for longer distances. 
As far as your board/OS is concerned, it's just another sata port.


__
it has a certain smooth-brained appeal
___
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: check variable content size in sh script

2013-05-18 Thread Tim Daneliuk

On 05/18/2013 10:09 AM, Quartz wrote:



However, if the OP wanted to actually truncate $FOO to 51
characters:

NEWFOO=$( echo $FOO | awk -v max=51 '{print substr($0,0,max)}' )


You don't need all that for a simple truncation/substring, you can do it with a 
direct assignment:

newfoo=${foo:0:51}



That works for bash, not sh.


--

Tim Daneliuk tun...@tundraware.com
PGP Key: http://www.tundraware.com/PGP/

___
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: check variable content size in sh script

2013-05-18 Thread Quartz



However, if the OP wanted to actually truncate $FOO to 51
characters:

NEWFOO=$( echo $FOO | awk -v max=51 '{print substr($0,0,max)}' )


You don't need all that for a simple truncation/substring, you can do it 
with a direct assignment:


newfoo=${foo:0:51}

The three params here are variable, start position and length.

__
it has a certain smooth-brained appeal
___
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


netgraph network setup for jail(8) vnet jails.

2013-05-18 Thread Joe

Hello list

I cant get to the internet using this netgraph setup script.
I sure would appreciate giving this console log a look over for
errors. My netgraph knowledge level is not sufficient to see what is
wrong. The goal is to run this script to setup and break down a netgraph
network for a single vnet jail at a time. rl0 is the real nic interface
device name of the nic facing the internet. This box is on my lan and
the gateway box does NAT for all lan boxes. The host running this script 
can ping the internet ok.


Thank you very much for your help.





The host's kernel has modules with vimage  ipfw compiled in.

From the host
# /root ifconfig
rl0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu
options=2008VLAN_MTU,WOL_MAGIC
ether 00:0c:6e:09:8b:74
inet 10.0.10.5 netmask 0xfff8 broadcast 10.0.10.7
nd6 options=29PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL
media: Ethernet autoselect (100baseTX full-duplex)
status: active
plip0: flags=8810POINTOPOINT,SIMPLEX,MULTICAST metric 0 mtu 1500
nd6 options=29PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL
ipfw0: flags=8801UP,SIMPLEX,MULTICAST metric 0 mtu 65536
nd6 options=29PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL
lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST metric 0 mtu 16384
options=63RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x8
inet 127.0.0.1 netmask 0xff00
nd6 options=21PERFORMNUD,AUTO_LINKLOCAL

The jails config file
# /root cat /usr/local/etc/vnet/vdir4
vdir4 {
host.hostname   =  vdir4;
path=  /usr/jails/vdir4;
mount.fstab =  /usr/local/etc/fstab/vdir4;
vnet;
persist;
}

The netgraph script
# /root cat /usr/local/bin/vnet.ng.test
#!/bin/sh
# snip comments for displaying here
# This script is based on this /usr/share/examples/netgraph/virtual.lan

# Give the name of ethernet interface.
ETHER_INTF=rl0

# List the names of virtual nodes and their IP addresses. Use ':'
# character to separate node name from node IP address and netmask.

#TARGET_TOPOLOGY=c1|10.0.2.20/24 c2|10.0.2.21/24 c3|10.0.2.22/24
TARGET_TOPOLOGY=vdir4|10.0.2.20/24

# MAC manufacturer prefix. This can be modified according to needs.
MAC_PREFIX=00:1d:92

# Temporary file is important for proper execution of script.
TEMP_FILE=/var/tmp/virtual.lan.tmp

virtual_lan_start() {

# Load netgraph KLD's as necessary.

for KLD in ng_ether ng_bridge ng_eiface; do
if ! kldstat -v | grep -qw ${KLD}; then
echo -n Loading ${KLD}.ko... 
kldload ${KLD} || exit 1
echo done
fi
done

# Reset all interfaces and jails. If temporary file can not be found
# script assumes that there is no previous configuration.

if [ ! -e ${TEMP_FILE} ]; then
  echo No previous configuration(${TEMP_FILE}) found to clean-up.
else
  echo -n Cleaning previous configuration...
  virtual_lan_stop
  echo done
fi

# Create temporary file for usage. This file includes generated
# interface names and jail names. All bridges, interfaces and jails
# are written to file while created. In clean-up process written
# objects are cleaned (i.e. removed) from system.

if [ -e ${TEMP_FILE} ]; then
touch ${TEMP_FILE}
fi

echo -n Verifying ethernet interface existence...
# Verify ethernet interface exist.
if ! ngctl info ${ETHER_INTF}: /dev/null 21; then
echo Error: interface ${ETHER_INTF} does not exist
exit 1
fi

ifconfig ${ETHER_INTF} up || exit 1
echo done

# Get current number of bridge interfaces in the system. This number
# is used to create a name for new bridge.
BRIDGE_COUNT=`ngctl l | grep bridge | wc -l | sed -e s/ //g`
BRIDGE_NAME=bridge${BRIDGE_COUNT}

# Create new ng_bridge(4) node and attach it to the ethernet interface.
# Connect ng_ether:lower hook to bridge:link0 when creating bridge and
# connect ng_ether:upper hook to bridge:link1 after bridge name is set.

echo Creating bridge interface: ${BRIDGE_NAME}...
ngctl mkpeer ${ETHER_INTF}: bridge lower link0 || exit 1
ngctl name ${ETHER_INTF}:lower ${BRIDGE_NAME} || exit 1
ngctl connect ${ETHER_INTF}: ${BRIDGE_NAME}: upper link1 || exit 1
echo Bridge ${BRIDGE_NAME} is created and ${ETHER_INTF} is connected.

# In the above code block two hooks are connected to bridge interface,
# therefore LINKNUM is set to 2 indicating total number of connected
# hooks on the bridge interface.
LINKNUM=2

# Write name of the bridge to temp file. Clean-up procedure will use
# this name to shutdown bridge interface.
echo bridge ${BRIDGE_NAME}  ${TEMP_FILE}


# Attach vnet jail.
for NODE in ${TARGET_TOPOLOGY}; do

  # Virtual nodes are defined in TARGET_TOPOLOGY variable. They
  # have the form of 'nodeName|IPaddr'. Below two lines split
  # node definition to get node name and node IP.

  NODE_NAME=`echo ${NODE} | awk -F| '{print $1}'`
  NODE_IP=`echo ${NODE} | awk -F| '{print $2}'`

  # Create virtual node (jail) with given 

Re: check variable content size in sh script

2013-05-18 Thread Quartz



newfoo=${foo:0:51}



That works for bash, not sh.


Ok granted, but I don't think that ${#foo} is straight sh either, so I 
assumed things bash/tcsh/ksh/whatever accept when running in sh 
emulation were ok.


__
it has a certain smooth-brained appeal
___
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: check variable content size in sh script

2013-05-18 Thread Tim Daneliuk

#foo works with sh



On May 18, 2013 10:58:30 AM Quartz qua...@sneakertech.com wrote:


 newfoo=${foo:0:51}


 That works for bash, not sh.

Ok granted, but I don't think that ${#foo} is straight sh either, so I 
assumed things bash/tcsh/ksh/whatever accept when running in sh emulation 
were ok.


__
it has a certain smooth-brained appeal
___
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


Re: check variable content size in sh script

2013-05-18 Thread Polytropon
On Sat, 18 May 2013 11:58:30 -0400, Quartz wrote:
 
  newfoo=${foo:0:51}
 
 
  That works for bash, not sh.
 
 Ok granted, but I don't think that ${#foo} is straight sh either, so I 
 assumed things bash/tcsh/ksh/whatever accept when running in sh 
 emulation were ok.

By default, there is no bash on FreeBSD, and therefor no emulation
and implicit features. :-)

At least FreeBSD's implementation of sh (which is ash, I think)
supports the # functionality. From man sh:

 ${#parameter}
 String Length.  The length in characters of the value of
 parameter.

And:

 ${parameter#word}
 Remove Smallest Prefix Pattern.  The word is expanded to produce
 a pattern.  The parameter expansion then results in parameter,
 with the smallest portion of the prefix matched by the pattern
 deleted.

Check the chapter Parameter Expansion for more surprising
things that are supported by ye olde /bin/sh. :-)



-- 
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


Graphics card differences between CentOS and FBSD (multi monitor)?

2013-05-18 Thread Dennis Glatting
I have a graphics card that behaves differently under CentOS 6.4 and
FreeBSD 9.1. Specifically, it is an older card (Spapphire with a ATI
chip set) where I have a multi-monitor set up but under CentOS the
monitors come up as expected but under FreeBSD there is some kind of
weird video-line overlap across the monitors.

As far as I can tell the xorg.conf is similar but the X code under
CentOS is versions ahead of FBSD even with WITH_NEW_XORG defined but I
suspect that isn't the real problem though hand patching the code does
have some impact. It also appears the FBSD kernel is lacking in some
areas but I'm unsure (and doubt) that is the real problem.

What should I be looking at in terms of configuration/code/etc such that
multi-monitor behave as expected under FBSD?

Also, I need to update some cards and I'm looking for a up-to-date card
that supports multi-monitor under FreeBSD. Most of my cards are old but
work well however I now have purchasing criteria (i.e., have to
purchase new and from a supported supplier, not used from Amazon or
eBay). Any recommended multi-monitor card you know works?




___
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: Hot Swapping SATA drive?

2013-05-18 Thread Jerry
On Sat, 18 May 2013 10:49:13 -0400
Quartz articulated:

 You need the sata ports running in straight up pure ahci mode (as 
 opposed to IDE mode or compatible or something that emulates old 
 style parallel-ata). Be aware that Windows up through XP doesn't
 support ahci, so if you're dual booting an old system you'll have
 problems. You'll also almost certainly want to disable any
 motherboard-based raid options too, as they tend to be complete crap.

There is a huge amount of information via a quick Google search that
would seem to contradict your statements regarding WinXP and AHCI.

http://expertester.wordpress.com/2008/07/27/how-to-enable-ahci-windows-xp/

http://answers.microsoft.com/en-us/windows/forum/windows_xp-hardware/how-do-i-change-windows-xp-to-use-ahci-disk-mode/7819a905-cfd9-4966-b2aa-67afc80a31d8

-- 
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__

___
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

More than 32 CPUs under 8.4-P

2013-05-18 Thread Dennis Glatting

I have a 4x16=64 core server running FreeBSD 8.4-P but only two of the
CPUs (2x16=32) are enabled. Enabling the other 32 isn't as simple as
changing MAXCPU in param.h (apparently) and recompiling.

What do I need to do to enable the other 32 cores?


Copyright (c) 1992-2013 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights
reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.4-PRERELEASE #0 r250401: Wed May  8 21:46:23 PDT 2013
root@mc:/disk-2/obj/disk-1/src/sys/GENERIC amd64
gcc version 4.2.1 20070831 patched [FreeBSD]
Timecounter i8254 frequency 1193182 Hz quality 0
CPU: AMD Opteron(TM) Processor 6274  (2200.04-MHz
K8-class CPU)
  Origin = AuthenticAMD  Id = 0x600f12  Family = 15  Model = 1
Stepping = 2

Features=0x178bfbffFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT

Features2=0x1e98220bSSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AESNI,XSAVE,OSXSAVE,AVX
  AMD Features=0x2e500800SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM
  AMD
Features2=0x1c9bfffLAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,XOP,SKINIT,WDT,LWP,FMA4,NodeId,Topology,b23,b24
  TSC: P-state invariant
real memory  = 137438953472 (131072 MB)
avail memory = 132427862016 (126293 MB)
ACPI APIC Table: 120911 APIC1027
FreeBSD/SMP: Multiprocessor System Detected: 32 CPUs
FreeBSD/SMP: 2 package(s) x 16 core(s)


___
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: More than 32 CPUs under 8.4-P

2013-05-18 Thread Ivan Klymenko
В Sat, 18 May 2013 10:13:08 -0700
Dennis Glatting free...@pki2.com пишет:

 
 I have a 4x16=64 core server running FreeBSD 8.4-P but only two of the
 CPUs (2x16=32) are enabled. Enabling the other 32 isn't as simple as
 changing MAXCPU in param.h (apparently) and recompiling.

Oops, sorry :)
___
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: More than 32 CPUs under 8.4-P

2013-05-18 Thread Dennis Glatting
On Sat, 2013-05-18 at 20:24 +0300, Ivan Klymenko wrote:
 В Sat, 18 May 2013 10:13:08 -0700
 Dennis Glatting free...@pki2.com пишет:
 
  
  I have a 4x16=64 core server running FreeBSD 8.4-P but only two of the
  CPUs (2x16=32) are enabled. Enabling the other 32 isn't as simple as
  changing MAXCPU in param.h (apparently) and recompiling.
 
 Oops, sorry :)
 

In the boot sequence the kernel (loop) kept printing errors to the
console and didn't get to a command prompt.




___
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: More than 32 CPUs under 8.4-P

2013-05-18 Thread Ivan Klymenko
В Sat, 18 May 2013 10:13:08 -0700
Dennis Glatting free...@pki2.com пишет:

 
 I have a 4x16=64 core server running FreeBSD 8.4-P but only two of the
 CPUs (2x16=32) are enabled. Enabling the other 32 isn't as simple as
 changing MAXCPU in param.h (apparently) and recompiling.
 
 What do I need to do to enable the other 32 cores?
 
 
 Copyright (c) 1992-2013 The FreeBSD Project.
 Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993,
 1994 The Regents of the University of California. All rights
 reserved.
 FreeBSD is a registered trademark of The FreeBSD Foundation.
 FreeBSD 8.4-PRERELEASE #0 r250401: Wed May  8 21:46:23 PDT 2013
 root@mc:/disk-2/obj/disk-1/src/sys/GENERIC amd64
 gcc version 4.2.1 20070831 patched [FreeBSD]
 Timecounter i8254 frequency 1193182 Hz quality 0
 CPU: AMD Opteron(TM) Processor 6274  (2200.04-MHz
 K8-class CPU)
   Origin = AuthenticAMD  Id = 0x600f12  Family = 15  Model = 1
 Stepping = 2
 
 Features=0x178bfbffFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT
 
 Features2=0x1e98220bSSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AESNI,XSAVE,OSXSAVE,AVX
   AMD Features=0x2e500800SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM
   AMD
 Features2=0x1c9bfffLAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,XOP,SKINIT,WDT,LWP,FMA4,NodeId,Topology,b23,b24
   TSC: P-state invariant
 real memory  = 137438953472 (131072 MB)
 avail memory = 132427862016 (126293 MB)
 ACPI APIC Table: 120911 APIC1027
 FreeBSD/SMP: Multiprocessor System Detected: 32 CPUs
 FreeBSD/SMP: 2 package(s) x 16 core(s)
 

http://svnweb.freebsd.org/base/releng/8.4/sys/amd64/include/param.h?revision=248810view=markup

Set MAXCPU parameter to 64
___
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: Hot Swapping SATA drive?

2013-05-18 Thread Ronald F. Guilmette

In message 519794e9.6080...@sneakertech.com, 
Quartz qua...@sneakertech.com wrote:

 3)  Assuming that I want to do this stuff, what BIOS options should I
 be setting or unsetting on the motherboard?

You need the sata ports running in straight up pure ahci mode (as 
opposed to IDE mode or compatible or something that emulates old 
style parallel-ata).

OK.  Thanks Quartz,.  I'll make it a point to check for that.

Be aware that Windows up through XP doesn't support ...

No worries.  The system in question is only running FreeBSD.  Someday
soon it may be running debian, but *never* will it be running windoze.

You'll also almost certainly want to disable any motherboard-based raid 
options too, as they tend to be complete crap.

OK.  I never use RAID in any form anyway, so it probably is already
disabled, but I'll make a point to double check.

Thanks!

___
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: Hot Swapping SATA drive?

2013-05-18 Thread Quartz



You need the sata ports running in straight up pure ahci mode (as
opposed to IDE mode or compatible or something that emulates old
style parallel-ata).


OK.  Thanks Quartz,.  I'll make it a point to check for that.


The wording on different bios' can often be confusing. I've seen ahci 
mode referred to on one board as native mode but on a different system 
it's referred to as enhanced (where normal is emulation), and other 
oddisims. Double check your mobo manual and find the chapter that talks 
about it.



You'll also almost certainly want to disable any motherboard-based raid
options too, as they tend to be complete crap.


OK.  I never use RAID in any form anyway, so it probably is already
disabled, but I'll make a point to double check.


A word of warning: Not all boards do things *right*, so it pays to test. 
I've encountered systems where you get gpt checksum errors and stuff 
when ahci is on because the board masks part of the drive for its 
fake-raid stuff even if you have fake-raid supposedly turned off.


__
it has a certain smooth-brained appeal
___
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: netgraph network setup for jail(8) vnet jails.

2013-05-18 Thread Teske, Devin
Sorry for top-post, but just wanted to add a quick note:

The output of ngctl dot would be very helpful to others in debugging your 
setup.
-- 
Devin

On May 18, 2013, at 8:38 AM, Joe wrote:

 Hello list
 
 I cant get to the internet using this netgraph setup script.
 I sure would appreciate giving this console log a look over for
 errors. My netgraph knowledge level is not sufficient to see what is
 wrong. The goal is to run this script to setup and break down a netgraph
 network for a single vnet jail at a time. rl0 is the real nic interface
 device name of the nic facing the internet. This box is on my lan and
 the gateway box does NAT for all lan boxes. The host running this script can 
 ping the internet ok.
 
 Thank you very much for your help.
 
 
 
 
 
 The host's kernel has modules with vimage  ipfw compiled in.
 
 From the host
 # /root ifconfig
 rl0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu
   options=2008VLAN_MTU,WOL_MAGIC
   ether 00:0c:6e:09:8b:74
   inet 10.0.10.5 netmask 0xfff8 broadcast 10.0.10.7
   nd6 options=29PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL
   media: Ethernet autoselect (100baseTX full-duplex)
   status: active
 plip0: flags=8810POINTOPOINT,SIMPLEX,MULTICAST metric 0 mtu 1500
   nd6 options=29PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL
 ipfw0: flags=8801UP,SIMPLEX,MULTICAST metric 0 mtu 65536
   nd6 options=29PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL
 lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST metric 0 mtu 16384
   options=63RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6
   inet6 ::1 prefixlen 128
   inet6 fe80::1%lo0 prefixlen 64 scopeid 0x8
   inet 127.0.0.1 netmask 0xff00
   nd6 options=21PERFORMNUD,AUTO_LINKLOCAL
 
 The jails config file
 # /root cat /usr/local/etc/vnet/vdir4
 vdir4 {
 host.hostname   =  vdir4;
 path=  /usr/jails/vdir4;
 mount.fstab =  /usr/local/etc/fstab/vdir4;
 vnet;
 persist;
 }
 
 The netgraph script
 # /root cat /usr/local/bin/vnet.ng.test
 #!/bin/sh
 # snip comments for displaying here
 # This script is based on this /usr/share/examples/netgraph/virtual.lan
 
 # Give the name of ethernet interface.
 ETHER_INTF=rl0
 
 # List the names of virtual nodes and their IP addresses. Use ':'
 # character to separate node name from node IP address and netmask.
 
 #TARGET_TOPOLOGY=c1|10.0.2.20/24 c2|10.0.2.21/24 c3|10.0.2.22/24
 TARGET_TOPOLOGY=vdir4|10.0.2.20/24
 
 # MAC manufacturer prefix. This can be modified according to needs.
 MAC_PREFIX=00:1d:92
 
 # Temporary file is important for proper execution of script.
 TEMP_FILE=/var/tmp/virtual.lan.tmp
 
 virtual_lan_start() {
 
 # Load netgraph KLD's as necessary.
 
 for KLD in ng_ether ng_bridge ng_eiface; do
   if ! kldstat -v | grep -qw ${KLD}; then
   echo -n Loading ${KLD}.ko... 
   kldload ${KLD} || exit 1
   echo done
   fi
 done
 
 # Reset all interfaces and jails. If temporary file can not be found
 # script assumes that there is no previous configuration.
 
 if [ ! -e ${TEMP_FILE} ]; then
  echo No previous configuration(${TEMP_FILE}) found to clean-up.
 else
  echo -n Cleaning previous configuration...
  virtual_lan_stop
  echo done
 fi
 
 # Create temporary file for usage. This file includes generated
 # interface names and jail names. All bridges, interfaces and jails
 # are written to file while created. In clean-up process written
 # objects are cleaned (i.e. removed) from system.
 
 if [ -e ${TEMP_FILE} ]; then
   touch ${TEMP_FILE}
 fi
 
 echo -n Verifying ethernet interface existence...
 # Verify ethernet interface exist.
 if ! ngctl info ${ETHER_INTF}: /dev/null 21; then
   echo Error: interface ${ETHER_INTF} does not exist
   exit 1
 fi
 
 ifconfig ${ETHER_INTF} up || exit 1
 echo done
 
 # Get current number of bridge interfaces in the system. This number
 # is used to create a name for new bridge.
 BRIDGE_COUNT=`ngctl l | grep bridge | wc -l | sed -e s/ //g`
 BRIDGE_NAME=bridge${BRIDGE_COUNT}
 
 # Create new ng_bridge(4) node and attach it to the ethernet interface.
 # Connect ng_ether:lower hook to bridge:link0 when creating bridge and
 # connect ng_ether:upper hook to bridge:link1 after bridge name is set.
 
 echo Creating bridge interface: ${BRIDGE_NAME}...
 ngctl mkpeer ${ETHER_INTF}: bridge lower link0 || exit 1
 ngctl name ${ETHER_INTF}:lower ${BRIDGE_NAME} || exit 1
 ngctl connect ${ETHER_INTF}: ${BRIDGE_NAME}: upper link1 || exit 1
 echo Bridge ${BRIDGE_NAME} is created and ${ETHER_INTF} is connected.
 
 # In the above code block two hooks are connected to bridge interface,
 # therefore LINKNUM is set to 2 indicating total number of connected
 # hooks on the bridge interface.
 LINKNUM=2
 
 # Write name of the bridge to temp file. Clean-up procedure will use
 # this name to shutdown bridge interface.
 echo bridge ${BRIDGE_NAME}  ${TEMP_FILE}
 
 
 # Attach vnet jail.
 for NODE in ${TARGET_TOPOLOGY}; do
 
  # Virtual nodes are defined in 

Re: Hot Swapping SATA drive?

2013-05-18 Thread Quartz



Be aware that Windows up through XP doesn't

support ahci,



There is a huge amount of information via a quick Google search that
would seem to contradict your statements regarding WinXP and AHCI.


Sorry, poor choice of wording. I meant earlier versions of Windows don't 
support achi *natively*. As your links suggest, you can sometimes find 
that your manufacturer will provide a driver that lets you fake out 
WinXP into being ok with your board's implementation of ahci (usually by 
emulating SCSI), but it's not a universal solution.


__
it has a certain smooth-brained appeal
___
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: check variable content size in sh script

2013-05-18 Thread Teske, Devin

On May 18, 2013, at 9:06 AM, Polytropon wrote:

 On Sat, 18 May 2013 11:58:30 -0400, Quartz wrote:
 
 newfoo=${foo:0:51}
 
 
 That works for bash, not sh.
 
 Ok granted, but I don't think that ${#foo} is straight sh either, so I 
 assumed things bash/tcsh/ksh/whatever accept when running in sh 
 emulation were ok.
 
 By default, there is no bash on FreeBSD, and therefor no emulation
 and implicit features. :-)
 
 At least FreeBSD's implementation of sh (which is ash, I think)

dash actually -- the Debian Almquist shell (descendent of NetBSD's ash).
-- 
Devin



 supports the # functionality. From man sh:
 
 ${#parameter}
 String Length.  The length in characters of the value of
 parameter.
 
 And:
 
 ${parameter#word}
 Remove Smallest Prefix Pattern.  The word is expanded to produce
 a pattern.  The parameter expansion then results in parameter,
 with the smallest portion of the prefix matched by the pattern
 deleted.
 
 Check the chapter Parameter Expansion for more surprising
 things that are supported by ye olde /bin/sh. :-)
 
 
 
 -- 
 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

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
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: check variable content size in sh script

2013-05-18 Thread Quartz



#foo works with sh


Is it actually part of the official spec though is what I'm wondering, 
or is it a case of other shells not rejecting 'advanced' statements when 
running in emulation.




At least FreeBSD's implementation of sh (which is ash, I think)
supports the # functionality.


The reason I say all this is that my copy of tcsh (on this not-freebsd 
machine) *doesn't* work with this when in sh emulation.


__
it has a certain smooth-brained appeal
___
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


Prevent starting network on fwe0 and fwip0

2013-05-18 Thread Martin Alejandro Paredes Sanchez
Hi:

How can I prevent the start of network on fwe0 and fwip0?

fwe0: Ethernet over FireWire
fwip0: IP over FireWire

In /etc/rc.conf I added this line

network_interfaces=lo0 fxp0 wpi0

But I still see that FreeBSD start fwe0 and fwip0

Starting Network: lo0 fxp0 wpi0
Starting Network: fwe0
Starting Network: fwip0

I also had networks on USB

Starting Network: usbus0
Starting Network: usbus1
Starting Network: usbus2
Starting Network: usbus3
Starting Network: usbus4

But I added

hw.usb.no_pf=1

To /boot/loader.conf file and FreeBSD didn't start the network in USB anymore

Is there something similar for FireWire?

I notice that the lines apear after DEVD is started

Is there a trick for DEVD?

TIA
___
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: check variable content size in sh script

2013-05-18 Thread Quartz

By default, there is no bash on FreeBSD,


Right right... I know this, but forgot what list I was on :)

It doesn't help that I always install bash first thing on any freebsd 
box or it get's installed automatically as part of pc-bsd anyway.


__
it has a certain smooth-brained appeal
___
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: check variable content size in sh script

2013-05-18 Thread Teske, Devin

On May 18, 2013, at 4:54 PM, Quartz wrote:

 
 #foo works with sh
 
 Is it actually part of the official spec though is what I'm wondering, or is 
 it a case of other shells not rejecting 'advanced' statements when running in 
 emulation.
 

Shells don't have an emulation mode. The shell supports what it supports, and 
no shell that I've ever used had an emulation mode to act like another shell.

Maybe you're referring to as emulation is actually the invocation line of the 
shell script.

Make no mistake… when you change the invocation (first) line of a shell script 
from:

#/bin/sh

to:

#/bin/tcsh

You are not instructing a shell to emulate anything, you are actually using a 
different shell.

sh != tcsh != bash != ash != dash != zsh

Your script will use the shell that is written in the innovation line and the 
features you get are respective to which shell you choose.



 
 At least FreeBSD's implementation of sh (which is ash, I think)
 supports the # functionality.
 
 The reason I say all this is that my copy of tcsh (on this not-freebsd 
 machine) *doesn't* work with this when in sh emulation.
 

Get the idea that csh or tcsh are *anything* like sh out of your mind.

Further, you almost *never* want to do any serious shell programming in csh or 
tcsh.

Why? Because csh and tcsh have an incomplete programming spec. Most notably are 
the way that it handles pipe data and the standard-output/error file 
descriptors. Specifically, you cannot throw away stdout while keeping stderr. 
This short-coming may not be noticeable to all programmers that choose 
csh/tcsh, but if you want to do any serious programming, you'll eventually hit 
those limitations and be forced to move to a real shell (real in the sense that 
it has a complete programming specification).

I personally never recommend csh/tcsh as a scripting language… but I can see 
the benefit that certain constructs (like repeat N cmd) have, purely for 
their simplicity (and readability for *very* short scripts). To challenge 
myself on this topic, I routinely try and cross-port very complex shell scripts 
to csh, and while I can do math with let and I can other things that a 
*normal* scripting language should allow… I invariably end up running away 
screaming in frustration.

Again,

csh != tcsh != sh != bash != ash != dash != zsh
-- 
Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
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: check variable content size in sh script

2013-05-18 Thread Teske, Devin

On May 18, 2013, at 5:06 PM, Teske, Devin wrote:

 
 On May 18, 2013, at 4:54 PM, Quartz wrote:
 
 
 #foo works with sh
 
 Is it actually part of the official spec though is what I'm wondering, or is 
 it a case of other shells not rejecting 'advanced' statements when running 
 in emulation.
 
 
 Shells don't have an emulation mode. The shell supports what it supports, 
 and no shell that I've ever used had an emulation mode to act like another 
 shell.
 

I say this from a FreeBSD context. It may entirely be possible that a Linux 
distro uses bash in /bin/sh -- and it's entirely possible that bash may act 
differently if ARGV[0] is /bin/sh. But I wouldn't call this emulation. I'd call 
it standardization.

When bash is invoked with an ARGV[0] of bash or {anything}/bash, it will act 
more like bash and less like standardized bourne shell, aka POSIX compliant 
/bin/sh (notice I didn't insert the name of any other shell, like ash, dash, 
etc. but instead I said like [a] standardized bourne shell. That is to say 
that bash will more strictly adhere to POSIX bourne shell standards when 
ARGV[0] is /bin/sh versus bash.

Even when bash clamps down on the bash-specific features if/when ARGV[0] is 
/bin/sh… you still have access to constructs such as ${#foo}.

All that being said… csh/tcsh has no such standards comliancy mode (what you 
called emulation). In fact… csh/tcsh don't follow the POSIX standards (or if it 
does… *extremely* loosely; see handling of file descriptors below in 
replied-to text).
-- 
Devin


 Maybe you're referring to as emulation is actually the invocation line of 
 the shell script.
 
 Make no mistake… when you change the invocation (first) line of a shell 
 script from:
 
   #/bin/sh
 
 to:
 
   #/bin/tcsh
 
 You are not instructing a shell to emulate anything, you are actually using 
 a different shell.
 
 sh != tcsh != bash != ash != dash != zsh
 
 Your script will use the shell that is written in the innovation line and the 
 features you get are respective to which shell you choose.
 
 
 
 
 At least FreeBSD's implementation of sh (which is ash, I think)
 supports the # functionality.
 
 The reason I say all this is that my copy of tcsh (on this not-freebsd 
 machine) *doesn't* work with this when in sh emulation.
 
 
 Get the idea that csh or tcsh are *anything* like sh out of your mind.
 
 Further, you almost *never* want to do any serious shell programming in csh 
 or tcsh.
 
 Why? Because csh and tcsh have an incomplete programming spec. Most notably 
 are the way that it handles pipe data and the standard-output/error file 
 descriptors. Specifically, you cannot throw away stdout while keeping stderr. 
 This short-coming may not be noticeable to all programmers that choose 
 csh/tcsh, but if you want to do any serious programming, you'll eventually 
 hit those limitations and be forced to move to a real shell (real in the 
 sense that it has a complete programming specification).
 
 I personally never recommend csh/tcsh as a scripting language… but I can see 
 the benefit that certain constructs (like repeat N cmd) have, purely for 
 their simplicity (and readability for *very* short scripts). To challenge 
 myself on this topic, I routinely try and cross-port very complex shell 
 scripts to csh, and while I can do math with let and I can other things 
 that a *normal* scripting language should allow… I invariably end up running 
 away screaming in frustration.
 
 Again,
 
 csh != tcsh != sh != bash != ash != dash != zsh
 -- 
 Devin
 
 _
 The information contained in this message is proprietary and/or confidential. 
 If you are not the intended recipient, please: (i) delete the message and all 
 copies; (ii) do not disclose, distribute or use the message in any manner; 
 and (iii) notify the sender immediately. In addition, please be aware that 
 any message addressed to our domain is subject to archiving and review by 
 persons other than the intended recipient. Thank you.
 ___
 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

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
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: netgraph network setup for jail(8) vnet jails.

2013-05-18 Thread Joe

Teske, Devin wrote:

Sorry for top-post, but just wanted to add a quick note:

The output of ngctl dot would be very helpful to others in debugging your 
setup.



graph netgraph {
edge [ weight = 1.0 ];
node [ shape = record, fontsize = 12 ] {
1 [ label = {rl0:|{ether|[1]:}} ];
5 [ label = {bridge0:|{bridge|[5]:}} ];
9 [ label = {ngeth0:|{eiface|[9]:}} ];
e [ label = {ngctl2355:|{socket|[e]:}} ];
};
subgraph cluster_disconnected {
bgcolor = pink;
e;
};
node [ shape = octagon, fontsize = 10 ] {
1.upper [ label = upper ];
1.lower [ label = lower ];
};
{
edge [ weight = 2.0, style = bold ];
1 -- 1.upper;
1 -- 1.lower;
};
node [ shape = octagon, fontsize = 10 ] {
5.link2 [ label = link2 ];
5.link1 [ label = link1 ];
5.link0 [ label = link0 ];
};
{
edge [ weight = 2.0, style = bold ];
5 -- 5.link2;
5 -- 5.link1;
5 -- 5.link0;
};
5.link1 -- 1.upper;
5.link0 -- 1.lower;
node [ shape = octagon, fontsize = 10 ] {
9.ether [ label = ether ];
};
{
edge [ weight = 2.0, style = bold ];
9 -- 9.ether;
};
9.ether -- 5.link2;
};


___
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: List Spam Filtering

2013-05-18 Thread RW
On Fri, 17 May 2013 09:15:35 -0400
Jerry wrote:

 On Fri, 17 May 2013 14:03:01 +0100
 RW articulated:
 
  On Fri, 17 May 2013 08:45:29 -0400
  Jerry wrote:
  
   On Fri, 17 May 2013 13:19:32 +0100
   RW articulated:
   
On Fri, 17 May 2013 12:54:29 +0100
Bruce Cran wrote:

 Yes, seriously.  Have you seen the number of people who post
 messages PLEASE REMOVE ME FROM THIS MAILING LIST!!,
 apparently not understanding how to manage their subscription?

There's also the likelyhood that reluctant subscribers are less
likely to take care about avoiding various types of backscatter.
   
   Well, unless the reluctant subscriber is running an incorrectly
   configured MTA, I don't see a problem with backscatter. Now, if
   they do have a maladjusted MTA, they have more problems then just
   subscribing to a list.
  
  Out of Office replies, sieve rejects, anti-spam challenges etc
 
 Yes, an incorrectly configured MTA or one of its milters. 

Not especially

 There are
 ways to deal with these assholes. 

Only some of it, and there's no general way of dealing with the
out-of-list component.

 Allowing a blanket open-door
 policy is like setting file permissions on everything to 0777 just
 because you are to lazy to find a correct solution to a problem.

Actually requiring subscription is pretty much like setting  0777, it's
really only a protection against accidental list spamming. If a spammer
actually wanted to spam lists he could harvest subscribed addresses, or
simply subscribe. 
___
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: netgraph network setup for jail(8) vnet jails.

2013-05-18 Thread Teske, Devin

On May 18, 2013, at 5:51 PM, Joe wrote:

Teske, Devin wrote:
Sorry for top-post, but just wanted to add a quick note:
The output of ngctl dot would be very helpful to others in debugging your 
setup.


graph netgraph {
edge [ weight = 1.0 ];
node [ shape = record, fontsize = 12 ] {
1 [ label = {rl0:|{ether|[1]:}} ];
5 [ label = {bridge0:|{bridge|[5]:}} ];
9 [ label = {ngeth0:|{eiface|[9]:}} ];
e [ label = {ngctl2355:|{socket|[e]:}} ];
};
subgraph cluster_disconnected {
bgcolor = pink;
e;
};
node [ shape = octagon, fontsize = 10 ] {
1.upper [ label = upper ];
1.lower [ label = lower ];
};
{
edge [ weight = 2.0, style = bold ];
1 -- 1.upper;
1 -- 1.lower;
};
node [ shape = octagon, fontsize = 10 ] {
5.link2 [ label = link2 ];
5.link1 [ label = link1 ];
5.link0 [ label = link0 ];
};
{
edge [ weight = 2.0, style = bold ];
5 -- 5.link2;
5 -- 5.link1;
5 -- 5.link0;
};
5.link1 -- 1.upper;
5.link0 -- 1.lower;
node [ shape = octagon, fontsize = 10 ] {
9.ether [ label = ether ];
};
{
edge [ weight = 2.0, style = bold ];
9 -- 9.ether;
};
9.ether -- 5.link2;
};


I rendered your output by saving it in a file (joe.dot) and then running:

dot -Tsvg -o joe.svg  joe.dot

I then uploaded joe.svg to my website:

http://druidbsd.sf.net/download/joe.svg

Compare your output to any of the following:

http://druidbsd.sf.net/download/warden0.jbsd.svg
http://druidbsd.sourceforge.net/download/folsom.svg

It looks like everything is connected properly.

A couple thoughts off the top of my head:

a. Did you enable promiscuous mode on rl0 via ngctl? (in your script perhaps?)

b. Have you tried giving ngeth0 a new MAC address? (I do this through ngctl 
too, but I imagine ifconfig from within the jail could achieve the same thing)
--
Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
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