ZFS: raid VS copies=n

2013-06-07 Thread Quartz

Question:

How does the ZFS option 'copies=n' and raid relate to and interact with 
each other? specifically recovery in the event of a failure. For 
example, is having three disks in a raid-1 configuration with copies=1 
effectively the same as having three disks in a raid-0 with copies=3? 
Are the copies distributed uniformly across all drives in the pool, or 
concentrated, or what? What happens with configs like a raid-z2 with 
copies=2? Which / how many disks can you lose?


(I'm aware that like a lot of other ZFS options copies=n doesn't have to 
be global to the entire pool / directory structure, but for the sake of 
simplicity let's assume it is in this case).


__
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-19 Thread Quartz

I say this from a FreeBSD context. It may entirely be possible that a
Linux distro uses bash in /bin/sh


Yes. For most (all?) linux distros as well as osx, /bin/sh is actually 
bash. When I say emulation mode I mean running a script with a 
#!/bin/sh header on a system that doesn't have a real copy of sh. 
Whatever shell ends up running the script is effectively emulating sh's 
environment, at least in my mind.


Bash is well known for not complaining when you use bash-specific 
features in a script which uses a #!/bin/sh header. This trips up many 
a programmer and causes script failures on systems where sh is not 
actually bash in disguise. This is why I question some things as to 
whether they're *really* valid pure sh syntax and not something that 
just happens to work in whatever shell is pretending to be sh (which I 
thought was tcsh on this machine I just did that test on, but on second 
look maybe not).


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


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


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: Youtube Flash Videos broken?

2013-04-06 Thread Quartz



I can work around this by downloading the files with clive and watching
with mplayer, but I'd like to make this work again.


To be honest, this is really the best solution for all platforms, 
win/mac/bsd/etc. I don't have flash installed on any of my machines: I 
use a plugin that downloads the mp4 and auto opens it in a local video 
player. This always works, you can jump/rewind without constant 
buffering, you don't have to deal with ads, and you don't have to deal 
with flash maxing out your cpu for no reason.


__
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: OT: posix sh problem

2013-04-04 Thread Quartz

I'd really like to
have this working cleanly on FreeBSD without requiring any funky shells


Define funky shell. Does it have to be straight up plain sh? Can it 
use csh or tcsh syntax? Does bash count as 'funky'?




or using any temporary files.


Do you mean manually created temp files? because some of the different 
ways of doing process substitution and redirection will automatically 
create temp files for you in the background and fail on an unwritable 
filesystem.


__
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: OT: posix sh problem

2013-04-04 Thread Quartz



fail on an unwritable
filesystem.


...By which I mean you can't create new files because your disk is 
completely full or you're booting from a ramdisk that's messed up, etc.


__
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: Recipie for CPU souffle'

2013-04-02 Thread Quartz



You might want to confirm that your processor model requires a thermal pad
and not grease. Then hunt some down and use it instead of thermal grease. I
seem to recall they were somewhat difficult to locate a place from which to
purchase.


It's not that bad these days, search amazon or something for thermal 
pad and you'll get a bunch of results. Just make sure you get an actual 
flexible pad and not a polished copper shim, which are often sold under 
the same name.


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

2013-03-29 Thread Quartz



Personally I'm using FreeBSD _exclusively_ (!) on the desktop
since version 4.0, and I haven't missed _any_ common desktopy
thing that is required for my daily work.


I was referring to general intent when I wrote that. For example, bsd 
has poor support for things like sleep/suspend/hibernate. While desktops 
and laptops would certainly take advantage of those things, severs 
generally don't, so fixing it has traditionally been low priority. In 
contrast, linux has that working out of the box on almost all hardware. 
Likewise in my experience a number of other home-use things like laptop 
wifi are generally better supported under linux.


A similar situation exists for software, especially non-business 
software and oddball utilities. On bsd you can usually find something to 
do what you need, but you'll often be limited to one or two choices, 
whereas with linux you might have half a dozen. (Whether all these 
packages are GOOD or not is a separate issue :)


I'm not saying that bsd *can't* be used for a home desktop, it certainly 
can, but it was never aimed at the grandma+laptop market and the 
hardware support and software selection reflects that. But I don't hold 
that against bsd. You can't be all things to all people, bsd is very 
good for servers and linux is good for home use, and they each have 
their place.


__
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: Copying memstick image to a USB (flash/thumb) drive

2013-03-28 Thread Quartz



I have filed the following PR:

http://www.freebsd.org/cgi/query-pr.cgi?pr=177431


Er, don't take my word for law: I have *no* idea if 1M is a good idea 
for most systems, I'm not even sure if it's optimal for mine. I did a 
single test with three random values at different orders of magnitude 
and picked the fastest. I do think that 10k is probably way under the 
right value, but someone should do proper testing on a variety of 
hardware before changing all the docs.


As for the conv=sync option, I'm not convinced it's necessary either 
way. I've dd'd zillions of images to various media over the years and 
have never specified a conv parameter and I've never had problems. I 
don't think modern systems really care what the end is padded with 
(provided nothing is corrupt of course). Someone with more experience 
would need to chime in on this.


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

2013-03-28 Thread Quartz



I have a new computer with windows 8, which I hate with a passion. I don't
play music and I don't do a lot of pictures. Basically I only search, some
EBay and games. Can I replace win8 with BSD?


[pc/free]bsd *can* be used as a desktop system, but it's really aimed 
more at servers... a lot of common desktopy things aren't covered well. 
Based on the wording of your question it sounds like you're new to 
non-windows systems. I'd suggest you look into some flavor of linux 
instead (eg; ubuntu or mint): they'll be geared more towards what 
you'd be looking for I think.


__
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: Where's the metadata?

2013-03-28 Thread Quartz



The problem is that now, the Windows system seems to think that the
size of the thing is only something like 24.2 Megabytes... *not* the
actual size, which is vastly larger (16GB).



but then at the last second I hesitate and decide to
actually try to _understand_ what's going on here, really, for a change.


By default, when looking with disks in explorer, windows will only mess 
with partitions (slices). In this case, your usb drive has a single 
partition just big enough to hold the installer, with the remainder of 
the drive being dead space. You need to delete this partition and create 
a new one that spans the entire size of the drive. Unfortunately, 
windows doesn't make this as easy as it should be. You'll need to open 
your control panel - administrative tools - computer management - 
disk management




So now I'm reading the man page for glabel(8)


glabel is totally not related to your problem at all. glabel is for when 
you want to refer to disks via a user created identifier string when you 
can't rely on the device id.




P.P.S.  So what _is_ the best tool for just simply taking some sort of
drive... like a USB flash drive, or any other kind of drive for that
matter... and returning it to it's actual size?


Use a real partitioning program as opposed to the crap built into the 
windows right-click menu. On freebsd, this would be 'gpart'.


__
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: Where's the metadata?

2013-03-28 Thread Quartz



Did you try using fdisk?


Don't use fdisk, it's waay out of date, doesn't work with a lot of 
modern large drives, and has horribly arcane syntax. Modern versions of 
gpart support MBR, so there's basically no reason to suffer through 
fdisk anymore.


__
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: OT: The future of USENET?

2013-03-27 Thread Quartz

Is USENET coming to its end?


Yes, for better or worse. It's been a slow downward spiral since the 
late 90's. I can't speak for other countries, but in the US the majority 
of ISPs started dropping access as a cost cutting measure since your 
average layman didn't really understand or use it. Younger generations 
in turn never knew it existed and ended up reinventing most of the 
functionality with web forums. Not helping matters is that, due to a 
couple isolated cases, the news media ignorantly view usenet as a haven 
for child porn and pirate movies, so there's increasing clamor to shut 
it down. There were a few 3rd party companies here and there that 
offered dedicated access, but most of them have closed up shop by this 
point due to social/political pressure.


__
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: Copying memstick image to a USB (flash/thumb) drive

2013-03-27 Thread Quartz



 Why exactly is the bs=10240 is there?  Wouldn't the default of 512
 do just as well?


Modern systems can read and write far more than 512 bytes per operation. 
Sticking with 512 would work perfectly fine, but you'd be imposing an 
unnecessary bottleneck and the copy would be a lot slower overall. 
Whether 10K is optimal or not depends on the exact hardware you're 
messing with (it looks pretty low to me, I'd suggest more like 1M).


__
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


ZFS question

2013-03-20 Thread Quartz
I'm experiencing fatal issues with pools hanging my machine requiring a 
hard-reset. I'm new to freebsd and these mailing lists in particular, is 
this the place to ask for help?


__
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: ZFS question

2013-03-20 Thread Quartz



Several people, including me, have an issue like this with 9.1.  Your
best bet is to try 9.0.


Hmm... interesting. Is there any consensus as to what's going on?

Before anyone jumps to conclusions though, lemme just post the whole 
issue so we're on the same page (apologizes if it turns out this isn't 
the right mailing list for this):





I have a raidz2 comprised of six sata drives connected via my 
motherboard's intel southbridge sata ports. All of the bios raid options 
are disabled and the drives are in straight ahci mode (hotswap enabled). 
The system (accounts, home dir, etc) is installed on a separate 7th 
drive formatted as normal ufs, connected to a separate non-intel 
motherboard port.


As part of my initial stress testing, I'm simulating failures by popping 
the sata cable to various drives in the 6x pool. If I pop two drives, 
the pool goes into 'degraded' mode and everything works as expected. I 
can zero and replace the drives, etc, no problem. However, when I pop a 
third drive, the machine becomes VERY unstable. I can nose around the 
boot drive just fine, but anything involving i/o that so much as sneezes 
in the general direction of the pool hangs the machine. Once this 
happens I can log in via ssh, but that's pretty much it. I've 
reinstalled and tested this over a dozen times, and it's perfectly 
repeatable:


`ls` the dir where the pool is mounted? hang.
I'm already in the dir, and try to `cd` back to my home dir? hang.
zpool destroy? hang.
zpool replace? hang.
zpool history? hang.
shutdown -r now? gets halfway through, then hang.
reboot -q? same as shutdown.

The machine never recovers (at least, not inside 35 minutes, which is 
the most I'm willing to wait). Reconnecting the drives has no effect. My 
only option is to hard reset the machine with the front panel button. 
Googling for info suggested I try changing the pool's failmode setting 
from wait to continue, but that doesn't appear to make any 
difference. For reference, this is a virgin 9.1-release installed off 
the dvd image with no ports or packages or any extra anything.


I don't think I'm doing anything wrong procedure wise. I fully 
understand and accept that a raidz2 with three dead drives is toast, but 
I will NOT accept having it take down the rest of the machine with it. 
As it stands, I can't even reliably look at what state the pool is in. I 
can't even nuke the pool and start over without taking the whole machine 
offline.


__
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: ZFS question

2013-03-20 Thread Quartz



1. freebsd-fs is the proper list for filesystem-oriented questions of
this sort, especially for ZFS.


Ok, I'm assuming I should subscribe to that list and post there then?



2. The issue you've described is experienced by some, and **not**
experienced by even more/just as many, so please keep that in mind.


Well, that's a given. Presumably if zfs was flat out totally broken, 9.x 
wouldn't have been released or I would've already found a million pages 
about this via google. I'm assuming my problem is a corner case and 
there might've been a bug/regression, or I fundamentally don't 
understand how this works.




3. You haven't provided any useful details, even in your follow-up post
here:


I got the impression that there wasn't a lot of overlap between the 
mailing lists and the forums, so I wanted to post in both simultaneously.




- Contents of /boot/loader.conf
- Contents of /etc/sysctl.conf
- Output from zpool get all
- Output from zfs get all
- Output from sysctl vfs.zfs kstat.zfs


I'm running a *virgin* 9.1 with no installed software or modifications 
of any kind (past setting up a non-root user). All of these will be at 
their install defaults (with the possible exception of the failmode 
setting, but that didn't help when I tried it the first time, so I 
didn't bother during later re-installs).




- Output from zpool status


There isn't a lot of detail to be had here after I pop the 3rd 
drive, zfs/zpool commands almost always cause the system to hang, so I'm 
not sure if I can get anything out of them. Prior to the hang it will 
just tell you I have a six-drive raidz2 with two of the drives 
removed, so I'm not sure how that will be terribly useful.


I can tell you though that I'm creating the array with the following 
command:

zpool create -f array raidz2 ada{2,3,4,5,6,7}

There are eight drives in the machine at the moment, and I'm not messing 
with partitions yet because I don't want to complicate things. (I will 
eventually be going that route though as the controller tends to 
renumber drives in a first-come-first-serve order that makes some things 
difficult).




- Output from dmesg (probably the most important)


When? ie; right after boot, or after I've hot plugged a few drives, or 
yanked them, or created a pool, or what?




I particularly tend to assist with disk-level problems,


This machine is using a pile of spare seagate 250gb drives, if that 
makes any difference.




By rolling back, if there is an issue, you're
effectively ensuring it'll never get investigated or fixed,


That's why I asked for clarification, to see if it was a known 
regression in 9.1 or something similar.





or don't have the
time/cycles/interest to help track it down,


I have plenty of all that, for better or worse :)



that's perfectly okay too:
my recommendation is to go back to UFS (there's no shame in that).


At the risk of being flamed off the list, I'll switch to debian if it 
comes to that. I use freebsd exclusively for zfs.




Else, as always, I strongly recommend running stable/9 (keep reading).


My problem with tracking -stable is the relative volatility. If I'm 
trying to debug a problem it's not always easy or possible to keep 
consistent/known versions of things. With -release I know exactly what 
I'm getting and it cuts out a lot of variables.




just recently (~5 days ago)
MFC'd an Illumos ZFS feature solely to help debug/troubleshoot this
exact type of situation: introduction of the ZFS deadmean thread.


Yes, I already discovered this from various solaris threads I encountered.



The purpose of this feature (enabled by default) is to induce a kernel
panic when ZFS I/O stalls/hangs


This doesn't really help my situation though. If I wanted a panic I'd 
just set failmode=panic.




All that's assuming that the issue truly is ZFS waiting for I/O and not
something else


Well, everything I've read so far indicates that zfs has issues when 
dealing with un-writable pools, so I assume that's what's going on here.


__
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