[clue] Whack-a-disk

Chris Fedde chris at fedde.us
Tue Jul 29 21:05:32 MDT 2014


I also use expect extensively. My comments above should have had a better
indication that it was a jestfull snark.
I put expect into a "tool of last resort" bucket.  If there is another way
to do it then that way is probably better than using expect.  On the other
hand automation is a beautiful thing and the more we automate the more free
time we have for other things. CLI programming can be a very useful thing
and one that can be quite a time saver.  And there are a couple places
where there just is almost no other choice.

Still I have been debugging a lot of misbehaving expect code over the last
couple years.
I cannot blame most of the problems I've seen directly on the tool. I do
run into two main oversights:
* First, a step times out early waiting for a pattern and falls through to
subsequent behavior.  Hilarity often ensues.
* Second, no global timeout is provided and code that should have failed
ends up hanging till someone notices and kills it.
There are good solutions to both cases they just seem non obvious to most
of the guys who use the code around here.




On Tue, Jul 29, 2014 at 1:44 PM, Dan Kulinski <daniel at kulinski.net> wrote:

> Interesting insight on Expect and I can see why you are coming from that
> angle.  Quite honestly I use expect on very standard deployments and the
> behavior should be routine on all nodes.  I think expect is a good tool
> when used correctly.
>
>
> On Tue, Jul 29, 2014 at 1:41 PM, Chris Fedde <chris at fedde.us> wrote:
>
>> 1: Is there a problem using a GPT on a disk smaller than 2T?
>> 2: You don't want to know expect.  Writing reliable code in expect that
>> deals properly with failure modes is painful and requires silly,
>> non-obvious timeout logic.
>>
>>
>> On Tue, Jul 29, 2014 at 1:30 PM, Shawn Perry <shawn at redmop.com> wrote:
>>
>>> Seconded.  Crashplan via puppet would be sexy.
>>>
>>>
>>> On Tue, Jul 29, 2014 at 1:28 PM, David L. Willson <DLWillson at thegeek.nu>
>>> wrote:
>>>
>>>> But now I demand that you teach an expect scripting class for SFS or
>>>> CLUE, I mean. :-)
>>>>
>>>> Not that I have any right, but I can try.
>>>>
>>>>
>>>> --
>>>> David L. Willson
>>>> Teacher, Engineer, Evangelist
>>>> RHCE+Satellite CCAH Network+ A+ Linux+ LPIC-1 UbuntuCP NovellCLA
>>>> Mobile 720-333-LANS(5267)
>>>> http://sofree.us
>>>>
>>>> This is a good time for a r3VOLution.
>>>>
>>>> ------------------------------
>>>>
>>>> Thanks for sharing, this will work well with my cloud deployment and
>>>> puppet to automatically assemble a Lustre file system.  No more expect
>>>> script!
>>>>
>>>>
>>>> On Tue, Jul 29, 2014 at 1:25 PM, David L. Willson <DLWillson at thegeek.nu
>>>> > wrote:
>>>>
>>>>> Tried that. No dice. Actually what you said is how I used to do it,
>>>>> but I was always annoyed by having to go interactive. If I'm going to go
>>>>> interactive, I'm using cfdisk, because the interface is more pretty / less
>>>>> suckful.
>>>>>
>>>>> I always wanted non-interactive and *perfect*. I finally figured out
>>>>> how to get it today.
>>>>>
>>>>>
>>>>> --
>>>>> David L. Willson
>>>>> Teacher, Engineer, Evangelist
>>>>> RHCE+Satellite CCAH Network+ A+ Linux+ LPIC-1 UbuntuCP NovellCLA
>>>>> Mobile 720-333-LANS(5267)
>>>>> http://sofree.us
>>>>>
>>>>> This is a good time for a r3VOLution.
>>>>>
>>>>> ------------------------------
>>>>>
>>>>> Oh, I do this from the parted command line, not as an argument to
>>>>> parted directly.  I wonder if you surround it with quotes?
>>>>>
>>>>>
>>>>> On Tue, Jul 29, 2014 at 1:19 PM, David L. Willson <
>>>>> DLWillson at thegeek.nu> wrote:
>>>>>
>>>>>> Interesting. Trying your switches, I'm getting that 0 is an invalid
>>>>>> argument. It seems to think that by "-0" I mean to specify a switch, not a
>>>>>> parameter to the mkpart.
>>>>>>
>>>>>>
>>>>>> --
>>>>>> David L. Willson
>>>>>> Teacher, Engineer, Evangelist
>>>>>> RHCE+Satellite CCAH Network+ A+ Linux+ LPIC-1 UbuntuCP NovellCLA
>>>>>> Mobile 720-333-LANS(5267)
>>>>>> http://sofree.us
>>>>>>
>>>>>> This is a good time for a r3VOLution.
>>>>>>
>>>>>> ------------------------------
>>>>>>
>>>>>> For aligned disks I general do:
>>>>>> mkpart primary 1 -0
>>>>>> I suspect that is sector aligned and not cylinder aligned?
>>>>>>
>>>>>>
>>>>>> On Tue, Jul 29, 2014 at 12:51 PM, David L. Willson <
>>>>>> DLWillson at thegeek.nu> wrote:
>>>>>>
>>>>>>> How can I quickly and simply wipe and re-partition a disk from a
>>>>>>> script?
>>>>>>>
>>>>>>> Here's a proposal, using sdc as the example.
>>>>>>>
>>>>>>> # Quickly wipe the head of the disk.
>>>>>>> sudo dd if=/dev/zero of=/dev/sdc bs=16MB count=1
>>>>>>>
>>>>>>> # Create a new, basic partition table. Good for up to 2TB.
>>>>>>> sudo parted /dev/sdc mklabel msdos
>>>>>>>
>>>>>>> # If you have a disk larger than 2TB, use this instead.
>>>>>>> # sudo parted /dev/sdc mklabel gpt
>>>>>>>
>>>>>>> # Create a new, cylinder-aligned, primary partition, the full size
>>>>>>> of the disk
>>>>>>> sudo parted --align cylinder /dev/sdc mkpart primary 0% 100%
>>>>>>>
>>>>>>> The most interesting part might be that last line. I found many
>>>>>>> posts by people looking for a way to create a partition using parted
>>>>>>> non-interactively that is the full size of the disk and "properly aligned
>>>>>>> for best performance", but I didn't find anyone giving the answer. So... So
>>>>>>> that.
>>>>>>>
>>>>>>> --
>>>>>>> David L. Willson
>>>>>>> Teacher, Engineer, Evangelist
>>>>>>> RHCE+Satellite CCAH Network+ A+ Linux+ LPIC-1 UbuntuCP NovellCLA
>>>>>>> Mobile 720-333-LANS(5267)
>>>>>>> http://sofree.us
>>>>>>>
>>>>>>> This is a good time for a r3VOLution.
>>>>>>> _______________________________________________
>>>>>>> clue mailing list: clue at cluedenver.org
>>>>>>> For information, account preferences, or to unsubscribe see:
>>>>>>> http://cluedenver.org/mailman/listinfo/clue
>>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> clue mailing list: clue at cluedenver.org
>>>>>> For information, account preferences, or to unsubscribe see:
>>>>>> http://cluedenver.org/mailman/listinfo/clue
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> clue mailing list: clue at cluedenver.org
>>>>>> For information, account preferences, or to unsubscribe see:
>>>>>> http://cluedenver.org/mailman/listinfo/clue
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> clue mailing list: clue at cluedenver.org
>>>>> For information, account preferences, or to unsubscribe see:
>>>>> http://cluedenver.org/mailman/listinfo/clue
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> clue mailing list: clue at cluedenver.org
>>>>> For information, account preferences, or to unsubscribe see:
>>>>> http://cluedenver.org/mailman/listinfo/clue
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> clue mailing list: clue at cluedenver.org
>>>> For information, account preferences, or to unsubscribe see:
>>>> http://cluedenver.org/mailman/listinfo/clue
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> clue mailing list: clue at cluedenver.org
>>>> For information, account preferences, or to unsubscribe see:
>>>> http://cluedenver.org/mailman/listinfo/clue
>>>>
>>>
>>>
>>> _______________________________________________
>>> clue mailing list: clue at cluedenver.org
>>> For information, account preferences, or to unsubscribe see:
>>> http://cluedenver.org/mailman/listinfo/clue
>>>
>>
>>
>> _______________________________________________
>> clue mailing list: clue at cluedenver.org
>> For information, account preferences, or to unsubscribe see:
>> http://cluedenver.org/mailman/listinfo/clue
>>
>
>
> _______________________________________________
> clue mailing list: clue at cluedenver.org
> For information, account preferences, or to unsubscribe see:
> http://cluedenver.org/mailman/listinfo/clue
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cluedenver.org/pipermail/clue/attachments/20140729/515f1ad8/attachment.html 


More information about the clue mailing list