Wednesday, September 16, 2015

Possible USB fix

I'd been having trouble with external USB drives disappearing and then reappearing randomly about once a week - meaning perhaps three times in a week or maybe even going a month without bothering me.

The following suggestions from wyl1e may be of help.

echo "Y" > /sys/module/usbcore/parameters/old_scheme_first

echo -n "0000:00:1d.0" > /sys/bus/pci/drivers/ehci_hcd/unbind

echo '2-1.2' > /sys/bus/usb/drivers/usb/bind   

echo -n "-1" > /sys/module/usbcore/parameters/autosuspend
What they do:
/sys/module/usbcore/parameters/old_scheme_first
Changes the enumeration of devices. One of my symptoms was that USB drives would disappear and then reappear under a different name, e.g., /dev/sde would return as /dev/sdf; that naming could not be influenced by udev, and LVM could not be convinced to accept the drive by its new name. So possibly, this might cause the device to return by the same name?
/sys/bus/pci/drivers/ehci_hcd/unbind
This is an opportunity to turn off "high speed" (480Mbit/s, 60Mbyte/s) for a device; not appropriate for a disk drive.
/sys/bus/usb/drivers/usb/bind
Having unbound a device, bind it to a different device driver. That's not appropriate for my problem: the USB disk drive has been working for days with the same device driver; I just don't want it to disappear.
/sys/module/usbcore/parameters/autosuspend
Now we're talking: I never want these drives to suspend themselves.
But there is suspending by the kernel and there is also apparently suspending initiated by the disk drive - that too needs to be investigated.

Monday, September 14, 2015

Lesson Learned

Damn Small Linux isn't being maintained as well as I need; TinyCore seems to be much more alive.

Monday, June 2, 2014

Update

ssh

It turns out that the "ssh" option to the kernel causes the ssh daemon to start before files are "restored" from "backup", leading to new host key generation on every reboot. Yuck. So I've removed the "ssh" option from the kernel and added "/etc/init.d/ssh start" to /opt/bootlocal.sh

network config

The network configuration scripts must occupy /opt/${device}.sh and look like
#/bin/bash
pkill pump
pump -h us-gso-lxrouter-0 -i eth0
and
#!/bin/bash
pkill pump
ifconfig eth1 10.1.2.3 netmask 255.255.0.0 broadcast 10.1.255.255 up

Friday, May 30, 2014

Damn Small Linux (DSL) Frugal install under QEMU/KVM

intent

I want a virtual router within QEMU/KVM where I control iptables so I can build systems on simulated subnets.

libvirtd config

  • 1 2Gbyte hard drive (default DSL install doesn't recognize SCSI drive)
  • from within DSL, cfdisk to create 3 partitions: hda1 100Mbyte type Linux bootable, hda2 128Mbyte type Linux  swap, hda3 the remainder type Linux
  • 256Mbyte memory
  • one cpu
  • Install from ISO image

Frugal install

  • specified install onto hda1
  • specified backup (also used for /home and other) as hda3

edits to Grub menu.lst

  • mount /mnt/hda1 and edit /mnt/hda1/boot/grub/menu.lst
  • turned on dma - without that, significant (virtual) disk access pegged the CPU
  • changed init runlevel target to 2 to avoid GUI startup
  • final grub stanza looked like
    title Optimized
    kernel /boot/linux24 2 root=/dev/hda1 quiet vga=normal noacpi noapm dma noscsi toram ssh fuse mydsl=hda3 restore=hda3 frugal host=vrouter
    initrd /boot/minirt24.gz 

Changing /etc/inittab

By default, DSL in run level 2 puts a root shell prompt on the console tty[1234] but that makes me queasy, especially since this CentOS 6.4 system running QEMU/KVM puts no password on the VNC console access to the running virtual machine.  So I did the following
  • Added "etc/inittab" to /opt/.filetool.lst
  • In /etc/inittab file, replaced the instances of /bin/bash -login with /sbin/getty 38400 tty1 (appropriate tty used for each the four consoles)
  • In /opt/bootlocal.sh, did
    /sbin/telinit q
    

iptables

  • I used MyDSL to install iptables.dsl
  • In /opt/bootlocal.sh start iptables, which will be essential to simulating various subnets.
    /etc/init.d/iptables start
    
  • In /opt/.filetool.lst specify persistence of /var/lib/iptables

ssh

Put "etc/ssh" into /opt/.filetool.lst

Passwords

To persistently change the root and dsl account passwords, I used "passwd" then specified "etc/shadow" in /opt/.filetool.lst

Persistence

The command line reboot and shutdown -r commands do not save persistent data; you need to explicitly run /usr/sbin/filetool.sh backup before rebooting.

Networking

I have static configuration rather than the default dhcp for eth1, eth2, .... To that end I add "etc/sysconfig/network-scripts" to /opt/.filetool.lst

Tuesday, December 9, 2008

People want feedback as they type their passwords, but stringing out the same character allows shoulder surfers to see the *length* of their passwords. An improvement on this process would be to *change* a single character displayed as each character is typed. So instead of

p
*
pa
**
pas
***
pass
****
passw
*****
passwo
******
passwor
*******
password
********

You would instead do
p
+
pa
*
pas
+
pass
*
passw
+
passwo
*
passwor
+
password
*

Friday, September 19, 2008

4 O'Clock In The Morning Grimes Dorm Fire Alarm Blues

Written 29 years ago, but according to my son, still apropos:

(sung to classic blues chords)

It was 4 o'clock this morning
My bed it felt so sweet
But this ringing in my ears
Tells me I've got to get up on my feet.
Maybe somebody's just been smoking
Maybe somebody's just a liar
But this clanging incantation
It says "Fire! Fire! Fire!"

I got the 4 o'clock in the morning
Grimes dorm fire alarm blues.

Roomy, can't we just forget this?
Roomy, turn back off that light!
You say the RA's at the door?
Why did they have to pick tonight!
I've got a morning midterm in Econ;
I've got an afternoon midterm in Chem.
It's only the sixth time since Friday
What the hell does it matter to them?

I got the 4 o'clock in the morning
Grimes dorm fire alarm blues.

Well the freshmen are all in their bathrobes
The sophomores are all fully dressed
But the juniors and the seniors
Are just sticking to their good rest.
They're going to go down with the building
Like the captains of their floors
But that's not what they're really thinking
They just don't give a damn no more.

I got the 4 o'clock in the morning
Grimes dorm fire alarm blues.

Who am I?

I am a follower of Christ in the Catholic tradition.

I am a son, husband and father.

I am a Unix system administrator.

I am an amateur musician.

I am a U.S., North Carolina, Chapel Hill citizen.

Most of my thoughts participate in that environment; if I put them here, you're welcome to them.