[Swan-dev] f22 vms and corrupt prompt: -bash-4.3#

Andrew Cagney andrew.cagney at gmail.com
Tue Jul 5 00:47:56 UTC 2016


On 4 July 2016 at 15:27, Neal P. Murphy <neal.p.murphy at alum.wpi.edu> wrote:
> On Mon, 4 Jul 2016 15:12:19 -0400
> Andrew Cagney <andrew.cagney at gmail.com> wrote:
>
>> If you notice kvm testsuite crashes that have something to do with a
>> failed login then check for the text:
>>
>>    -bash-4.3#
>>
>> somewhere in the output.  What's happened is the VM has somehow become
>> corrupt and needs a rebuild.
>>
>> The sequence below is one trigger; however I've also seen this when a
>> normal reboot was in play:
>>
>> -- start the domain
>>
>> $ sudo virsh start f22.east
>> Domain f22.east started
>>
>> -- connect to the console and let it boot/login:
>>
>> $ sudo virsh console f22.east
>> Connected to domain f22.east
>> Escape character is ^]
>> [...]
>> east login: root
>> Password:
>> [root at east ~]#
>>
>> -- now lets pull the virtual power cord
>>
>> $ sudo virsh destroy f22.east
>> Domain f22.east destroyed
>> $ sudo virsh start f22.east
>> Domain f22.east started
>>
>> -- again let the machine boot and log in
>>
>> $ sudo virsh console f22.east
>> [...]
>> east login: root
>> Password:
>> Last login: Mon Jul  4 14:56:08 on ttyS0
>> -bash-4.3#
>>
>> -- notice how the prompt isn't the usual "[root at east ~]# "!
>>
>> It might take a few tries :-) and once the damage is done it stays
>> damaged - the VM needs rebuilding.
>>
>> I tend to suspect f22 more than KVM - it has a log file system (I
>> assume), and at the time the cord was pulled was relatively "idle", so
>> really should survive these reboots.
>>
>> Hints on what to look for also welcome.
>
> Is the VM's disk cache set to write-through (write() doesn't return until the host says data are on disk; this can cause huge amounts of data writes to be queued in the VM and, thus, lost in a virtual power failure) or write-back (writes cache in hosts' disk cache, to be written to disk 'later')? If you trust your host OS and hardware, write-back is preferred. And generally much faster.

These domains are easy to re create - in fact, I often have the
domain's root file system sitting in /tmp - so I trust my host OS more
:-)

This is from dumpxml (is that the right place to look?):

    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/home/libreswan/pool/east.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b'
function='0x0'/>
    </disk>

and this is the mount line:

UUID=dc9ab5f7-cbd5-4e8f-a207-1fc49140f8ca /                       xfs
   defaults        0 0

Looking at http://libvirt.org/formatdomain.html#elementsDevices I'm
guessing I should add:

  driver -> cache='writethrough'

--

BTW, my hunch is that, since the stuff leading to PS1's value should
be read-only - host name, $HOME, ... - it probably isn't the file
system.  But, wait.  These domains run a script to mangle the hostname
et.al. on every single boot; so perhaps it is :-/


> _______________________________________________
> Swan-dev mailing list
> Swan-dev at lists.libreswan.org
> https://lists.libreswan.org/mailman/listinfo/swan-dev


More information about the Swan-dev mailing list