Re: Does a Maxtor 5000 LE USB Drive Work under Linux?

2003-01-26 Thread Martin McCormick
This was a thread I started around the first of January and I have
good but cautionary news to report.

When I first tried the Maxtor drive, it was on a 256-MHZ Dell
Pentium mother board with a single IDE controller for the hard drive and
CDROM, the usual IBM-style 1.4-meg floppy and a Yamaha sound chip that
never quite behaved well under Linux.  There was also a 3C509 10Baset
Ethernet card and the built-in USB1.1 port.

It is a good, but rather ordinary type system by today's standards.

The USB driver assigned IRQ9 to service the USB system and maybe
that is where things went wrong.  I still don't have a good way to know
that for sure.

All I know is that I got to see failure modes like I had never seen
them before.  Some disk operations would succeed normally, but most would
end up in Never-Never land and one couldn't even tell the system to reboot
when that happened because root couldn't even kill the processes.

I was in the process anyway of moving all the Linux activity from
that system to a newer Dell mother board so I thought I would give the
Maxtor another try on the new system.  I didn't hold out a lot of hope
because the newer system was basically much like the old one except faster
and with two IDE controllers and a different Ethernet card.

It also turned out the sound system was a better fit under Linux
and actually works as it should.

It appears that the USB driver chose a better selection of IRQ this
time because the Maxtor drive appears to work like a good disk drive should
on the new system.  The USB port is still a nice slow USB1.1 port so the
Maxtor doesn't get to really scream, but file transfers happen at a rate
one would expect at a 12-Mb bus speed.  It is about like Ethernet over a
good LAN using IRQ11 on this system.

What this all amounts to is that if you decide to try this type of
a set-up, look out for the warning signs that something might not be right.

I was lucky for once in that the system I was moving to appears to
be working while the one I am retiring (actually returning to its rightful
owner) had problems, but it could just as easily be the other way around.
In other words, have a plan B.

I think Linux represents an incredible human effort and the people
who have written these drivers and who do their best to make them
automatically do the right thing when faced with an unlimited level of
chaos can't be thanked enough.


Martin McCormick WB5AGZ  Stillwater, OK 
OSU Center for Computing and Information Services Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




USB-Based Serial port Modules

2003-09-25 Thread Martin McCormick
I have been meaning to buy a serial port module to connect to
the USB port on a Debian system.  I should have bought the Edgeport
8-port module when I saw it for sale early this year, because
Pricewatch shows only a 4-port model available now or a 16-port unit
for $600.  Are there any other options?  Four ports may not be enough
for the various projects I have, but 16 is a bit much at least at $600
when I had planned to spend around $300.

I just need to be sure that it will work with the 2.4 kernels.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



USB Serial Driver Isn't quite Working.

2003-10-11 Thread Martin McCormick
I am using the USB mass storage driver on a Maxtor external
drive which normally works well.  I added a new Edgeport/8 serial
converter and plugged it in to the second slot of the USB port.  The
documentation in /usr/src/linux/Documentation/usb-serial.txt says that
the generic serial driver supports the Edgeport/8 product.

When I plug it in, the following lines get added to syslog:

hub.c: USB new device connect on bus1/1, assigned device number 3
usb.c: USB device 3 (vend/prod 0x1608/0xf) is not claimed by any active driver.

Do I need to add any other modules to the kernel when
compiling?

Disconnecting the Edgeport/8 produces:

usb.c: USB disconnect on device 3

The mass storage driver continues to work with the serial port
unit in or out.  At least the new generic serial driver doesn't appear
to have done any harm.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: SCSI emulation for IDE CD-writer

2002-12-31 Thread Martin McCormick
Steve Doerr  wrote
>I overlooked the SCSI cd support when I built my kernel.
>
>It's working perfectly now.

I did almost the same thing on a system at work except I
forgot the Generic SCSI support.  I had a system that looked like
it should work if you did the  cat /proc/scsi/scsi tests, and
everything else looked good, but you sure couldn't write a CD.
It complained that the device was missing /dev/sg0

cdrecord -scanbus told me to run cdrecord -scanbus, etc.
I really felt stupid after discovering what I had done.  After I
built a new kernel with the Generic support, it burns CD's like a
fire bug.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Center for Computing and Information Services Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




What Happens When the USB Mass Storage Driver Doesn't Work?

2002-12-31 Thread Martin McCormick
I am trying out a new external Maxtor 5000 LE hard drive I bought
with the understanding that I can return it if it won't work
under Linux.

I built a 2.4.19 kernel, adding support for the usb port,
the mass-storage driver and SCSI disk support.

I had SCSI emulation working successfully to enable use
of a CDRW drive.

What I have succeeded in doing is killing the SCSI
emulation for the IDE CDRW drive.  All the logs report that the
USB hub driver and mass-storage USB driver are successfully
registered. 

kernel: usb.c: registered new driver hub
kernel: Initializing USB Mass Storage driver...
kernel: usb.c: registered new driver usb-storage
kernel: USB Mass Storage support registered.

Now, no SCSI devices show up in output from

cat /proc/scsi/scsi

I used to see the emulated SCSI channel for /dev/sr0, but that is
gone as long as I have SCSI disk support.

I would think that if the new drive was the problem, I
should see some kind of SCSI errors reported or experience long
pauses and or time-outs, but everything is strangely silent after
the initial syslog messages upon boot-up.

I would expect that I should get some kind of access
attempt messages even if the drive was not connected to the port.

I did enable verbose error reporting for the SCSI system,
but those messages I showed here are the only evidence that
anything happened with the USB ports at all.

So, my questions are:  Has anyone gotten one of these
nifty-looking drives to talk to a Linux system?

What kind of messages should I see, if any, when the usb drivers
are working right but the drive isn't?

This drive says it works with Mac OSX and, of course,
Windows.  I need to know if it should work under Linux fairly
soon because of the return question.

For background, the kernel had SCSI emulation enabled for
the CDRW drive, Generic SCSI support and SCSI CDROM support.  I
also have to have an append statement in lilo.conf to map hdc to
SCSI.

For the USB hard drive, I added SCSI disk support, usb
support and the usb mass-storage driver.
That, as previously stated, is when I broke SCSI emulation.
There shouldn't be any conflict with the naming of SCSI devices
since it looks like the disk should show up as /dev/sda if it
ever does.:-)

Many thanks for any constructive suggestions and a happy
New Year to all.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Center for Computing and Information Services Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: IDE SCSI Emulation and USB problem

2002-12-31 Thread Martin McCormick
I have been doing some further tests about my usb
problems and I found out that my testing procedure is flawed.
Every new kernel I built was built using bzdisk as the last step
in the process so I left the kernel on my boot drive alone and
was using a new kernel built on a floppy disk.  I believe that
that kernel uses a different lilo.conf file because that was part
of the reason why I see no SCSI emulation for the IDE CDROM.

I bit the bullet and built a new kernel with the IDE SCSI
emulation as before and the usb port mass storage driver support.

This time, I still have the CDROM as /dev/sr0 or
/dev/scd0 so that is good.  What I still don't seem to have is
anything happening with the usb port and mass-storage driver.

The syslog shows that the usb drivers installed,
registered and initialized, but there are no new devices.

I am testing a new Maxtor 5000 LE external drive with
this system so I have the two unknowns of the new usb
installation plus the new drive which may or may not work with
Linux.  The drive works with Windows and Mac OSX so it is not
known whether or not it will work here.

Shouldn't there be some kind of dialog regarding the usb
activity when the system boots besides the simple fact that the
usb support is there?

I even temporarily took out the append command in
lilo.conf that maps /dev/hdc to scsi and the SCSI did go away.
The usb support, however, does not appear to have added any new
devices with the only thing at all being a usb directory in
/proc/bus which is empty.

Does it matter which usb port I connect to on the 
mother board?

Many thanks.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: IDE SCSI Emulation and USB problem

2003-01-01 Thread Martin McCormick
According to the documentation for USB, the drives that
should show up on your system are /dev/sda or /dev/sdx if you
already have a /dev/sda or /dev/sdb, etc.
In other words, the USB devs should start at one above any pre
existing SCSI disks.

This means that your /dev/scd0 should not conflict with
any of the USB-based SCSI emulations.

"Charlie Reiman" writes:
>
>
>> -Original Message-
>> From: Aryan Ameri [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, December 31, 2002 10:25 AM
>> To: debian users
>> Subject: IDE SCSI Emulation and USB problem
>>
>>
>> Hi there:
>>
>> In order to be able to burn CDs using my ATAPI DVD/CDRW drive, I did the
>> followings to get ide-scsi emulation working.
>>
>> I first loaded the ide-scsi module using modconf.
>> Then Added the following lines to /etc/modutils/actions
>>
>> "alias scd0 srmod
>> alias scsi_hostadapter ide-scsi
>> options ide-cd ignore=hdc"
>>
>> Then added the following line to /etc/lilo.conf right after the
>> "root=" line
>>
>> "append="hdc=ide-scsi"
>>
>> I rerun lilo, then rebooted and changed /etc/fstab to mount
>> /dev/scd0 instead
>> of /dev/cdrom.
>>
>> I thouht that was it, I started burning CDs, and everything was
>> OK, untill I
>> saw that I have two problems
>>
>> 1. My USB programs can't detect USB devices, e.g gtkam can't
>> detect my digital
>> camera, and my mp3 player program can't detect my mp3 player.
>
>Most USB devices that act as filesystems use a SCSI emulation layer as well.
>I believe it also defaults to using /dev/scd0. You might want to try
>changing the IDE device to a different /dev/scd file.
>
>
>-- 
>To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
>with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
>


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Does a Maxtor 5000 LE USB Drive Work under Linux?

2003-01-01 Thread Martin McCormick
I presently have 2 unknowns I am trying to resolve.  I have
installed USB support and the USB mass-storage driver on a Debian system
using the 2.4.19 kernel.  The USB stuff installs with no complaint at all.

I power up the Maxtor and boot the system but no new drives show up
in the empty usb file system that can now be found in /proc/bus.

I also don't see any kind of errors in any log files so I don't
know if the Maxtor can't talk to Linux or if the usb drivers aren't
working.

The drive is new and I can return it to the store where I got it if
it isn't going to work, but I need to do that soon or I must eat it.

Does the USB system complain if it can't talk to any drives?
Things are just too quiet with the only log entries being  a successful
report that the USB module installed as well as the
mass-storage driver.

My hunch is that the USB is okay but it won't talk to this
drive.  I just want to be sure I have tried everything before I
take it back.  I could sure use the storage.

If anyone has seem my earlier post under a different
subject, the loss  of SCSI emulation of IDE drives appears to
have been a false alarm.  I now have both USB and SCSI emulation
here, just no new blank drives called /dev/sda.
-- 

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Center for Computing and Information Services Network Operations Group



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: IDE SCSI Emulation and USB problem

2003-01-01 Thread Martin McCormick
Aryan Ameri writes:
>So where is the conflict from?

I am not sure.  I thought I had the same problem you
reported when I was (still am) trying to install a USB-based
external drive on my system.  It turned out that my practice of
building test kernels on floppy disk and running them by booting
from the floppy caused a different lilo.conf to be used that
didn't have the append directive in it to map the IDE CDROM drive
to the SCSI emulation.

As I understand it, all the SCSI CDROM drives should show
up in your list of SCSI devices with names that are like /dev/sr0
or /dev/srx depending upon how many drives you have.  It doesn't
matter if they are true hardware-based SCSI devices or the SCSI
emulation is grabbing them.  CDROM's and hard disks each have
their own nomenclature and they should co exist peacefully.:-)

If I am wrong, somebody please tell me so for I hate to
lead others astray.

One way you might get this problem is if your CDROM is
somehow being mistaken by the system as a writable hard disk.  I
did see a warning on a Linux installation program that indicated
this could happen on some systems and that might be why they are
showing up wrong although one would think that you would just see
more hard disks than you should have and less or no CDROM's.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Center for Computing and Information Services Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Does a Maxtor 5000 LE USB Drive Work under Linux?

2003-01-02 Thread Martin McCormick
I want to thank all those who have offered suggestions.
I have a classic good news/bad news progress report.  The good
news is that the drive will work under Linux.  It appears to come
with a Windows file system, but fdisk and mkfs took care of that.

My problem was that I ended up having no interface
driver.  I had mis understood some of the documentation that
describe use of UHCI and OHCI drivers.  I thought that the USB
support was all you usually needed along with the mass-storage
drivers.

It turns out that on my machine, you need the alternate
driver called UHCI.  This produces huge output in the syslog when
it finds the drive and it even reports that it is a Maxtor 500
LE.

I was extatic and really whooped it up when that
happened.

Then the bad news started happening.  The drive works,
but I have something seriously wrong somewhere.

Firstly, I have tried both the UHCI and OHci drivers to
see which one is the best fit.  The OHCI driver didn't produce so
much as a single syslog message and there was no connectivity.

The UHCI driver finds the hard drive, but then things get
strange.

I seem to be able to mkfs pretty well if I use /dev/sda1.
I cam copy small files in to and out of it perfectly.  If I copy
a big file such as a 50-meg audio file which is why I installed
it in the first place, I can sometimes get about 32 megs copied
before 1 of 2 things happen.  The fsck or large file copy falls
silent.  Opening another login session and running a ps shows the
original process plus a child spawned by fsck which usually shows
up as having a code of  d  that sometimes changes to  r  and then
back to  d.  As time passes, it is much more  d  than  r and you
can't kill it with an atomic bomb.  Kill -9 does nothing to it
and if you finally give up and are lucky enough to have an open
session to root, reboot starts and then hangs because it can't
even kill that process.

The only thing that will kill it is literally turning off
the power to the system or, of course, hitting the Reset button.

Then, you must do fsck on root to get back to a working
system.

I don't see any syslog errors, but I just know this is
some kind of resource depletion problem.  The drive is working
but my computer which has been rock solid up to now is almost
guaranteed to need a shut-down or hardware reset to bring it back
to life after a large file copy or fsck.

I am actually about to move everything to a faster system
with twice the memory of the present system, so I don't know if
the problem will follow, but it would be nice to know if anybody
has any theories as to what I might look at.

I have 64 megabytes of RAM and a 64-meg swap partition
and the main hard disk ranges from 60 to 80% full so it isn't
running out of room for temp files as far as I can tell.

The other one of the two bad things that happens is that
you suddenly can'tspawn any new logins or one that is open to
root freezes up and absolutely nothing continues to work. 

A look at processes when the system is sick but not dead
yet shows the parent and child I mentioned plus the usual
assortment of Linux processes, but nothing particularly odd.

Thanks for any ideas as to what is happening and how to
fix it.  I am so close to success, but still not there yet.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Center for Computing and Information Services Network Operations Group

Nicos Gollan writes:
>-BEGIN PGP SIGNED MESSAGE-
>Hash: SHA1
>You should perhaps consider writing a mail to Maxtor support if you 
>haven't done so already.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Does a Maxtor 5000 LE USB Drive Work under Linux?

2003-01-03 Thread Martin McCormick
I am the person who started this thread originally and I
have spent a bit over three days thinking I was about home free
on getting this drive to work.  On the good advice of another
list member, I contacted the Maxtor Web site with the idea of
discussing how to make it work, but I didn't need to because
somebody has already asked.

Here is the answer lifted from their web site.

   Technical Bulletin
 Answer ID
 1271
 Product
   Personal Storage
 5000DV
 5000LE
 5000XT
 Category
 Compatibility
 Date Updated  
 10/17/2002 02:36 PM
 Printer Friendly Version of This Answer   Print Answer
 E-mail This Answer   E-mail Answer
 Will the Personal Storage 5000 work with Linux?
 Description
 Personal Storage 5000 LE/DV/XT Functionality in a Linux Environment.
 Answer
 Hardware drivers normally come from different operating system
   manufacturers. The Linux development community has not yet, as far as
   we are aware, developed drivers to allow Linux to be used with our
   1394 and USB interface.


I guess the answer is, "not yet."  This is a lot better
than no.  If I knew just a little more than I presently do, I
would volunteer to tackle this problem, myself, but I don't yet
really know how the USB or 1394 interfaces work.

This has all the earmarks of either a hand-shaking
protocol gone awry or an interrupt handler that may not be
returning cleanly from an ISR since it is so random and it also
seems to be related to the size of the data transfer.
One writes or reads a small file and it works.  Big operations are
sure to fail with the only question being whether just the
process hangs or the whole system dies.

If it is a hand-shake problem, something is blocking and
waiting for something that never happens or happens so quickly
that it gets missed.

If it is an ISR problem, maybe data are being lost when
returning or multiple interrupts are happening and blowing out
the stack.

I have written some assembler programs before and I am
aware how hard it can be at times to debug events whose timing
can be effected by tracing program flow to the point that it is
very hard to replicate the same conditions that are causing
things to blow.

If there is a better place to post this information,
please tell me.  If given enough time, I might figure it out by
the end of the decade, but I hope there are folks who are already
on the ground running with it.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Center for Computing and Information Services Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Minimal Woody Installation Disk and Serial Console

2003-01-15 Thread Martin McCormick
I am using the Serial console method of installing Woody
on a new, or at least, new to me, Dell system.

For those who haven't done this, you just insert the
Debian boot CD and boot the system but type the following where
most people just hit Enter:

linux console=ttyS0,9600n8

and the Com1 port begins to send and receive all of the
installation messages.

This works for me until I get to the end of the first
part of the configuration sequence at the point where you have to
configure the Base system.

At that point, you have to reboot the system and that's
where things go wrong.

Interestingly enough, if you build a system like that,
the inittab file gets modified to make ttyS0 or which ever port
you used, in to a tty login port which is very neat.  Now for the
bad news!

What I immediately get is the remainder of the
configuration sequence where one sets the time zone, host name,
network acquisition method such as dhcp or ppp, etc.  The problem
is that now, the system seems to have forgotten that I am using a
VT100.

I get a very bad screen full of escape sequences and
garbage like one gets when looking at a vt100 session with the
wrong terminal type.

When I get to the screen to set the root password, I am
in an endless loop in which the system tells me that I entered an
empty password which is bogus.  It then proceeds to be stuck in
that mode forever until I die and stop trying to enter a
password.:-( GRRR!

I don't fully understand what is wrong since I use
Kermit's vt100 emulation on the P.C. which serves as the
terminal, but I am awash in 8-bit characters and their ill
effects on Kermit's operation.

I can actually continue to muddle through the mess to set
the time zone and system name, but that password screen is as
good as a lockup since you can't get past it.

I have installed earlier versions of Linux on other
systems and run in to some of the same problems, but never this
bad.

Any ideas as to how to make the base configuration send
proper vt100 codes and let me finish this installation?

For computer users who happen to be blind, this is one of
the best methods for installation since everything you need is on
the CD, but I am stuck.  The last thing that got successfully set
was the time zone and I was able to bring up the network card,
but all that gets lost each time I have to bring it down since it
is dhcp and there isn't enough of a system up yet to safely put
it on the network anyway.

I did make a boot floppy when given the opportunity and
it works perfectly and puts me right back at the start of the
remainder of the configuration.  That is fine if I can ever get
proper communication with it and complete it.

Any ideas please?

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Center for Computing and Information Services Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Minimal Woody Installation Disk and Serial Console

2003-01-16 Thread Martin McCormick
I have partly solved my own problem.  The bash-type shell
which is part of the installation software is just what I need to
get a shot at modifying the inittab file.  It turns out that a
special inittab file is installed just for the installation
process and then the real inittab is put in after one finishes
all the configuration.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Snort Messages may not be Telling Me Much.

2004-12-03 Thread Martin McCormick
I've got snort installed and running on Debian3.0.  It runs
fine but I never get any thing in the report Emails that I receive
each day.  The messages have a suspiciously empty look to them like a
form that should be filled in but isn't.  I have run snort in the past
in a fully-capturing mode and there are all kinds of the usual monkey
business going on out there so I know that in 3 months, I should have
seen something.  After 92 days, every single message looks like the
following example:

(Message inbox:152)


From:root <[EMAIL PROTECTED]>


Subject: [SNORT] systemname
 daily report

The log begins from:   ::
The log ends at:   ::
Total events: 0
Signatures recorded: 0
Source IP recorded: 0
Destination IP recorded: 0


The number of attacks from same host to same
destination using same method
=
  # of
 attacks  from  tomethod
=


Percentage and number of attacks from a host to a
destination

#  of
  %attacks   from  to



Percentage and number of attacks from one host to any
with same method
==
#  of
  %attacks   from  method
==


Percentage and number of attacks to one certain host 
=
#  of
  %attacks   tomethod
=


The distribution of attack methods
===
#  of
  %attacks   method
===

End of example ---

I installed snort by using dselect and it is looking for all
the standard attack signatures that come with the distribution.  I
certainly don't want trouble, but I think I am missing activity that
is going on.  The network it is sniffing is the correct network for my
installation and, in the past, I saw traffic when using that
definition so I am not sure what is going on.

Any constructive ideas are welcome.

By the way, this particular message is not coming from
the system in question.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Snort Messages may not be Telling Me Much.

2004-12-04 Thread Martin McCormick
David Mandelberg writes:
>I'm having the same problem. From what I hear, a solution has something
>to do with acidlab, but I'm not sure.
Thanks.  I have another Linux system at work running the same
version and I noticed it also has the same problem.

Martin McCormick


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



gunzip and Unexpected EOF

2005-06-16 Thread Martin McCormick
before rebuilding a system after an upgrade that went terribly wrong,
I did the following in order to save kernel sources and configuration files:

tar cf - . |gzip >../otherfilesystem/root.tar.gz

This worked fine on the home file system and I recovered all
the /home files but when I went to do 

tar zxf otherfilesystem/root.tar.gz, things seemed to start for a
while and then disaster!!!


gzip: stdin: unexpected end of file
tar: Read 4489 bytes from /mnt/root.tar.gz

Apparently a special file or something in / makes gzip stop
before decompressing most of the 900 MB file.  Is there any way to
cause it to go any farther?  I am not trying to restore every byte of
the old file system, only selected parts such as /usr/local/src,
/usr/src and various crontab files.  Of course, the creation of the
archive left no hint that it was not going to unpack later.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: gunzip and Unexpected EOF

2005-06-16 Thread Martin McCormick
Almut Behrens writes:
>I'm afraid your tarball got corrupted...  In that case - I'm sorry to
>say - you're almost certainly outta luck.  After creating a tar.gz
>file, the _whole_ tarfile has been piped through gzip, so if any part
>of the file gets corrupted afterwards (however tiny - a single bit is
>sufficient), the gzip algorithm will not be able to recover any data
>later in the stream...
>
>My personal advice to avoid such desaster in future: use 'afio'
>instead of tar + gzip.  afio compresses each file seperately, so in
>case of partial corruption if the archive, most of the remaining files
>can still be recovered...

Thank you.  I was kind of afraid of that.  Fortunately, I had
backups of the /usr file system and /etc which were from mid May and
haven't changed too terribly much so I think I am not as hosed as I
could be.  Thanks again for the advice.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Fixing Mistake in grub config.lst; Need Rescue Disk

2005-06-18 Thread Martin McCormick
I successfully installed Debian from a CDROM burned from the image

debian-31r0a-i386-binary-1.iso

I then tried to install a 2.6.5 kernel on that system and must
have incorrectly modified /boot/grub/menu.lst because the system
doesn't boot.  I did think to make a backup of the original menu.lst
file but then I discovered that if I boot from the Debian installation
CDROM, I can't seem to use the shell one can spawn to mount any file
systems.  Is it possible to use that disk as a repair disk?  If so,
what am I missing?  The drive is already formatted and only needs to
be mounted so I can do the 5-second mv operation that I now have spent
about 6 hours trying to accomplish.

If that disk isn't a good repair disk, is there an image I can
download which understands the ext3 file system?

One other thing that may complicate this request is that I
need to do this via the serial console.  The installation CD I burned
from the image indicated above lets one do this all right so what I
need is something like that that will let me directly mount the root
file system.  Thanks for any help.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



SCSI Emulation Directives in grub/menu.lst

2005-06-20 Thread Martin McCormick
I am rebuilding a 2.6.5 Debian system and everything is
working properly so far.  The system had ext2 file systems and used
lilo and now has a ext3 journalling file system on the master drive.
It also uses the grub boot loader and appears to be healthy.
Before I rebuilt it, I used scsi emulation to make CD burning work and
have been lucky in that both a Sony and Plextor IDE drives have
not missed a beat when burning CD's.  The lines in /etc/lilo.conf are:

append = "hdc=scsi"
append = "hdd=scsi"

A message that SCSI emulation is deprecated for CD burning
pops up, but I have also heard of problems if one uses /dev/cdrom so I
would like to continue to use scsi emulation as long as I use a 2.6
kernel.

Is there an equivalent grub configuration line for menu.lst
that does the same thing?

If I can't use scsi emulation any longer, will cdrecord and
cdparanoia actually work since they appear to rely on scsi protocols?

I did read the grub manual, but maybe missed the obvious.
Nothing jumped out at me.

When building the new system from the latest DEbian
distribution, I had a choice of grub or lilo but grub was the first
boot loader presented.  Lilo fails to install so I went with grub
since that appears to be the general direction of progress.

    Thanks for your ideas.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Will cdrdao actually work on a 2.6.5 Kernel?

2005-06-21 Thread Martin McCormick
The system in question has 4 IDE interfaces and the CD drives
map to /dev/hdc and /dev/hdd.  After trying several syntax
possibilities like:

cdrdao read-toc device:ATAPI,#,#,# toc_testfile

and, after reading more documentation:


cdrdao read-toc device:ATA,#,#,# toc_testfile

I had a glimmer of hope.  When I gave the device spec of ATA:0,0,0 the
output from cdrdao said it couldn't open /dev/hda which made me
realize I had the wrong unit specification and that I should probably
try ATA:2,0,0, etc.

That also produced an error that cdrdao couldn't open /dev/hda which
tells me something is not right.

A search of 'HOWTO' documents for burning CD's says to try
using cdrecord to learn drive options.  I installed the modified
cdrecord from the Debian packages and got nada.  It, in its own
charming way, said "I don't know what you're even talking about."
Actually, it wanted to see SCSI devices and couldn't find any except
for a USB-based external hard drive which is connected to the system,
not the IDE CD drives I was expecting.

The syntax for cdrdao may be wrong or it may just not work on
this system, but it is certainly not unusually configured.  The first
IDE controller has two hard drives which show up as hda# and hdb#
depending upon what partition one means.

The only good news so far is that cdparanoia from the debian
packages has no trouble at all with /dev/hdc so I'm almost back to
where I was in the rebuild and modernize process.

Thanks for any ideas.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



BitTorrent Clients and X

2005-06-22 Thread Martin McCormick
Does BitTorrent require X to run under Linux?

I was going to download a file that appears to exist only in
.torrent form and was shunted to the BitTorrent web site to download a
.deb package.  I figured this was a good time to learn about
BitTorrent so I downloaded the package and nothing much else really
happened.  This system does not run X and I think what really happened
was that the package unpacked and couldn't install.  A look at the
BitTorrent web site mentions the GUI in system requirements, but I am
not sure if that is optional or what.  In my case, a required GUI equals
no application period.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: BitTorrent Clients and X

2005-06-22 Thread Martin McCormick
Sven Hoexter writes:
>Look out for btdownloadcurses.py and the other btdownload*.py programs
>installed in /usr/bin

Thank you and also thanks to the person who recommended
apt-get install bittorrent.  I actually had tried that but what was
truly wrong was that I hadn't updated the package lists recently.
Bittorrent showed up after I did that and I needed to fix a bunch of
dependencies which is what killed the attempt to install from the
BitTorrent web site.  Thanks for your help.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



dselect and a Recent Experience

2005-06-22 Thread Martin McCormick
In the spirit of helpfulness on this list, I want to repay
some of the assistance I have gotten from others, here.  This message
is a warning, not a gripe.  I think Linux software is astoundingly
robust.  Like anything, there are gotchas.  I am not sure exactly what
happened, but I last week trashed my system at home while doing a
rather innocent upgrade based upon what dselect computed needed to be
done while installing a single package.  I wasn't paying attention
closely enough because things usually work perfectly and what happened
was that a large number of packages got removed and the system ended
up not even being bootable.  Fortunately, I do /home backups on a
daily basis and I was even able to use a rescue disk to tar /home so I
didn't loose data.  The new version of my system now has ext3 file
systems for everything and grub as the boot loader. the only real loss
was time.

Today, here at work, I was going to install bittorrent on ta
Debian system and I used dselect to list the packages in order to find
bittorrent.  It found it and I started to install from there except I
saw that dselect was also going to whack about the same number of
packages here that it did when I was on my system at home.  Both are
very stable woody-installed systems.  I was actually awake at the
switch this time so I aborted the tragedy before it happened.  I used
apt-get install bittorrent since I knew I had it in the package lists
and it appears to have worked fine and corrected the dependencies
needed to install bittorrent.

dselect has, for the most part worked very well so I think
there is a possible bug somewhere to cause it to get confused as to
what it is supposed to delete, but everyone needs to pay closer than
usual attention to what dselect is doing if or when you use it.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dselect and a Recent Experience

2005-06-22 Thread Martin McCormick
Oliver Elphick writes:
>Does your /etc/apt/sources.list reference woody or stable?
>
>They used to be the same, but now there is a new stable, sarge.  So if
>you reference stable, a lot of your packages are now regarded as
>obsolete.  You should either reference woody explicitly or do a complete
>upgrade (recommended!) using the instructions in the release notes at
>http://www.debian.org/releases/stable/i386/release-notes/index.en.html

Excellent question that hadn't even occurred to me!  Here's the
important lines in sources.list

deb http://http.us.debian.org/debian stable main contrib non-free
deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
deb http://security.debian.org stable/updates main contrib non-free
deb http://http.us.debian.org/debian/ stable main  
deb http://non-us.debian.org/debian-non-US stable/non-US main

That's probably the problem right there.  I also had

 deb http://www.carezia.eng.br/debian woody main

This was for a modified version of snort which worked well on
my system at the office, but never quite worked right on the home
system so I took that source out of the sources.list at home about 6
or 7 months ago.  Both systems swarmed on me in the same way so I
think you hit the nail on the head.  The system at home is probably
now safely upgraded since I whacked the whole OS and started from
scratch with the newest Debian netinstall CD.

I should make sure the work system gets upgraded soon and that
will probably make dselect safe to use again.

Many thanks.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Movie players

2005-06-23 Thread Martin McCormick
Piero Piutti writes:
>All you need is mplayer, the w32codecs and mozilla-mplayer (aka 
>mplayerplug-in). It will work as a charm: tested with the Quicktime trailers 
>on Apple's website.

I second that.  I installed  MPlayer-1.0pre7 and the codecs
directory that one should also install and am amazed how well it
works.  I mainly use it to listen to streaming audio from various
radio stations.  As a computer user who happens to be blind, I do not
run X yet because it is not quite ready for prime time so I was amazed
to find that I could even listen to some TV audio.  I tried solent.tv
which is in the Isle of White in the UK and was able to listen to the
audio of a recent newscast.  It was a .wvx file and I have no idea
whether or not there are PAL/NTSC/SECAM issues or not.  The sound was
not terribly good but it didn't sound broken in any way.  The codec
gave it a hollow well sort of effect, but the voices and music were
the correct pitch and probably sounded like that on any computer
accessing the broadcast.

MP3 streams and Windows audio streams sound anywhere from
perfect to pretty good depending upon the sampling rate.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



nmh replcomps configuration for Replies to Mailing Lists

2004-11-12 Thread Martin McCormick
I have been attempting to adjust my replcomps file so that
replies to mailing list mail are more likely to go to the list rather
than the individual poster.  Is there any way to cause repl to respond
correctly to  a line like:

list-post: <mailto:[EMAIL PROTECTED]>

I think the mailto directive is what's confusing things.
If I put it in replcomps, repl finds it but can't understand its meaning.
Of course, several lists I am on appear to use that header as the only
reliable header that could control the construction of the reply address.

Thanks for any useful ideas.

Right now, the pertinent line in replcomps looks like:

%(lit)%(formataddr %<{delivered-to}%?{X-Original-To}%?
{mail-followup-to}%?{sender}%?{return-path}%?{mail-reply-to}%?{reply-to}%?{to}%?{from}%>)\

Line was broken for formatting purposes.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Is there a Way to Read PDP-11 Floppies?

2004-05-14 Thread Martin McCormick
I found some documentation about how to use dd to analyse
an unknown disk.  In this case, the disks are boot loaders for some
3Comm serial communications servers.  The procedure I read about tells
one to do something like

dd if=/dev/fd0 of=/tmp/testfile count=1
# If it works:
getfdprm# This will report what geometry the disk has
file /tmp/testfile   # This may indicate the type of file system
mdir a: # Check for an MS-DOS file system
tar tvf /dev/fd0# Check for a tar archive
cpio -itv < /dev/fd0# Check for a cpio archive
e2fsck /dev/fd0 # Check for an "ext2" file system

I did all that and found that the disk is

DS HD sect=18 
/tmp/testfile: PDP-11 UNIX/RT ldp

I can use dd to seemingly copy the entire disk image with no
trouble or at least not one error.

dd bs=2x80x18b of=/dev/fd0 if=/tmp/floppy.image

If I try to write floppy.image back to /dev/fd0 with a blank
but formatted disk in it, the resulting disk appears to have the same
data on it but it won't boot and the Linux mount command complains
about bogus FAT's.

Is there any sort of Linux analysis tool that works in the
command mode that might tell me what is wrong with the copies I am
making?

These disks are not copy-protected at all and one can use the
comm server to make new copies but this is not as convenient as using
a computer to manage backups.

It would be nice to be able to mount the disks, but being able
to make a binary copy to and from an image would be fine, also.

Also, the problem may lie in the way I use superformat to
format a totally blank diskette.  I do:

  superformat /dev/fd0 --verify_later sect=18 cyl=80

I think what I need is to format all the tracks with no FAT.
The PDP-11 disk has a different FAT structure, at least that is what I
think is happening.

If anybody has any suggestions as to how I can possibly
complete the copy process, I am extremely thankful.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Another shell scripting question

2004-05-20 Thread Martin McCormick
A response to another poster peaked my curiosity.

> Incidentally, there is no reason to make it a bash
> script rather than vanilla sh, and you can simplify the script by using
> exec:

I have been writing shell scripts for a bit over fourteen
years so I am not new to this, but I unfortunately get caught up in
solving the problem of the moment and therefore fail to learn as much
as could be learned.

Is it just more efficient in resources to use plain #! /bin/sh
rather than bash?

I usually always write my shell scripts with the Bourne shell
unless I discover that something doesn't work in sh but does work in
bash and then I use bash.

Some arithmetic functions seem to be easier to code in bash
but that might also be because I didn't know the magic syntax to make
them work in sh.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Swiss Army Knife of Sound has me Baffled.

2021-08-18 Thread Martin McCormick
I have a little shell script called fullstereo which works fine.
It's short so I'll show it to you.  It records sound from a
Creative Labs usb sound card which is probably much happier on a
Windows box but that's not where I need it.  It has only 1
sampling rate that works under debian and that is 48 KHZ.  I want
44.1 KHZ and I get 2 good stereo channels with the following script:

#! /bin/sh
cd ~/tmp
filename=$1.wav
echo $filename
arecord -D hw:1,0 -r 48000 -d $2 -c 2 -f S16_LE - \
| sox -t wav - -r44100 $filename

$2 is a value in seconds, minutes or hours and it goes
like a house on fire with no problem.

So, I want a mono version.  Let's try this:

#! /bin/sh
cd ~/tmp
filename=$1.wav
echo $filename
arecord -D hw:1,0 -r 48000 -d $2 -c 1 -f S16_LE - \
| sox -t wav - -r44100 $filename

This hasn't worked yet.  It is identical to the good version but
for c 1 as the number of channels to arecord instead of c 2 .

When running that script, this is what happens:

$ ./highmono testsound 30
testsound.wav
Recording WAVE '-' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

#Good so far and then

arecord: set_params:1345: Channels count non available
sox FAIL formats: can't open input  `-': WAVE: RIFF header not found

Darn!  A couple of microseconds before that, the same process
understood what I asked it to do.  When the -c parameter was set
to 2, it understood what to do with the standard output but with
c set to 1, it did what you see above.

I can't seem to figure out why 1 channel output is any
different from 2 channel except that the wav header should be
pretty much the same with a channel count of 1 instead of 2.

The man page for arecord even says the following:

   -c, --channels=#
  The number of channels.  The default is one channel.  Valid val‐
  ues are 1 through 32.  Theoretically, one could
leave out -c 1 and it should go ahead as if that flag was
actually there but it breaks instead.  This might also be because
one can not set any parameters without the Windows driver and I
guess I could leave it in stereo mode and tell sox to mix the
left and right channels which is fine with me but kind of clunky.

I am asking the list's wisdom in case there is a better
way to produce the mono channel.

Thanks.

Martin WB5AGZ



Re: Swiss Army Knife of Sound has me Baffled.

2021-08-19 Thread Martin McCormick
Dan Ritter  writes:
> > arecord: set_params:1345: Channels count non available
> > sox FAIL formats: can't open input  `-': WAVE: RIFF header not found
> 
> Keep recording 2 channels. Your hardware doesn't like it
> otherwise.
> 
> You can ask sox:
> 
> sox -t wav -c1 - -r44100 $filename
> 
> to merge the channels to a single output channel
> 
> I believe, but have not tested, that a final argument to sox of
> 
> remix 1
> 
> will get you just the left channel, or remix 2 for the right
> channel.
> 
> -dsr-

I haven't tried anything new yet but that sure looks right and
will probably work.

Thanks to all who responded.  This is what I like about
this list as it presently exists.  I had figured out that the
problem was  with the hardware which is a fairly decent device
but severely limited in Linux because a lot of it's power comes
from a proprietary driver like a number of other devices such as
winmodems, etc.  Then I read this:

Nicolas George  writes:
> If you read carefully, you will notice that your problem is not with
> sox, it is with arecord: sox only fails because arecord fails and does
> not produce anything.
> 
> arecord itself fails because "channels count not available": the sound
> device you are using does not like mono, it obviously like only stereo.
> 
> You have two options:
> 
> - Use a sound device that supports mono. Since you cannot change your
>   hardware, it needs to be done in software with an ALSA plugin. This is
>   all streamlined, you only need to write plughw instead of hw.
> 
> - Keep recording in stereo, and have sox convert it to mono before
>   saving. You will need to peruse the manual page of sox to know the
>   option, I only ever use ffmpeg for obvious reasons.
> 
> Note that:
> 
> - If you use plughw instead of hw, then the ALSA plugin can also
>   resample, and therefore you no longer needs sox at all.
> 
> - sox is capable of recording from ALSA directly, with something like
>   "-t alsa plughw:0".
> 
> Regards,

I actually did get a message from arecord about using a plugin
and you  have answered the question as to what needs to be done
to make that happen.  I had not even thought of the plugin
solution so this is a whole new possible route to success which I didn't even
think of before.

David Wright  also writes:
> Try -r 8000, or leave out -r and -c entirely, and you should
> succeed. But I doubt that's really your priority, is it?
> 
> > […] and I
> > guess I could leave it in stereo mode and tell sox to mix the
> > left and right channels which is fine with me but kind of clunky.
> 
> That's why it's the "Swiss Army knife". After mixing the two channels,
> you can write to a single-channel WAV file.
> 
> What you can't do is tell /arecord/ to use an ADC that doesn't exist.
> 
> Cheers,
> David.

I am in no great hurry so I will probably try both the
plugin solution and the sox coding and save them both for later
as the idea is to end up with something that is both efficient and
useful.

Thanks, everybody.

Martin McCormick   WB5AGZ



Proprietary USB Drivers; Ya Gotta' Love'em.

2021-09-25 Thread Martin McCormick
This is an embedded usb serial port in a radio receiver which
works in MS Windows10 and I was hoping to write some control
routines for a Raspberry Pi running buster and it does the
following:

Sep 22 20:17:15 rpi2 kernel: [551843.541477] usb 1-1.2: new full-speed USB 
device number 6 using dwc_otg
Sep 22 20:17:16 rpi2 kernel: [551843.674681] usb 1-1.2: not running at top 
speed; connect to a high speed hub
Sep 22 20:17:16 rpi2 kernel: [551843.684432] usb 1-1.2: New USB device found, 
idVendor=0c26, idProduct=002b
Sep 22 20:17:16 rpi2 kernel: [551843.68] usb 1-1.2: New USB device strings: 
Mfr=1, Product=2, SerialNumber=3
Sep 22 20:17:16 rpi2 kernel: [551843.684452] usb 1-1.2: Product: IC-R30
Sep 22 20:17:16 rpi2 kernel: [551843.684460] usb 1-1.2: Manufacturer: Icom Inc.
Sep 22 20:17:16 rpi2 kernel: [551843.684468] usb 1-1.2: SerialNumber: IC-R30 
16002557
Sep 22 20:17:16 rpi2 kernel: [551843.727911] cdc_acm 1-1.2:1.0: Zero length 
descriptor references
Sep 22 20:17:16 rpi2 kernel: [551843.727940] cdc_acm: probe of 1-1.2:1.0 failed 
with error -22
Sep 22 20:17:16 rpi2 kernel: [551843.728056] usbcore: registered new interface 
driver cdc_acm
Sep 22 20:17:16 rpi2 kernel: [551843.728061] cdc_acm: USB Abstract Control 
Model driver for USB modems and ISDN adapters
Sep 22 20:21:11 rpi2 kernel: [552078.765119] usb 1-1.2: USB disconnect, device 
number 6

So much for that.  There is one other possibility.  It is
possible that one can go to one of the menu options and flip a
virtual switch that will take the serial data that should have
been on /dev/ttyACMx and put them on a logic-level serial line
that is accessible through the right stereo channel of a
3-conductor jack.  Whether or not that works is beyond the scope
of this list so my question is whether or not there is a wrapper
program of some kind in Linux that can fool an application like
the serial port module that tried to run here in to thinking that
it is home and among friends when it's really been kidnapped.

The possible use of a logic-level serial line is probably
what I will need to do but that means that if one resets the radio to
factory defaults, one will have to go in to the menus on
the radio's screen and restore the virtual switch setting.

As a computer user who happens to be blind, that's a major pain as
well as in a case where the radio is remotely located and one is
operating it headlessly.

I smiled a bit when reading the syslog admonition to
connect to a high-speed hub.  That would be quite a trick.

Thanks for any constructive suggestions.

Martin McCormick WB5AGZ



Re: Proprietary USB Drivers; Ya Gotta' Love'em.

2021-09-25 Thread Martin McCormick
Charles Curley  writes:
> Possibly a known kernel bug.
> 
> https://forums.opensuse.org/showthread.php/538695-USB-driver-Zero-Length-Descriptor
> 
> https://lore.kernel.org/lkml/1507709452-31260-1-git-send-email-msa...@iotecha.com/
> 
> --
> Does anybody read signatures any more?
> 
> https://charlescurley.com
> https://charlescurley.com/blog/

Thank you.  That's got to be it.  I've been doing debian Linux since
right around 2000 but I must admit that I don't know the easiest
way to include the patch referenced in the second link.

I will need to do that on an i86 box plus the Raspberry Pi
I first discovered the issue on since I am apt to have the radio
connected to either system and, if this problem is fixable, this
solution is preferable because the radio defaults to using the
usbC port as the serial port so it should still work if a full
reset is ever needed and the mechanism for usb should naturally
accept as many different devices as practical because you never
know what you will need to connect until you try it and it fails.

As an amusing aside, the radio has a usb mode, but
that's totally unrelated because in that case, USB stands for
upper side band and is a very energy-efficient method of radio
communication because it is only a spectrum of frequencies
consisting of the sidebands of an audio signal without the
carrier.  It can be LSB or lower side band or USB for upper side
band.  Nothing like a few new acronyms for your day. I guess that's TMI.

Martin McCormick WB5AGZ



Re: Proprietary USB Drivers; Ya Gotta' Love'em.

2021-09-25 Thread Martin McCormick
Gene Heskett  writes:
> You forgot to mention it can get the message thru better because it has a
> 12 db advantage over competing noise compared to the original AM,
> sometimes called Ancient Mary in our circles.

I did forget that but you are correct.  another
interesting thing about ssb which includes both sidebands is that
it was first tried during the 1930's as a concept and had to wait
until after World War II before amateur radio operators, the
millitary and commercial folks began using it routinely.  To not
stray too far from the group purpose, the usb dongles that give
you a wide coverage receiver from 26 to almost 1000 MHZ use
basically math to decode sideband, AM, FM and data using DSP
techniques.

Martin



Re: Proprietary USB Drivers; Ya Gotta' Love'em.

2021-09-25 Thread Martin McCormick
So, what is the easiest route to end up with a kernel that has
this patch in it?

The image for the current kernel is
4.19.0-5-686-pae

The Raspberry Pi is an arm-based system and the image
version number is probably different but the idea is the same,
have a kernel that doesn't choke when one is using the ICR-30
usbC port.

To put it bluntly, this is an area of Linux I have very
little familiarity with because generally, Linux kernels just
work so this is a left-handed complement in that I think this is
the first kernel bug that I have encountered ever.

I am sure I have run kernels with other bugs that I
didn't know about but this is the first time one has bitten me,
so to speak.

Thanks.


Martin     WB5AGZ
Martin McCormick  WB5AGZ



eMail Com Between Hosts on a Private Net

2021-10-20 Thread Martin McCormick
The installation, here, is like millions of others.  We are on a
private VLAN with the router acting as the gateway to our ISP's
network and the internet.  There is nothing unusual about that so
the question is Can systems on a 192.168.x VLAN use smtp to send
mail to each other?

I really should know the answer to this because I am a
retired systems engineer who used unix systems and mailers all
the time but that was in a university network and I would just
assign a DNS name to each box and maybe a MX record if it was
necessary so that box1.midlevel.edu could deliver mail to
box2.midlevel.edu whether it was across the room or on another
continent.

The DNS support is what you don't have on a private VLAN
so I want to do this in a safe but simple way.

This would make it possible for Linux boxes on the
network to send messages to the system I normally receive mail on
so that squawks about a process crashing or some other problem
are sure to be seen.

The other systems sending those messages don't even
necessarily need to send mail outside the network but they do
need to send mail to the system I normally read mail on.

I looked up this topic using duckduckgo and found very
little hits that were on topic and lots of mercantile buzz about
email hosting companies, etc.  All are necessary but not what I
was asking about.

I have put static IP records in to the dhcp server on our
router so 192.168.1.xx will always either have a specific host at
that address or nothing if the MAC address changes and the record
hasn't been updated.

Also, I have put /etc/hosts files on Linux systems and a
Mac and I believe there is a hosts file one can add to Windows
systems for a similar effect.

Thanks for any good ideas.

Martin McCormick



Re: eMail Com Between Hosts on a Private Net

2021-10-20 Thread Martin McCormick
Joe  writes:
> Indeed so, it is even in a folder called 'etc', which I think is in a
> 'drivers' folder. It's a while since I used it. There may be an
> existing default or example \etc\hosts file. The LMHosts file is also
> here, but of interest only to Windows networks for speeding up share
> lookups.
> 
> --
> Joe
My thanks to all who replied and thanks for reminding me of some
of the considerations one needs to think of when setting this all
up since that's what I used to do as part of my job before
retiring in 2015.  As for there being 16 subnets in the
192.168.x.x number space, one can use variable-width subnet masks
so unless you have a lot of hosts or, for some reason, are
sharing space with another subnet, one can spread out to a Class
B-style network which would be the whole space and have a subnet
mask of 255.255.0.0 or you can make lots of little subnets of
various mask sizes with blocks of 16 addresses being about the
smallest subnet that is practical.  Remember you always lose the
all-zeros and all-ones broadcast addresses because they are
special plus there is likely a router address taken by the router
which leaves 13 addresses for hosts in each subnet.

I remember early in the nineties our campus went from a
single Class C to a Class B network and the whole campus used the
Class B subnet mask with bridges holding the whole thing
together.  You should have seen some of the arp storms that would
blow up like wild fire when somebody had a misconfigured host
trying to be helpful or maybe deliberately misconfigured because
somebody got their socks in a wad over something and started the
fire on purpose.

It wasn't long before we began more efficiently using the
number space with big departments getting let's say 1024 or 512
possible addresses and others getting 16 or 32 addresses.

By the time I left, we were using the huge private
network space of 10.0.0.0 with aNAT or Network Address
Translation to parts of the old Class B network and it generally
worked well.

I wrote a C then a perl program which would assign IP
addresses for hosts on our networks that knew the sizes of all
the subnet masks so assigning IP addresses was something anybody
in our group could do without much more information other than
what host name the customer wanted and what building it was in.
My job was basically to encode all that in to rules for
automation to keep us safe from making mistakes and it worked.

Martin



Re: eMail Com Between Hosts on a Private Net

2021-10-22 Thread Martin McCormick
One more question I should know the answer to but am not sure of.
The debian Buster system I use for email presently uses fetchmail
to get mail from the ISP and is configured to use that ISP's
smarthost for out-going mail.  I do not want to  effect
(= muck this up) this  functionality because  it works well for
now.

Shouldn't I be able to install an imap server on the
debian box and forward messages of interest to it, then reach
imap4 on the private net from any system that speaks imap or has
an imap client?

That would do what I need to do.

When I was researching, the article in wikipedia I read
said that many commercial systems have email clients which
understand imap, pop3, etc.  The systems likely to do this on our
network are a windows10 box, an iMac and maybe an iPad.  The idea
would be to forward an email message needing this attention to
imap on the linux box, contact the Linux box from one of the
devices I mentioned, and download the message at which point it
would e as if that system had been hooked up to the ISP and
received it.

I was all ready to use .local as our domain name and then
I looked that up and there is a good wikipedia article which
explains how that is problematic and recommends using something
like .lan, .office or something else that isn't likely to be
registered as a top-level resolvable domain name.

The machine I receive email on presently would be a good
candidate for running a mdns but our netgear router advertises
whatever dns's the isp uses for obvious reasons and that's fine
but it would be nice if the mdns's address could also be known to clients
on our network which could make DNS queries to each other's names
that would resolve properly.

Is there a way to advertise the mdns so that the router
picks it up but doesn't drop the internet DNS's that we all need
to resolve the rest of the world?

I do remember when I was working, we explored open-source
network authentication systems which involved fake DNS's that one
had to advertise as such so their information wouldn't corrupt
the proper working DNS's which could really mess things up if
somebody happened to pickup and cache the wild card * that sent
all new supplicants to the authentication server after they were
already up and running.

In our case, the corruption would be okay and done for
good reasons but the dhcp server in our router  already advertises two
domain name servers so ours would have to be learned about by
discovery.

Thanks again.

Martin McCormick



Curious Question about an Extra MAC Address

2021-10-26 Thread Martin McCormick
I was inventorying all the systems on our WiFi and wired network
so I did the following:

   sudo nmap -sn 192.168.1.0/24 followed by
  sudo arp -a and I found nothing extraordinary so I also got on
our Netgear router and told it to cough up a list of attached
devices, showing the same list of stuff that the first two sweeps
found.  Additionally, there was 1 mac address with no other
information such as an IP address or system name, just that MAC
on a row all by itself.

I had been looking for our DVD player which has the
ability to view streamed movies and I think this might be it.

As a computer user who is blind, I don't directly use
this player but my wife does.  We usually play DVD's from it
however she did use it once to watch a movie off the network and
it worked fine.

I asked her if she remembered giving our WiFi password
and she said no but was given a message to go to a certain url to
authorize payment in order to watch the film and it all worked
down to the monetary slurp so this is not a complaint or gripe
about anything.

My question is, did the link she went to on the computer
or maybe her iPhone use javascript to get our WiFi password and
if so, how did the player get the authorization to use our WiFi?

The stray MAC showing up on the router is probably the
player broadcasting an attempt to get in the network but to do
so, it has to send the password in order to get a DHCP lease
which would then allow it to get on the internet.

I am just curious about how did this work and could a
person cause it to log on to our WiFi network and receive a video
stored on a system here?

I'm not trying to rip anybody off but it's good to
know what extra features are under the hood.

What I am actually thinking of is more like a DVR where a
computer can record a TV show like the old-school VCR's and then
one could play it back through the DVD player on the network.

This player can also update it's firmware when necessary
and we've never been prompted from it for a WiFi password.  It
just seems to be able to get through when it needs to.

I guess this could also be a neighbor trying to mooch
WiFi, but I doubt it.  Everything with an IP address belongs to
us and there are no odd amounts of data coarsing through our
router that aren't caused by us.

This is a neighborhood in a college town so one must be
careful but not too paranoid.

Thanks for any good ideas.

Martin



/usr/share/calendar.usholiday

2022-01-16 Thread Martin McCormick
There's a stale version of this file on my system that reflects
when Debian was installed but it brings a question to mind.

Does this file simply cause messages to appear on an
event calendar or can it be used along with crontab in some way
to either cause or prevent cron jobs from running if a date
matches one of the dates in the file?

I use cron and at jobs all the time and have thought that
it would be nice to skip some jobs if the day is a holiday and
the result might be not what one wanted.

Right now, I don't think this file is doing a thing as it
is for 2017 but this is why I am asking.

I also saw versions of that file for other countries such
as the UK.

Thanks for all good responses.

Martin McCormick



Re: /usr/share/calendar.usholiday

2022-01-17 Thread Martin McCormick
Greg Wooledge  writes:
> On Sun, Jan 16, 2022 at 09:58:11PM -0600, Martin McCormick wrote:
> > There's a stale version of this file on my system that reflects
> > when Debian was installed but it brings a question to mind.
> 
> The one in the Subject: header?  Are you sure that's the correct
> path for this file?

I goofed.  I thought I could remember it long enough but
it is actually


/usr/share/calendar/calendar.usholiday

I also still had an old directory tree from when I had
wheezy on the system and there is

/home/wheezy/usr/share/calendar/calendar.usholiday

> 
> On Debian 11, I have the file /usr/share/calendar/calendar.usholiday

I am presently running

Debian GNU/Linux 10 as in Buster.
---


> which is a different path from the one you showed.

That was just a mistake on my part.  Sorry to add more confusion.

This also reminds me to get rid of the old wheezy files
since I now don't even remember why I saved them but they are
getting backed up nightly for no reason at all other than they
get caught up in the sweep.

Martin



Re: /usr/share/calendar.usholiday

2022-01-17 Thread Martin McCormick
deloptes  writes:
> And if you look into the file, you see it has no years associated with the
> date, so it doesn't matter when it was written unless there was a change 
> in
> the official holidays in the US.

Correct.  I see two types of date references, exact dates
such as Christmas and New-year's and rule-based dates which are
some designated day such as the second Monday in a given month,
what the British refer to as a "bank holiday."

My original question about this file has been answered in
a round-about way in that there are also two types of holidays.
St. Valentines day, for example, is not a postal or bank holiday
but one will certainly get in deep trouble on the home or
romantic front if that day is forgotten.

Also days like Arbor Day are a nice idea but nothing
about normal commerce or daily activities changes

I also noticed that today in the United States should be
marked but hasn't been yet.  It is the third Monday in January
which, since 1986 has been the official recognition of
the birthday of a US civil rights leader, Martin Luther King Jr.

The entry in that file probably should read:

01/MonThird Martin Luther King Birthday (3rd Monday of January)

It is now a major holiday and schools and government
offices are usually closed so it should probably be there.

Thanks to all and sorry if I created  any confusion about
the path.

Martin McCormick.



The Raspberry Pi that Took a Day Off.

2022-01-25 Thread Martin McCormick
This Pi is running Debian Stretch.  I believe that's what version
9 is called.  I have it capturing audio from a radio receiver and
it's been doing that for several years now and it was doing that
yesterday morning.  Later in the day, I downloaded more audio
and, after a long pause, I got the message from ssh that the
Raspberry Pi wasn't there any longer so I retrieved the Pi from
the room where it was and brought it to my Debian desktop system
to work on it.

I could login to the Pi which seemed to be up and running
but the short story is that it couldn't talk to any address but
our router.I couldn't even ping it's interface from the Pi,
itself.

If I was on the Raspberry Pi's console, everything looked
normal as long as one wasn't using the TCP/IP interface.  You
could even do a ip addr or an ipconfig -a command and it would
show that it had gotten the correct address from our dhcp server
which is in the router.  It would successfully ping the router
but no other addresses, not even the address it uses on our
network.

I finally quit messing with it and went to bed but fired
it up again today, January 25 and low and behold, it just came
right up and is now back doing what it has been doing.

Is it possible that it got a corrupted lease for dhcp
from the router?  Dhcp leases on our Netgear router are issued
for not quite 24 hours so it may have gotten a bad lease, kept
renewing it for the time it was powered up and then it got a new
version of that lease today and all is well.

It's the same IP address because I have put it in the
router as a static IP address.

The other thing that is weird is that the Raspberry Pi in
question has both a wired Ethernet and a WiFi interface and both
were misbehaving identically.

Normally, the wired port is not used and the dhcp lease
renewal process happens over WiFi.

The results of ip addr always showed a correct subnet
mask and the only rules in iptables are the 2 default rules.  In
other words, all looked normal except that it didn't work.

While I had it on the work bench, so to speak, I ran fsck
-fy on the SSD card since it has been a couple of years since I
last did that and there was not a single squawk about anything.

Thanks for any ideas about how things got wrong and then
magically fixed themselves.

When I turned it off last night, I gave it the halt -p
command.  The power supply has no switch so I unplugged it from
power so it started fresh about 8 hours later.

Martin WB5AGZ



fail2ban Squawk

2021-03-26 Thread Martin McCormick
I was attempting to setup a systemd timer and checking the syntax
of that when I ran across a complaint from the fail2ban program
which is a bit confusing.  It reads:

/lib/systemd/system/fail2ban.service:12: PIDFile= references path below legacy 
directory /var/run/, updating /var/run/fail2ban/fail2ban.pid → 
/run/fail2ban/fail2ban.pid; please update the unit file accordingly.

So I looked in to that file and the actual line they were
referring 2 is numbered 15 and points fail2ban.pid to
/var/run/fail2ban/fail2ban.pid where it certainly lives with a
recent date.  What is the problem exactly?

Enquiring minds want to know.

Thanks for any and all constructive ideas.

Martin McCormick



Is there any way to snoop on a USB port?

2021-04-29 Thread Martin McCormick
I have a Windows box that has software on it which programs
two-way radios and it would be nice to know what the radio and
computer are saying to each other.

After trying a Windows application that reportedly can
capture serial port traffic, I find that it doesn't appear to
work with usb ports and unix/linux is my preferred world anyway
so is there any sort of hardware that would pass through a USB
connection from the Windows box to the radio and let me siphon
off the traffic to a linux system and log it?

The Windows app I tried to use has been around for a
decade or more and probably works well with RS-232 ports but the
traffic I need to grab comes from a usb device that creates
/dev/ttyACM0 if plugged in to a Linux box and comm2 on the
Windows system

When I tried it today, it did nothing but complain that
it was not connected.  It finally dawned on me that it probably
sees no serial ports at all as it is supposed to automatically
find and log all port I/O and this is a relatively new HP
Pavilion desktop computer which has no native RS-232 ports or
parallel ports on it and, even if it did, the connection from the
radio to the usb port is a usb plug with the usb hardware in it
and a cable that plugs in to the radio that would most likely
not be practical to tap.

Thanks for any good thoughts.

Martin  WB5AGZ



Grub on Dead Disk

2021-06-01 Thread Martin McCormick
I had this same problem late last Fall on this same drive
and am not sure what is going on because there is another Linux
system here whose drive is arranged exactly the same way.  An
update in March modified grub and I didn't even give it a thought
because that system just works but after an update a couple of
days ago, the dead system starts a boot but grub complains about
neither possible image being bootable.

When I rescued that system last Fall, I was advised on
this list to do the following which worked perfectly by the way:

>If you want a grub-install command that writes /boot/grub files
>somewhere onto /dev/sdd then you will first have to mount the desired
>target boot partiton of /dev/sdd on some mountpoint that you choose,
>and then run a command something like this:
>  sudo grub-install
>--boot-directory=/some/mountpoint/where/is/the/sdd/boot /dev/sdd

I mounted the drive on /mnt so looking at /mnt gives you / and
the directory where the correct files are is then /mnt/boot or
possibly /mnt/boot/grub.

I created the following shell script which I named do_grub.

#!/bin/sh
  sudo grub-install \
--boot-directory=/mnt/boot/

I get the following no matter where I point boot-directory:

./do_grub
[sudo] password for martin:
Installing for i386-pc platform.
grub-install: error: install device isn't specified.

I don't remember doing anything else.

I think this time I may also need to do update-grub on
the currently bootless drive.

As with the last time this happened, the dead drive
passes all fsck tests and the first time I ran fsck  on it,
nothing needed fixing.

This is one of these problems that hardly ever comes up
which means that when it happens, one spends/wastes a lot of
time doing duckduckgo and puzzling.  There should be a way to
automate or at least prompt the person running the recovery
attempt to find the right information to get things up and
running if at all possible.  It's all there such as the grub file
in /etc/default which should have the uuid of the/ and swap
partitions.  Right then, one could see if the uuid's are correct
and get a proper boot going in which one could then rerun
update-grub if necessary.  Right now, it's just fumble and fiddle
and wonder what happened.

I must have something set wrong to cause the apt-get
upgrade to build a non-functional grub since the system in
question made a number of reboots successfully between about last
December 1 and now.

I also remember reading a message about problems with
swap which is on /dev/sda5 when the drive is booted.  I found the
messages log which shows swap as correctly mounted and working
before the upgrade.

Is there another log which might still have that message
from apt-get upgrade.  The message was not captured at the time.

I have been using Debian on several systems for a number
of years and this one system is the only one which seems to fall
down every time grub is touched.  That indicates I need to check
one of the configuration files which probably has a wrong
partition ID or something similar.

I am just glad I have another Linux box to mount the
no-boot drive on and that the drive, itself, does not seem
corrupted just as the last time this happened.

Thanks for any constructive ideas.

Martin McCormick   WB5AGZ



Grub on Dead Disk solved

2021-06-01 Thread Martin McCormick
I missed the INSTALL_DEVICE and now the script works.

The next step is to see if the drive boots but I just
forgot that one important detail.  Sorry to waste anyone's time.

Martin



Boot Repair

2021-06-02 Thread Martin McCormick
Is there any free utility that can run in Linux which helps one
rebuild a corrupted boot configuration?

I have a disk which is currently out of it's usual place
as the boot drive for a debian system.  The past two times that
Buster updated grub, the drive became unbootable after  the
update.  The drive, itself appears to be perfectly good and I
think the problem which makes the update kill the drive is
related to a dd copy I made some years ago of one drive to
another so most of what is there is normal.

After the second killing of the drive, I started to
determine what is misguiding update-initramfs as grub-install
seems to produce a grub.cfg file that is looking for all the
right UUID's but when the system boots, grub now fails by trying
to find a UUID that must have belonged to a now deceased system
as it no longer appears in the fstab of either the newly-dead
system or another system which is alive and well and being used
to try to revive the injured drive.

Everything needed to produce a valid boot is there if
only I can run something that will reconstitude the boot image so
that it looks for the right UUID's.

I do remember seeing this message as the update ripped
through the new grub:

update-initramfs: Generating /boot/initrd.img-4.19.0-5-686-pae
W: initramfs-tools configuration sets RESUME=UUID=6f6f4373-45a3-4c16-97b4-f62613
fe6d3b
W: but no matching swap device is available.

That UUID should start with a 3, not a 6 as the blkid for
/swap is what should be there.

I am not totally sure where tthe UUID that starts with
6f6f comes from but that's also the UUID one sees when grub
crashes and burns on liftoff when trying to boot from that drive.

Martin



Re: Boot Repair

2021-06-02 Thread Martin McCormick
Weaver  writes:
> On 03-06-2021 03:59, Martin McCormick wrote:
> > Is there any free utility that can run in Linux which helps one
> > rebuild a corrupted boot configuration?
> 
> https://www.supergrubdisk.org/

Thank you very much as you did answer my question
perfectly but I did not stop to think about all the possibilities
of the form the solution might take.

So, as a computer user who happens to be blind, is this
stand-alone application using a linux kernel containing the
speakup modules?

On the Linux live CD's, one can get those to talk by
striking the S key as the system boots up and then one can hear
what is on the screen as one works.

Do you know what kind of kernel it uses?

Martin



Re: Boot Repair

2021-06-02 Thread Martin McCormick
Weaver  writes:
> https://www.supergrubdisk.org/

The site recommends downloading the hybrid version of
grub2disk so that is what I did because all the Linux boxes I
have are x86 hardware and have CD technology built in.

This is quite an interesting creation.  The ISO image is
a wee bit over 16 MB in size and, as I suspected, the package
includes no screen reader modules whatsoever but I did mount the
CD after burning it and ran

find . -name "*" -print and there are serial modules sprinkled
throughout the distribution.  There are occasional references to
a serial console.

In some of the documentation I have found on the site, I
haven't found one iota of text as to how to make this console
work but if computer users who are blind can access this serial
console, that is like finding gold in them thare hills.

Tomorrow, I will look further for any hints as to how to
make the serial console appear but I actually did read the words
"serial console" on that site.

When I listed all the files on the CD, I also ran across
the following:

./boot/grub/i386-efi/morse.mod
./boot/grub/i386-pc/morse.mod
./boot/grub/x86_64-efi/morse.mod

If this has to do with outputting text in Morse Code, I
know Morse since we amateur radio operators once had to know it
to get our licenses and as long as it is sending at a reasonable
rate which, for me, stops at about 20 words per minute, is
perfectly useful to read the output.

I didn't even see any references to Morse Code on the
site so it's another way to make this useful.

The PC being used to run this CD does have a piezo buzzer
on the mother board so if there is a way to make it sing in
Morse, I may not need the serial console but it certainly would
be nice to know all there is about both of those fall-back
methods.

Thanks to anybody who knows where real sentences are that
explain the serial console or the possible Morse code output.

Martin WB5AGZ



Re: Boot Repair

2021-06-03 Thread Martin McCormick
Weaver  writes:
> Well, let us know how it goes, because I've noted a few visually
> disadvantaged users on the list, and they would find the reference
> useful.

I have found out that grub is very accessible if one has
defined a serial console and there is a working serial port on
the target system.  In this case, both conditions are true.

The next thing one needs is a talking terminal which is
no problem if one has another computer equipped with a serial
terminal program like microcom or what I consider the gold
standard, kermit which apparently has too many dependencies to be
part of the Debian distributions any more.  Kermit has a decent
scripting language so one can save the commands that work, even
the commands that involve entering a huge string in which one
typo means completely starting over again.

This means you can completely repeat all the things that
work each time and feed it all in again in a fraction of a
second.  Talk about working smarter as opposed to harder.

While I call kermit the gold standard, the gold standard
for scripting is expect so one can call unix applications from
the login shell to any valid command, read the output and
generate commands as if one was there.  You can even simulate
human typing rhythms to defeat attempts to detect robots.  I'd
love to see a good CAPTCHA solver with OCR that was so good that
CAPTCHA designers would go out and find honest work but I digress.

This is actually a systemic problem these days when
dealing with sick machines.  Nobody is selling new desktops
with RS-232 native serial ports and that is fine as long as
there is an alternative way such as a bluetooth interface or ssh
network connection.  The dream solution would be a local network
login covering all the lights-out conditions such as BIOS
configuration and failure to boot as in this situation where grub
is confused.

Before I retired, some of our newest servers used
management interfaces and ipmitool where one could turn power on
and off, do BIOS setups and other configuration remotely.  It was
so cool to be able to do those things on a system in another town
without leaving the chair or grabbing a go bag and blowing a
whole day just to flip a couple of switches.  Of course,  
if it was that simple, we usually could call someone we trusted
at one of our remote campuses and ask them to flip the switches
but I'm sure you see the advantage of remote management.

For folks who are blind, you treat all those things as if
they were halfway round the Earth instead of sitting less than 1
meter apart.  They are all headless even if I can extend my arms
and touch both machines.

I think the grubdisk2 GUI app is basically a lost cause
but that's the rule when dealing with accessibility.  When
it's done wrong, you chase down endless rabbit holes all day and
muse as to how there must be some way to turn the sausage machine
backwards and have live farm animals running away from the
other end.

There was an American country and Western song back in
the early seventies which had a line at the end of each verse
that went,

"Work your fingers to the bone
What do ya' get?
Bony fingers."

I think the best course right now is to take my bony
fingers and workup a kermit script to interact with grub and get
it to produce one boot and then use the running system and grub
to fix itself.  So far, nothing else is less work.

I do appreciate your telling me about grubdisk2 because
sometimes, these things turn out to be life savers and you have
to try the rabbit holes to know for sure.

Martin



Re: Boot Repair. Still Going Round and Round.

2021-06-04 Thread Martin McCormick
I placed the ailing drive back on a good Linux system and mounted
it as /dev/sdd1 /mnt
and ran the following commands on it:

#!/bin/sh
#mount the drive being repaired.  Uncomment lines as needed.
  sudo mount /dev/sdd1 /mnt
cd /mnt/boot
#installing to the mounted disk
  sudo grub-install \
--boot-directory=/mnt/boot/ /dev/sda

Installing for i386-pc platform.
Installation finished. No error reported.
root@wb5agz:/#

But wait.  There's more.

root@wb5agz:/# update-grub --boot-directory=/dev/sda
Unrecognized option `--boot-directory=/dev/sda'

Not good.


Continuing on to update initramfs.

#Isolate the disk.


 sudo mount --bind /dev /mnt/dev
 sudo mount --bind /dev/pts /mnt/dev/pts
 sudo mount --bind /proc /mnt/proc
 sudo mount --bind /sys /mnt/sys

That all worked.

 sudo chroot /mnt
root@wb5agz:/# 
update-initramfs -c -k 4.19.0-5-686-pae

That appears to work.


root@wb5agz:/# update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.19.0-5-686-pae
Found initrd image: /boot/initrd.img-4.19.0-5-686-pae
Found linux image: /boot/vmlinuz-4.9.0-9-686-pae
Found initrd image: /boot/initrd.img-4.9.0-9-686-pae

Now this ruins everything.

Found Debian GNU/Linux 10 (buster) on /dev/sdc1
done

This was a chroot environment but it appears that /dev/sdc1 was
recognized as the boot source for this external drive.  /dev is
part of the system.


The external drive normally lives in another system and
is the only boot source which is why it should be /dev/sda1.

Is there any way to run update-grub from grub itself?

The system this external drive is meant for normally only
has 1 boot drive which is the one that is currently confusing
grub.  If I could run install-grub and update-grub from the dead
system, there would not be any other bootable drives and the only
game in town would be /dev/sda for the boot record and
/dev/sda1-5 for the boot drive.

Understanding what is supposed to happen isn't
particularly difficult but getting grub to think simple and easy
Putting the drive on another system and hoping for no
contamination seems to be a lot easier said than done.

Martin



A Grub Boot Question about initrd

2021-06-05 Thread Martin McCormick
I have a plan but I need some more information.  Is there any
personalization done by the boot setup process?  Do our UUID's
or any other specific information pertaining to the installation
make it in to the initrd files?

While reading about the boot process, it doesn't appear
that the initrd files or initranfs are personalized with anything
pertaining to this computer and this installation.

If that is so, then two computers using the same
processor type should be able to use copies of the same initrd files
and the only thing that is personalized on an individual computer
is all the grub configuration in which the UUID's of at least /
and /swap partitions are sprinkled throughout grub.cfg and
/etc/default/grub.

One should be able to write a program to get the
appropriate UUID's out of fstab on the working system
and translate them in to corresponding UUID's for the system on
the operating table.

If the target system actually boots, it is probably a
good idea to run update-grub to make sure that still produces a
working boot but this would still more than likely produce the
same results if this process works in the first place.  It's also
possible that the reconstructed grub setup is okay except for the
drive designation which usually starts out as /dev/sda1.  On my
good Buster system, this is now /dev/sdc1 and on the sick one,
the attempt is being made on /dev/sda1.

The idea here is to copy the concept of what is happening
rather than the literal configurations which definitely will
never work unless one used dd to generate the clone drive and I
have actually done that once and it worked but the cloned system
was then adapted for other uses.  Here, all I want to do is
rescue the boot process so it lives on and not have to reinstall
everything else.

As an aside, one ought to be able to do something like
this.  It makes life a lot simpler.  Both systems are using the
same kernel and versions of the same processor the only real
differences are the UUID's.  The grub configurations of both are
the same down to the serial console.

Martin



Re: A Grub Boot Question about initrd

2021-06-05 Thread Martin McCormick
Reco  writes:
> On Sat, Jun 05, 2021 at 12:46:13PM -0500, Martin McCormick wrote:
> > I have a plan but I need some more information.  Is there any
> > personalization done by the boot setup process?
> 
> Yes. One of the GRUB's tasks is to supply kernel which is about to boot
> with root=... cmdline parameter. Root filesystem UUID can be used for
> this.
> 
> 
> > Do our UUID's or any other specific information pertaining to the
> > installation make it in to the initrd files?
> 
> In Debian - no, unless you include it there for some bizarre reason.
> It's not needed for the things initrd usually does.
> 
> 
> >   If that is so, then two computers using the same
> > processor type should be able to use copies of the same initrd files
> > and the only thing that is personalized on an individual computer
> > is all the grub configuration in which the UUID's of at least /
> > and /swap partitions are sprinkled throughout grub.cfg and
> > /etc/default/grub.
> 
> It's not the CPU difference you need to worry about.
> Different SATA controllers, video cards, NICs - i.e. what they call
> periphery devices - those things require different kernel modules that
> should be (or could be) used in early boot process, and therefore need
> to be included in initrd.
> 
> Luckily, Debian uses initramfs-tools for building initrd, and
> initramfs-tools should build initrd with everything and a kitchen sink
> included (MODULES=most in /etc/initramfs-tools/initramfs.conf).
> 
> 
> >   One should be able to write a program to get the
> > appropriate UUID's out of fstab on the working system
> > and translate them in to corresponding UUID's for the system on
> > the operating table.
> 
> Er, they've invented filesystem labels for exactly this many decades
> ago.
> 
> 
> >   As an aside, one ought to be able to do something like
> > this.  It makes life a lot simpler.  Both systems are using the
> > same kernel and versions of the same processor the only real
> > differences are the UUID's.
> 
> Perfectly possible for the last 15 years or so. Assuming Debian and
> MODULES=most, of course.
> 
> Reco
> 
> 
It sounds like I haven't missed anything obvious so I will see if
I can write a perl script or some other text-muncher that will
recreate the grub configuration of the working system but with
the UUID's of the non-working system plus a grub.cfg file exactly
like the grub.cfg file on the system that refuses to boot but
with the correct UUID labels describing the boot partition on
that system plus a copy of the kernel and it's module directory.

As for partition labels, I have always thought the name
was much easier to deal with than the 36 randomly-selected
characters that make up the UUID on a unix partition but UUID
labels are supposed to be unique and are what you encounter today
so I will see if I can make the script modern compatible.

Thanks to you and delop...@gmail.com.



Re: A Grub Boot Question about initrd

2021-06-05 Thread Martin McCormick
First I greatly appreciate all this information as the idea is to
fix a problem I probably created long ago though I am not sure
how but the short story is that apt-get upgrade ran update-grub
and update-initramfs late last Fall and I was able to rescue it
but it happened again at the end of April so I figured I had
better fix it correctly since I didn't know it was a ticking
bomb.

Felix Miata  writes:
> Martin McCormick composed on 2021-06-05 12:46 (UTC-0500):
> 
> > I have a plan but I need some more information.  Is there any
> > personalization done by the boot setup process?  Do our UUID's
> > or any other specific information pertaining to the installation
> > make it in to the initrd files?
> 
> Dracut includes a root=UUID= statement in the initrd. A root= 
> statement on
> the Grub linu* line overrides it. The override can be any of the accepted 
> forms,
> including root=LABEL= and root=.

Good to know.

> The translation is easy. UUIDs are assigned to devices. The device names 
> are
> acceptable substitutes, just as they used to be the only option before 
> libata made
> device names capable of playing musical chairs. If devices also have 
> labels,
> labels can be used instead of device names.

Very much like the reasoning behind udev which is a God-send if you
have multiple sound cards as one example.

> UUIDs were designed for computer scripts, not human brains. You'll need 
> to make a
> conversion, but instead of UUIDs, I highly recommend using labels when 
> you know
> device names will be different on the system migrated to. UUIDs are 
> appropriate
> too, just rather unwieldy unless scripted.

There's 1 UUID for the root file system in /boot/grub/grub.cfg
which is the file one must not normally edit by hand.  It 
reads

menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu 
--class os $menuentry_id_option 
'gnulinux-simple-658da8df-942e-4ad7-8c5b-695f2f2eb4ed' {

> Grub provides a shell. From the shell it's possible to boot using the 
> information
> you have. Instead of trying to figure it all out in advance, drop to the 
> shell and
> use the device names you know. It's really not hard if you have a copy of 
> a grub
> menu from the two PCs planted in your brain or on paper. Once you've 
> booted, it's
> easy to fix everything up by running grub-mkconfig, and if necessary,
> /etc/default/grub.
> 
> >   As an aside, one ought to be able to do something like
> > this.  It makes life a lot simpler.  Both systems are using the
> > same kernel and versions of the same processor the only real
> > differences are the UUID's.  The grub configurations of both are
> > the same down to the serial console.
> 
> Don't let the massive volume of data in grub.cfg mislead you. Its primary 
> job is
> to find and load a kernel and initrd. If you know where they are and 
> their names,
> none of the menu components or apparent search and identification bloat 
> are
> necessary. Before Grub2 you could simply tell Grub's shell the root 
> device, the
> kernel name (with associated parameters, most of which aren't actually 
> necessary),
> and the initrd name, then boot. With Grub2 you may need to precede the 
> root device
> name with loading a module or two or three, which you see in your copy of 
> a
> grub.cfg, then proceed with the important three. I do a lot of cloning, 
> so I've
> done it often.

Thanks again.  I was starting to get discouraged but I
will try using actual labels since I thought you really shouldn't
do that.

Martin



Re: A Grub Boot Question about initrd

2021-06-06 Thread Martin McCormick
Thanks to all for the advice and knowledge you shared about how
grub works.  I am writing this on June 6 and early this morning,
I  edited the boot command in the grub shell after
verifying that my stubborn no-boot drive truly was sitting at
hd0,1msdos and grub-install had picked out hd2,1msdos for every
single drive reference, even the bare metal one.

I did try that one first in case I was missing some magic
but the only drive on the whole system was that one and listing
the contents of (hd0,1msdos) show exactly what you see if looking
at / so grub showed it exactly where one would expect it to be
and hd2,msdos is pure science fiction on that system so I set
every drive reference to hd0,1msdos except the root which grub
wanted to set to /dev/sdc1.

The sample that Greg Wooledge showed looked very close to
how my grub.cfg looked after doctoring the drive references to
point to hd0,1msdos.  and I tried booting that way and set the
root parameter to /dev/sda1, /dev/sdb1 and /dev/sdc1 which is the
one that grub chose, again non-existent.  /dev/sdb1 is actually a
Zipdisk drive but I tried it anyway since there is no zipdisk in
there.

It never booted so I am throwing in the towel, figuring
that in all the messing around, I have corrupted something and
wasted about two weeks on and off trying this, that and the other.

I have a good 32 GB drive left over from a computer that
died last year so I will just clone it from the working system
that is sending this email.  The drive that can't boot but is
otherwise fine will now be the second drive and will mount as
/home where all the important stuff I used it for can still live.

The only good thing about this exercise is that I know a
lot more about what grub does than I did and I also discovered
that while I had perfect backups of the home directory, I had
failed to set rsnapshot to backup /boot which was quite a stupid
oversight on my part.  /var, /etc and several other directories off of
/ get daily backups and I could have sworn /boot did but it's not
there so I have been doing a lot of industrial-grade swearing
lately.

Grub is a very fine tool when used properly and I do
believe that there should be a pristine way to make a disk
bootable that is intuitive and automatic plus unaffected by the
configuration of any other drive on the system, like the old sys
command in DOS to make any DOS diskette bootable.

The unix incarnation of the sys command would have to do
a lot more such as verify that you have a kernel and modules
ready to go plus consult your /etc/fstab and /etc/default/grub
files but that shouldn't be a real problem.  One would basically
do the grub install in a a total jail so it would come out set as
if one had just been running the installer and this was the only
drive on the system.

Thank you all for your help and sorry that it took so
long to determine that nothing simple was going to work.

Martin



Re: A Grub Boot Question about initrd

2021-06-06 Thread Martin McCormick
Felix Miata  writes:
> IMO you gave up too soon. IIRC you never showed us output from parted -l 
> or fdisk
> -l. Very likely on the problem PC the / filesystem was/is not on the first
> partition, where often lies a swap partition. Very likely root=/dev/sda2 
> would
> have been/be correct.

Sorry.  I meant to do that.

Swap is the last partition.

Disk /dev/sde: 29.8 GiB, 32017047552 bytes, 62533296 sectors
Disk model: 600 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0080

Device BootStart  End  Sectors  Size Id Type
/dev/sde1   2048 59314876 59312829 28.3G 83 Linux
/dev/sde2   59314877 62533295  3218419  1.5G  5 Extended
/dev/sde5   59316925 62533295  3216371  1.5G 82 Linux swap / Solaris

$ ls -1 /mnt/

bin
boot
dev
etc
home
initrd.img
initrd.img.old
lib
lost+found
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
vmlinuz
vmlinuz.old



Re: A Grub Boot Question about initrd

2021-06-06 Thread Martin McCormick
I admit I made several big mistakes, here.  The first was not
having a backup of /boot as I thought I did.  The next is
thinking I could just copy the whole boot directory from a
known working system and be able to get it to work by using sed to
replace the UUID's of the system it was on with those of the
system it will be on.  Had I backed up the broken system instead
the minute I knew there was a problem, it would have been
fixable.

Trying to transplant the good boot system to a different
machine really should work if one knows what all changed but if
that was the case, I'd be crowing about how I got it working.

I may try one last thing which is to decompress the initrd
files and see if there is a way to make sure they work after
transplantation.  At this point, it's probably more important to
know what is poisoning the well as a training exercise since
having good backups of /boot would have turned a major halt in
to a minor irritation.  Trust me.  The good system is going to
get daily backups of boot and grub every 24 hours from this day
on.

I haven't actually done anything yet to clone the good
system's boot drive because I want to do the clone in the middle
of the night when things are quieter and I don't run fetchmail
in the wee hours so the backup sees a more stable file system.

If, by chance, I end up actually making the broken system
work, I'll let you know what it was and the one drive can serve
the whole system again.

Martin



Re: A Grub Boot Question about initrd

2021-06-07 Thread Martin McCormick
Felix Miata  writes:
> This is a big lurking booby trap that could have been the problem both 
> last time
> and this time. It's one of the reasons why installation systems and Grub 
> switched
> from using device names to using UUIDs: inconsistent and/or unpredicable 
> device
> enumeration.
> 
> Is this a PC with both PATA and SATA controllers? These old PCs can 
> compound the
> issue.
> 
> Different kernel, disk controller, USB controller and BIOS combinations 
> can cause
> e.g. an SATA or PATA disk sda to become sde, or sdb become sda, IOW, 
> device names
> that don't persist. UUIDs are supposed to prevent inconsistent device 
> names from
> being a problem, but in a rescue environment, it can muddy the waters, or 
> backfire.

Yes on all counts.  These are old PC's that use IDE
controllers.  The IDE cables end in the normal 34-conductor
header with one pin missing on one side that plugs directly in to
the drive.  In this case, the connector plugs in to a SATA-to-IDE
converter with a female SATA connector.

I believe you have hit the nail on the head because I
know for a fact that the devices change names.  On the working
system, the boot device we would normally think of as /dev/sda is
/dev/sdc and 5 minutes from now might be /dev/sdq depending on
what drives were plugged in to usb ports when the system booted.

Just yesterday, I mounted /dev/sdd, thinking it was the
now infamous unbootable drive and immediately realized that I was
looking at the boot drive that starts the good system.  I had
plugged a thumb drive in to a usb port some time earlier and then
rebooted the system while failing to remove the thumb drive as it
wasn't even being used right then.

Let's see.  $ dd if=/dev/sdd of=/dev/sde  What could
possibly go wrong?  Just kidding this time but that's what we are
dealing with.  That possibly lethal command can work but only
under the right circumstances so if one forgot to recreate the
world one was working with, it's tuition in the school of hard
knocks.  I haven't yet totally given up and done anything else
rash so it's still full steam ahead.  This is one of those
situations where if a person has the time, this can be a
teachable moment.

I've got several thumb drives that I mount based on their
UUID and that method of doing things is your friend if you
understand how to use it.  If not, what one ends up with is total
chaos.

Felix's message hasn't saved the day yet but it confirms
my hunch that the UUID's have been at the heart of this problem
all along because there is simply no other logical reason why one
can not transplant the same boot logic from one system to the
other when they are functional copies of each other.  The trick
will be to replace every UUID personalization which is doable.
Whether it is practical still remains to be seen.

To briefly reference an earlier message, I checked the
good system to see what rsnapshot did over night and /boot is
now committed to a series of little capacitors which is how SSD's
remember things.  From fstab:

# /etc/fstab: static file system information.
UUID="49c4eda8-3bcc-445e-841b-513b07d560fe" /var/cache/rsnapshot ext4 
relatime,rw,user,noauto  0   0

If that drive wasn't always plugged in, the boot drive
would have a different device number than /dev/sdc1 which is also
mounted by UUID.  That drive also plugs directly in to a usb slot
and not any extender to hopefully insure that it is more likely
to be present.

I will uncompress the initrd files and see how hard it
will be to find the UUID and change it to what it should be on
the problem target system.

Again, thanks to all.

Martin   WB5AGZ



Grub Success at Last

2021-06-08 Thread Martin McCormick
I did it!  It works!

Okay.  Here's the short story.  I read some more stuff
about building a boot drive for another system than the one being
used for the rescue.  In this thread were the usual tales of woe
which I have also experienced when misusing grub such as "Oh
#%^*! Now I've got 2 systems that won't boot."  a poster on that
thread states:

   I'm not a grub2 expert (sorry) but try adding --skip-fs-probe to your
   grub-install line, I have found this prevents creation of
   /boot/grub/device.map which can cause booting to a grub prompt. I think
   that without this parameter grub-install, instead of doing what you
   tell it, thinks it is cleverer than you, and may do something
   different.

   Another thing is to be sure you are using the right grub-install (i.e.
   for grub2 and not for original grub). This isn't a problem if you are
   inside Centos but with SystemRecoveryCD both versions are available and
   so you have to use grub2-install. I learned the hard way...

   And as @wurtel pointed out (kudos), you should specify a drive not a
   partition. Grub2 installs in sector 0 of the whole disk drive, and this
   'stub' is what runs at boot time, but it needs to know whereabouts on
   the disk it should install the files for the next stage of booting -
   this is what the --root-directory parameter is for. (I think.)

   Reading man grub-install and googling I see that --root-directory is
   not really meant to be used for grub2 versions 1.99++, though it does
   work in my experience. You are meant to use --boot-directory and refer
   to the actual boot directory, so this would give you:
grub-install /dev/sdb --skip-fs-probe --boot-directory=/media/new_drive/boot

End of quote

I did the following:

#!/bin/sh
#mount the drive being repaired.  Uncomment lines as needed.
  sudo mount /dev/sdd1 /mnt
cd /mnt/boot
#installing to the mounted disk
  sudo grub-install \
--skip-fs-probe \
--boot-directory=/mnt/boot/ /dev/sdd

When you boot your disk that starts out on /dev/sda1,
it's the first partition, in this case, so it will be /dev/sda1
not /dev/sdd1 .  This was quite a long thread and people were
remarking on how it is easy to get confused and do the wrong
thing.

Anyway, It booted right up and then I discovered there
was no network.

The network issue was only tangentially related because
the update-upgrade process also install some more strict and
modified ethernet interface naming rules and eth2 just doesn't
cut it any more.  Now, it's enp0s17 on the system that just got
revived and enp0s18 or something similar on the system that got
the same upgrades but is a little newer and took the tharapy much
easier.  Everything's working again at least in the Linux world.

I saw this ad on TV for some product that is supposed to
improve brain function and memory but I can never remember it's
name.  I could use a few more IQ points and things would flow a
little faster around here.

Thanks for all the help, everybody.

Martin



SSD Memory Card (was The Raspberry Pi that Took a Day Off.)

2022-01-27 Thread Martin McCormick
I thanked the person who responded to my post and reported that
there were no unusual log entries in syslog on the failing system
so not much to go on.  I decided to upgrade the Raspberry Pi
which was suddenly having this mysterious problem as I have
backups of the failing system so I figured I'd just clone a
buster image from another Raspberry Pi that is running buster and
use dd to copy it to the Raspberry Pi which was running stretch
and having that weird problem.

Then, assuming the upgraded Pi was alive, I could use the
backup from the stretch system to put all the user space from my
old home directory on the new buster system but I messed up
again.  The SSD card from the older system is 28 GB and the
working buster system's SSD card is 32 GB so the smaller card
filled up and I achieved that "no space left on device" state
that we all love to see.

Simple, I thought.  I'll just delete all partitions, and
do the dd if=rpi_good.img of=/dev/sdh which is where this card shows
up when it is in the reader and I can maybe dd a smaller 8.5-gb
drive which I have that has almost never been used.

Murphy has struck again.  Here is what happens when I try
to use that 28-gb SSD card:  Script dump follows

Script started on 2022-01-26 20:03:52-06:00 [TERM="Linux" TTY="/dev/pts/3" 
COLUMNS="80" LINES="25"]
1wb5agz martin tmp $ sudo su -
[sudo] password for martin: 
root@wb5agz:~# fdisk -l /dev/sdh
/dev/sdh: 28.8 GiB, 30908350464 bytes, 60367872 sectors
Disk model: USB   HS-SD Card
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x680226ff

Device Boot  Start  End  Sectors 
 Size Id Type
/dev/sdh1 8192   137215   129024   63M  c W95 FAT32 (LBA)
/dev/sdh2   137216 62333951 62196736 29.7G 83 Linux
root@wb5agz:~# fdisk /dev/sdh
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdh: 28.8 GiB, 30908350464 bytes, 60367872 sectors
Disk model: USB   HS-SD Card
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x680226ff

/dev/sdh1 8192   137215   129024   63M  c W95 FAT32 (LBA)
/dev/sdh2   137216 62333951 62196736 29.7G 83 Linux

Command (m for help): d
Partition number (1,2, default 2): 

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): w
fdisk: failed to write disklabel: Operation not permitted
root@wb5agz:~# logout
2wb5agz martin tmp $ exit

Script done on 2022-01-26 20:07:59-06:00 [COMMAND_EXIT_CODE="1"]

So close and yet so far away.  If I try to use dd on
/dev/sdh again, I get:

1wb5agz martin tmp $ sudo dd if=~/rpi/rpi2_good.img of=/dev/sdh
[sudo] password for martin: 
dd: writing to '/dev/sdh': Operation not permitted
1+0 records in
0+0 records out
0 bytes copied, 0.021666 s, 0.0 kB/s
2wb5agz martin tmp $ exit

I've had usb thumb drives fail when filled to capacity
and, if I hadn't been tired, I would have noticed that the image
was 4 gb too large so this wouldn't have happened but surely,
there is some way to at least zero out everything so the SSD can
be either reformatted or used as the output of an image transfer
using dd.

The SSD passed a fsck test earlier in the day before I
blew it up so the chip should be salvageable.  I don't care for
recovering either of the two partitions which will be overwritten
anyway if the SSD can be made writable again.

One can mount /dev/sdh1 which is the fat32 partition
but it mounts as read-only.  If you try /dev/sdh2, you get a
squawk that says that this partition is not in /etc/fstab which
is certainly true but it doesn't mount either so mount doesn't
understand what I was trying to do.  This is the partition that
got the overflow condition so it's utterly useless.

These last 2 days, I have been a day late, a Dollar short
and 1 step behind on what shouldn't be really that big of a problem.

Martin WB5AGZ



Re: SSD Memory Card (was The Raspberry Pi that Took a Day Off.)

2022-01-27 Thread Martin McCormick
Charles Curley  writes:
> I'm no expert on RPis, but that sounds to me like the SD card is
> protected against writes. Check for any physical write protection
> switches on the card itself and the holder.

Thanks for the suggestion, but this is one of those SSD cards
that often is found in a camera and resembles a wafer the size of
a thumbnail.  It has a projection that acts as a key way to keep
a user from inserting it in the wrong way and there is a groove
for a fingernail to help pull the chip out of the socket.  This
particular one was reading and writing just fine until I bricked
it by the DD that must have overwritten some address which now
makes it unwritable.  It went from good to bad without my
removing it from the card reader so there should be some way to
at least clear it for writing again.

Apparently, it stops being writable if the partition
table is corrupted.  In my case, I just want to delete both
partitions and start over.

The OS is debian Buster and has all the tools you can
expect to find and runs on a 64-bit ARM.  Otherwise, it's pure
debian Linux.

Martin



Re: SSD Memory Card (was The Raspberry Pi that Took a Day Off.)

2022-01-27 Thread Martin McCormick
Bijan Soleymani  writes:
> Can you delete both partitions, create a new single linux partition, 
> reboot
> then run mkfs.ext4 to create a single new partition and then just install
> linux onto it or try dd again?

Great suggestions but I can't.  Part of the typescript output I
included was me doing just that and I was root when I did it but
the squawk is that I don't have permission as if I wasn't root.

If writing to the SSD card was possible, I could have
just done the dd command, only with a smaller input image and it
would have worked.

Thank you because what you suggest would be the normal way out.
Martin

Martin



Re: SSD Memory Card (was The Raspberry Pi that Took a Day Off.)

2022-01-28 Thread Martin McCormick
David Wright  writes:
> I've not heard of that problem. You were prevented from zeroing the
> entire device, which would have wiped the partition table anyway.
> 
> What I would want to check is that the OS isn't doing something
> stupid, like trying to automount it, failing, and consequently
> setting the device readonly. By OS, I really mean DEs, or
> automounters in general.
> 
> You could also try zeroing it in another machine, ± any adapters
> required. (Bear in mind that adapters do have readonly sliders.)

I suspect this is the crux of the problem.  the adapter I
connected is a card reader.  You put the SSD in a little plastic
jacket that holds the SSD in such a way that the card reader can
access the edge connector but the holder jacket has no electronics.
There is a small notch in the plastic of the jacket on the left
edge and the right front corner of the plastic carrier has a
diagonal cut to prevent someone from putting it in upsidedown.

Since I posted, there is good news but I still wonder if
I am not going bonkers because after unplugging the Sony card reader
and plugging it back in, I now am getting device /dev/sdg instead
of /dev/sdh.  I was also able to do the following:

#sudo fdisk /dev/sdg

which gave me the fdisk utility as before so I did what crazy
people do which is to do the same thing as before, hoping for
different results.

By Joe, I got them.

I typed d to delete a partition and it put partition 2 up as the
default candidate as before so I selected it and then typed d
again which told me that only partition 1 was left so it was
deleted.

I had gotten this far before so wasn't too excited but type
w and this time got the message stating that the partition table
had been rewritten and fdisk then exited.

Now, doing sudo fdisk -l /dev/sdg yields

1wb5agz martin tmp $ sudo fdisk -l /dev/sdg
Disk /dev/sdg: 28.8 GiB, 30908350464 bytes, 60367872 sectors
Disk model: USB   HS-SD Card
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x680226ff

The partitions are gone.  My latest screwball theory is
that the Sony card reader went in to some sort of protective mode
after the dd operation overwrote the device.  My unplugging the
reader and plugging it back in reran the driver which reset the
protective mode back to normal which may be why it all worked
right this time.

One last question:  Since the image will still be too
large as it is, can tunefs be run on it or a copy of it to shrink
about 4 gb of user space?  The good system I copied the image
from only had about 12%  of the partition used so I should be
able to transplant it to the smaller disk if tunefs can do that
and still leave a bootable device.

Thanks for all useful ideas.

Martin McCormick



Re: SD Memory Card (was The Raspberry Pi that Took a Day Off.)

2022-01-28 Thread Martin McCormick
My thanks to everybody who has responded here.  I think the
prudent thing to do is use a new SSD card and I have one that is
supposed to be a full 32 gb.  The card I was able to finally
clear the partitions on is several years old but I think it is
still good but the suggestion to use it in a less mission
critical application is a good idea plus it is not a full 32 gb.

I have a radio receiver that can store information on one
of these cards and I'll use it for that since if there turns out
to be a bad cell somewhere, the world won't end like it can if
one's kernel or sector information becomes corrupted if it
happens to land in a vital piece of code.

Again, many thanks.

Martin McCormick



Re: SD Memory Card (was The Raspberry Pi that Took a Day Off.)

2022-01-29 Thread Martin McCormick
There's always one more question that nobody mentions and none of
the articles one finds on the topic don't touch.  When looking at
the man page for resize2fs in debian, it talks about the -b
option to turn on "the 64 bit feature."
__

   When shrinking the size of the partition, make  sure
   you do not make it smaller than the new size of the ext2 filesystem!

   The  -b  and  -s  options enable and disable the 64bit feature, respect-
   tively.  The resize2fs program will, of course, take care  of  resizing
   the  block  group  descriptors  and moving other data blocks out of the
   way, as needed.  It is not possible to resize the filesystem concurrent
   with changing the 64bit status.
__

Do I need this since the Pi runs an ARM processor which
would make the command

   #sudo resize2fs -b /dev/loop0p2 6.3g

or is it the same command without the -b flag?

I have determined that the 28.9 gb SSD card is 10% full
with the debian installation and the files I want in my login
directory.  I found a 7.3 gb SSD card that has probably never
been used that came with the first Raspberry Pi I bought around
2012 or so, going for a 32-gb card instead.  If I shrink the
Linux partition to 6.3 gb which is what the small card had
available, I should have it about 40 or 50% full.  I can then
safely dd it on to a larger card any time I want to do so and
then use resize2fs to expand the Linux partition after it is
installed.

What I did so far was to mount the 27-gb partition on
/mnt through /dev/loop0 and edit /mnt/etc/hostname to reflect the
host name for the system being rebuilt.  The edit changes the
image which is really neat.  All that is left is to shrink it
down to 6.3 gb and it should be ready to dd on to the 7.3 gb card
which should be bootable on it's own but which I will use to seed
a new 28-gb system that can be customized after it is running.

Many of the raspbian distributions have a #1 partition
that is a small fat32 lba partition for Windows users to be able
to activate debian from Windows.  Is this even necessary once one
is using unix tools on the disk?

Thanks to all the good advice from everyone.  I am seeing
the end of this project and have learned some new  useful tricks
that are good to know.

Martin



Resize2fs Questions

2022-01-31 Thread Martin McCormick
I figured I would start a new topic as none of this pertains to
the previous messages I posted.

I've got an almost 30-GB disk image of a working debian
installation for a Raspberry pi that I should be able to easily
squeeze on to a roughly 8 GB SSD card because it only takes up
10% of the 30-GB card and I think I am close but not there yet.
Because I hate drudgery with regards to syntax, I wrote a little
shell script that makes it easier to duplicate the same actions
and also makes it easy to show exactly what is happening so far.
The big image name is

rpi1_good.img

and it is 29 gb in size.  Here are the commands that work so far.

#!/bin/sh
#This resets everything for a new run.
  sudo losetup -d /dev/loop0
#copy a backup to the image name to start fresh.
sudo cp -p rpi1_good.img.bak rpi1_good.img
#This takes about half an hour.  Now, get to business.
sudo losetup -P /dev/loop0 rpi1_good.img
#This should show 2 partitions on loop0 when successful.
sudo ls -l /dev/loop0*
#You get /dev/loop0p1 and p2
#e2fs is required to run before one can resize.
   sudo e2fsck -f /dev/loop0p2
#I should be telling resize2fs to squeeze everything in to a 7GB
#partition.
   sudo resize2fs /dev/loop0p2 +7G

There are no complaints up to this point and resize
appeared to work so now it is time to reduce the size of
partition 2.

This may be where things go off the track.

I run

sudo fdisk /dev/loop0

and fdisk tells me it is 29.9 GB which I expected since Partition
#2 should be mostly empty but for the OS and my login directory.

I note that the starting sector for P2 is 137215 since
one must start at that sector and then I delete P2 and then add a
new partition which defaults to 2.

fdisk prompts for the first sector with a default of 2048 but I
type in 137215.  The last sector is in the 62-million range and I
want only 7 GB as the size so I type +7G and it takes that.

I then type w to save the changes and there is no
complaint.

The first hint of trouble is when you do fdisk -l
/dev/loop0.  The size count is still almost 30 GB but then a ray
of Sun in that P2 has a size of around 7 GB.

I outwitted Murphy this time by using another file on my
computer as the target rather than the SSD card so that if it
went over 8 GB, nothing annoying would happen.

I watched on another console as the size climbed past 5
GB, then 6 and 7 GB and then it was up past ten so it was going
to do the whole 30 GB if I hadn't stopped it.

I am not sure what I missed but the manual page for
resize2fs warns you to use something like fdisk to trim off the
excess empty space which is what I thought I did.  I would also
have thought that the disk image file should have deflated like a
punctured air mattress but it didn't.

I think I am almost there but obviously not yet.

Thanks in advance for ideas.

Martin



Fixing a Grub Foul-up

2020-11-16 Thread Martin McCormick
I have goofed, I think.  There is a serca-2000-vintage Dell
Optiplex that has been working fine up to yesterday when I did
the usual apt-get update followed by the apt-get upgrade on
buster.  The update and upgrade appeared to work.

One of the things that got visited was grub and it was
then that I was reminded that there was another drive in the
system that had a bootable image of buster on it also.  Grub
reported seeing it on /dev/sdc which is coorrect.

This particular system has a zip drive that always shows
up as /dev/sdb so the next hard drive after /dev/sda is /dev/sdc.

I rebooted to make sure all was well and waited and
waited . . .

The system sits there like a bump on a log.

I have a usb device that lets one mount IDE and SATA
drives that are outside the system so I pulled the sata drive
which is the boot drive for the now dead system and plugged it in
to the usb converter.

the drive breezes through fsck and looks perfectly
normal.

I looked at /boot/grub/grub.cfg which one is not supposed
to edit as grub builds it based on /etc/default/grub which one
does edit.

If I was to mount that partition on a working system, it,
of course, will have a different device number such as /dev/sde1
instead of /dev/sda1 which it should have when booting up the
system it normally runs in.

Is there a safe way to mount this drive, possibly using
chroot, re-run grub-config and get the drive bootable again?

If I look at grub.cfg and /etc/default/grub, everything
looks as if it should work but it doesn't.

I think boot problems are some of the most agrevating
issues.  They are true show stoppers.

I've got backups but that's beside the point.  Unless I
can fix whatever happened, it's going to be quite a time waster.

Thanks for any constructive suggestions.

Martin McCormick



Re: Fixing a Grub Foul-up

2020-11-16 Thread Martin McCormick
Dan Ritter  writes:
> Here's what you can do:
> 
> On a good system, mount your drive. Let's pretend that it's
> recognized as /dev/sdg, and you have a /boot on /dev/sdg1 and
> a root partition on /dev/sdg2.
> 
> ls -al /dev/disk/by-partuuid/| grep sdg
> 
> will get you the partition UUIDs for that disk. One of them will
> be for /dev/sdg1 and another for /dev/sdg2.
> 
> The kernel really likes these as root filesystems identifiers.
> The kernel parameter that you put in /etc/default/grub is
> 
> ROOT=PARTUUID=dddf0dd6-dd6b-d542-9eac-015a765cd6f6
> 
> although you will want to substitute in the appropriate
> part-uuid for /dev/sdg2.
> 
> Finally, you can run
> 
> grub-install /dev/sdg
> 
> to get a new copy of grub into the master boot sector of the
> disk.
> 
> Hope that helps,

It certainly does!
First, thanks to all who answered so far.  I think you have
perfectly described what is causing the problem although grub is
not high in my knowledge base like it probably should be.

When I read /boot/grub/grub.cfg, I see
references to a uuid that isn't any of the partitions that have
UUID's.  On my disk, Partition 1 is / and blkid spits out a
number that starts with 9F.  Partition 2 was created to get an
extended partition of 5 which is swap space so 1 and 5 have
UUID's.  The UUID referenced in grub.cfg starts with 3.
The rest of this message consists
of grub.cfg.

Martin

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
insmod all_video
  else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
  fi
}

serial --speed=115200 --unit=1 --word=8 --parity=no --stop=1

terminal_input serial
terminal_output serial
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
set timeout=5
  fi
fi
play 480 440 1
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu 
--class os $menuentry_id_option 
'gnulinux-simple-3584c851-6616-464f-8a8e-2d634fca5969' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 
--hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  
3584c851-6616-464f-8a8e-2d634fca5969
else
  search --no-floppy --fs-uuid --set=root 
3584c851-6616-464f-8a8e-2d634fca5969
fi
echo'Loading Linux 4.19.0-5-686-pae ...'
linux   /boot/vmlinuz-4.19.0-5-686-pae 
root=UUID=3584c851-6616-464f-8a8e-2d634fca5969 ro console=tty0 
console=ttyS0,115200n8 quiet
echo'Loading initial ramdisk ...'
initrd  /boot/initrd.img-4.19.0-5-686-pae
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 
'gnulinux-advanced-3584c851-6616-464f-8a8e-2d634fca5969' {
menuentry 'Debian GNU/Linux, with Linux 4.19.0-5-686-pae' --class 
debian --class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-4.19.0-5-686-pae-advanced-3584c851-6616-464f-8a8e-2d634fca5969' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; 
fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root 
--hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  
3584c851-6616-464f-8a8e-2d634fca5969
e

Fixing a Grub Foul-up, Not There Yet.

2020-11-21 Thread Martin McCormick
I did some duckduckgo-ing about grub rescue and found useful
things but am still dead in the water.

I appear to be using grub, not grub2.  One of the
articles I found had an example of how to use grub rescue that all
works except, of course, for the actual booting of the kernel.

There's an extra little wrinkle in that, as a computer
warier who happens to be blind, grub isn't really accessible in
that you can not get direct access to it via a serial port and
terminal, say, from another computer that is actually working.  A
really clumsy work-around does work off of the dead computer in
that it is old enough that the Print-screen key dumps an ASCII
character dump of the screen to the parallel printer output every
time you press Print-screen.  I found out after connecting a
second computer to a parallel-to-serial converter that I was in 
grub rescue>  mode.

Each time one types on a keyboard attached to the dead
computer, one then must hit Print-screen to find out whether it
goes or blows.

This is slow and awkward because there is no
character-by-character feedback so if you hit the n instead of
the m, you don't find out that it's a no go until you read the
whole screen.

Also the Tabs you hit don't show up in the output so
it'salloneunbrokenline.

Is there a way I can write the commands in to a text file
that I can call to at least know what commands I am executing in
grub rescue and do in a tenth of a second what it takes minutes
to do otherwise?

What I have right now is a text file called stuffcommands
and it is sitting in the boot level of the dead boot disk.
When I had the drive mounted on a working system, I did chmod +x
stuffcommands but since there are no shells running, I just put
the following lines in the file.  Everyone of these commands
works when typed in except for the final one which boots the
kernel.

What I need to type in with, of course, no mistakes looks
like:

set root=(hd0,1)
linux   (hd0,1)/boot/vmlinuz-4.19.0-5-686-pae   root=/dev/sda1

#I have yet to see this one work.

initrd (hd0,1)/boot/initrd.img-4.19.0-5-686-pae boot

Here is a screen capture of what pressing Print-screen
produces  The first line is that error message and is probably
the clue as to what went wrong.  The successful commands were
laboriously typed in by hand once again to prove they work
although by now, I know the kernel version number about as well
as my last name.

error: symbol `grub_calloc' not found.  

That's the smoke that the booster is going to blow up on the
launch pad.

Entering rescue mode... 
grub rescue> ls 
(hd0) (hd0,msdos5) (hd0,msdos1) (fd0) (fd1) 

The root partition is Partition #1.

grub rescue> (hd0,1)/boot/stuffcommands 
Unknown command `(hd0,1)/boot/stuffcommands'.   

Ah, if only.  Those few lines would make each retry so much more
efficient.

grub rescue> set root=/de/sda1  

It worked.

grub rescue> linux(hd0,1)/boot/mlinuz-4.19.0-5-686-paeroot=/de/sda1 

And that one worked!

grub rescue>

That much works and it would be so nice not to have to repeat
those steps every time.  Is there a way to call that
stuffcommands text file so that grub thinks it's coming from the
keyboard?


I think I'd like a keyboard that one can store commands
like this in so as to keep the donkey work down to the problem
lines.

Actually, if only grub could be made to operate remotely,
I'd just script all the stuff that works and also know if I
fat-fingered anything when it happens so one could backspace and
fix it the way we fix any typing error.

Before I retired in 2015, I occasionally had to setup new
servers and these had lights-out minicomputers that helped one 
remotely access even a powered-down box in another state,
province or country.  The linux kernel, itself can easily be
configured to be accessible via a serial port or on the local
console so grub sorely needs headless capabilities for those rare
times where stuff just doesn't come back from a reboot.

    I appreciate the good suggestions I have gotten from
several of you so far.

Martin McCormick



Re: 780 files in /usr/share/zoneinfo/

2020-11-21 Thread Martin McCormick
 writes:
> Suppose a hacker logs into your computer from far, far away, say
> from somewhere in Nepal.
> 
> Surely you'd want this person to see the time adapted to their
> locale? That's the least courtesy you can be expected to provide?
> 
> ;-P
> 
> Now putting my tongue out of my cheek again: in Unix, a computer
> "has" no time zone or language -- people have those. And since,
> again in Unix, several people can be logged in [1] at the same time,
> it's up to the user's environment [2] to decide on time zone,
> language, etc.
> 
> This concept is surprising at first coming from other cultures,
> where Microsoft was happy to sell you another complete version
> of Windows if you wanted your computer to talk to you, e.g.
> Portuguese (and yet another for Brazilian Portuguese, greedy as
> they are).
> 
> Of course, Microsoft has caught up (they are trying since the
> mid-90s), but not without some spectacular messups. Remember that
> one where (I think it was Windows 95), while trying to automate
> the spring DST transition were spotted dithering endlessly between
> 2AM and 3AM?
> 
> Unix has had this abstraction always: there's the internal time,
> and there's the time shown to the user, which depends on the user.
> 
> There's the error itself, and there's the error message shown to
> the user. And so on.
> 
> Cheers

I just cd'd to that directory and it looks like there's
about 1 GB there.  I think it is cool to have all that info and I
even configured a linux system for BST so cron would record shows
I was interested in from the BBC.

It works perfectly when we go from Summer time to
standard time in Winter because North America and the UK don't
switch at the same time but it all works.

I've wished one could just set certain parts of the
computer to other times but I can also understand why this could
be a problem.

By the way, I have never been outside the United States
but am an amateur radio operator and learned at a very young age
to appreciate those time zones if one wants to know when to
listen for interesting things.

Martin



Re: Fixing a Grub Foul-up, Not There Yet.

2020-11-21 Thread Martin McCormick
Felix Miata  writes:
> Save yourself many keystrokes by using the symlinks in the root directory 
> instead
> of the long-winded full version-named /boot/vmlinuz-4.19.0-5-686-pae

This is wonderful to know and in the root or / directory of this
disk, there is 
initrd.img, initrd.img.old, vmlinuz and vmlinuz.old

Those all point to valid targets.  I presently have the
no-boot disk mounted on a working linux system where it's root
directory is /dev/sde1 and the current links plus the old links
are as follows:

lrwxrwxrwx   1 root root32 Jun 26  2019 initrd.img -> 
boot/initrd.img-4.19.0-5-686-pae
lrwxrwxrwx   1 root root31 Jun 26  2019 initrd.img.old -> 
boot/initrd.img-4.9.0-9-686-pae
lrwxrwxrwx   1 root root29 Jun 26  2019 vmlinuz -> 
boot/vmlinuz-4.19.0-5-686-pae
lrwxrwxrwx   1 root root28 Jun 26  2019 vmlinuz.old -> 
boot/vmlinuz-4.9.0-9-686-pae

I finally have found something that may be a clue to
what's actually wrong. While trying to manually make that drive
boot, I got this:

grub rescue> set prefix=(hd0,1)//boot/grub
grub rescue> insmodnormal
Unknown command `insmodnormal'.

That was a good old syntax error so I tried

insmod normal with a space
grub rescue> insmod normal
error: symbol `grub_calloc' not found.

I'm pretty sure that shouldn't happen at all and is
what's behind the failure to boot.

I haven't found any uuid's that are different although I
first thought I had as I looked at some links which had uuid's
but they were good when I looked at the actual partition.  It's
easy to go down a rabbit hole if one doesn't watch out.

I think there may be something about grub that got left
out or changed during the upgrade.

Martin

Martin



Re: 780 files in /usr/share/zoneinfo/

2020-11-21 Thread Martin McCormick
Andy Smith  writes:
> Hi Martin,
> 
> Are you sure about this? There is no Debian or Ubuntu host I have
> access to that has a /usr/share/zoneinfo/ that contains more than
> 4MiB of data. For yours to have 256 times this much is quite an
> aberration. What did you type to determine that your
> /usr/share/zoneinfo/ has 1GiB of data in it?

find . -name "*" -exec ls -l {} \;  \
|grep -F / \
| awk ' { total += $5 } END { print total }'

That usually just adds the sizes of all the files it can
find all the way through the tree.

If this is not an accurate way to determine how many
bytes there are in a directory then that would be the reason for
the discrepancy.

> 
> >   I've wished one could just set certain parts of the
> > computer to other times but I can also understand why this could
> > be a problem.
> 
> You can set any process to have a different time zone by use of
> environment variables.
> 
> $ date
> Sat 21 Nov 21:34:55 UTC 2020
> $ TZ=America/Los_Angeles date
> Sat 21 Nov 13:35:04 PST 2020

That is very true but cron only works in the time zone
for wherever the TZ for the system is set.

On the system I have set to British time, my local login
shell has TZ=America/Chicago so I read Central Standard Time for
file time stamps but if I set a cron job, it runs on either
British Summer Time or British standard time which is the same as
UTC during Winter.


> Cheers,
> Andy



Re: Fixing a Grub Foul-up, Not There Yet.

2020-11-21 Thread Martin McCormick
Dan Ritter  writes:
> in /boot/grub/menu.lst
> 
> serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
> terminal serial
> 
> (yes, that's two lines)
> 
> I hope that helps.
> 
> If you want the option of either serial or console access,
> replace the second line with
> 
> terminal --timeout=10 serial console
> 
> The default will be serial, but if you press a key on the
> console within 10 seconds, it will go there instead.
> 
> -dsr-

Thank you.  That is a tremendous thing to know.  I
thought there was something serial in grub but I couldn't
remember.  This is the first time I ever had any real trouble
with grub and I can put this drive back on the working linux box
and modify that file, assuming the change would take place on the
next run of grub.

Martin



Re: Fixing a Grub Foul-up

2020-11-29 Thread Martin McCormick
Dan Ritter  writes:
> Here's what you can do:
> 
> On a good system, mount your drive. Let's pretend that it's
> recognized as /dev/sdg, and you have a /boot on /dev/sdg1 and
> a root partition on /dev/sdg2.
> 
> ls -al /dev/disk/by-partuuid/| grep sdg
> 
> will get you the partition UUIDs for that disk. One of them will
> be for /dev/sdg1 and another for /dev/sdg2.
> 
> The kernel really likes these as root filesystems identifiers.
> The kernel parameter that you put in /etc/default/grub is
> 
> ROOT=PARTUUID=dddf0dd6-dd6b-d542-9eac-015a765cd6f6
> 
> although you will want to substitute in the appropriate
> part-uuid for /dev/sdg2.
> 
> Finally, you can run
> 
> grub-install /dev/sdg
> 
> to get a new copy of grub into the master boot sector of the
> disk.
> 
> Hope that helps,
> 
> -dsr-

This does help a lot and I have read similar examples how
to work on a drive that has been mounted on a different system
than the system on which it will ultimately be used but I am
still doing something wrong and the results are dangerous to say
the least.

At one time, the otherwise good drive was mounted on
/dev/sdd with the root partition on /dev/sdd1.

I typed sudo grub-install /dev/sdd.  It ran for a few
seconds, announced that grub was installed without any errors and
exited.

After looking at /dev/sdd1/grub and seeing no updated
date stamps, I had a sinking feeling and looked at /dev/sda1
which is the boot partition on the system I haven't killed yet
and, sure enough, grub-install had run on that drive.

$ ls -lt /boot/grub
total 2372
drwxr-xr-x 2 root root   12288 Nov 29 11:26 i386-pc
drwxr-xr-x 2 root root4096 Nov 29 11:26 locale
-r--r--r-- 1 root root7276 Sep  3 05:43 grub.cfg
-rw-r--r-- 1 root root 2396122 Sep  3 05:43 unicode.pf2
-rw-r--r-- 1 root root1024 Jun 29  2019 grubenv
drwxr-xr-x 2 root root4096 Jun 29  2019 fonts

It didn't even touch any part of /dev/sdd1.  With
trepedation, I rebooted the good system and thankfully, it came
right up since I hadn't modified /etc/default/grub.  That was a
bit of good luck but I thought it was supposed to write to /dev/sdd1
which would translate to /dev/sda1 when the drive was connected
to the controller of the system that is presently belly up.

I suspect the problem is the issue with the modules which
another poster described.

What am I failing to do to make the changes occur on the
designated drive?  Having it write this kind of stuff to drives
other than the desired target is scary.

Thanks for a good explanation and I may not be so lucky next
time.

Martin



Re: 780 files in /usr/share/zoneinfo/

2020-11-30 Thread Martin McCormick
Andy Smith  writes:
> Hi Martin,
> 
> On Sat, Nov 21, 2020 at 08:48:51PM -0600, Martin McCormick wrote:
> > find . -name "*" -exec ls -l {} \;  \
> > |grep -F / \
> > | awk ' { total += $5 } END { print total }'
> >
> >   That usually just adds the sizes of all the files it can
> > find all the way through the tree.
> >
> >   If this is not an accurate way to determine how many
> > bytes there are in a directory then that would be the reason for
> > the discrepancy.
> 
> The same file can be reached by multiple names. So by doing this you
> end up, in this case, with a ~256x amplification.
> 
> A simple "du -sh" does a better job here!
> 
> > cron only works in the time zone for wherever the TZ for the
> > system is set.
> 
> Ah, I see. I've never tried it but I believe that systemd timers can
> have a time spec that includes time zone, so you can set timers that
> fire on a different time zone to that used by the rest of the system.
> 
> $ systemd-analyze calendar '11:00 Europe/London'
>   Original form: 11:00 Europe/London
> Normalized form: *-*-* 11:00:00 Europe/London
> Next elapse: Sun 2020-11-22 11:00:00 UTC
>From now: 6h left
> 
> Cheers,

I do appreciate being corrected, here.  What we really want to
know, here, is how much precious disk space is occupied by
whatever data base we are interested in.  Links make copies of
files appear to exist when the data were only written once even

Martin



Re: 780 files in /usr/share/zoneinfo/

2020-11-30 Thread Martin McCormick
Michael Stone  writes:
> The kernel, compressed, is larger than that. The initrd needed to boot the
> kernel is also typically larger than that. A modern system has more CPU
> cache than that. At some point trying to save bytes is a waste of 
> developer
> and administrator effort, and 3.5MB in 2020 is well past that point. If 
> you
> want a minimal system, debian isn't for you. Instead, you'll need to hand
> craft every file to make sure it isn't "wasting space". If that's your
> thing, great. But it's just not a focus for debian.

About the only place one still needs to think this way is
with embedded systems where the computer is there to manage a
machine of some kind, anything from a lathe to a food processor
to a cement mixer, whatever .  

General-purpose computers are optimized to have as many
resources as one can cram in to a higher and higher-density box
so a few MB here or there aren't noticed but embedded systems are
optimized with different priorities and one may discover that
this box may be lightning fast but a bit skimpy on data storage.

I am thinking of things such as cable TV boxes and
dedicated audio-visual appliances that use DSP to emulate complex
and expensive hardware by using mathematical algorithms that
cause the system to decode digital TV signals or route internet
traffic rapidly.

If you aren't in to trying to modify some sort of
embedded system to do something it wasn't originally designed to
do then ram and storage are getting cheaper by the day and some
things just aren't worth worrying about.

Martin McCormick



Re: Fixing a Grub Foul-up, Not There Yet.

2020-11-30 Thread Martin McCormick
I am going to respond to one of my earlier posts as it doesn't
help things at all to spread misinformation which I am guilty of,
here.
"Martin McCormick"  writes:
> I appear to be using grub, not grub2.  

No.  It's grub2.  Old Grub is now grub-legacy and is
probably a dead fly on somebody's wall by now.

> There's an extra little wrinkle in that, as a computer
> warier who happens to be blind, grub isn't really accessible in
> that you can not get direct access to it via a serial port and
> terminal, say, from another computer that is actually working.

I was simply wrong there.  Of course, one has to have the lines now
in /etc/default/grub that used to be in menu.lst but the idea is
the same.  If one has a serial port which is available at boot
time, grub should work headlessly.

The issue with the instance of grub that seems to have a
run-time error due to a problem with modules, may be unusual
because it may actually be a goner before it runs since it
doesn't get to load it's modules.

Martin



Re: Fixing a Grub Foul-up Solved!

2020-12-01 Thread Martin McCormick
David  writes:
> Your lack of success is because the the command you used has designed
> behaviour to install the grub bootloader to the boot sector of
> /dev/sdd, and also install the grub files you listed into the current
> system /boot/grub (which was not on sdd at the time). That is the
> reason why you see those files on /dev/sda1, because it was the boot
> partition at the time you ran the command.

Aha!! that makes perfect sense now that I think a bit.
> 
> If you want a grub-install command that writes /boot/grub files
> somewhere onto /dev/sdd then you will first have to mount the desired
> target boot partiton of /dev/sdd on some mountpoint that you choose,
> and then run a command something like this:
>   sudo grub-install
> --boot-directory=/some/mountpoint/where/is/the/sdd/boot /dev/sdd

I tried it and by Joe, it wrote to the correct drive so I
don't feel quite so paranoid about using grub.

Interestingly, I goofed again and grub ended up in what
is the / directory instead of /boot/grub so it still didn't work
but I knew immediately that the new grub was working because
there was no error message about symbols not found, etc. 

I mounted the drive back on the good system and simply
removed the grub from the top of the tree and then did the
grub-install command again but thihs time, I installed to
/mnt/boot.

It wrote to /boot/grub as it should have and the system
came right up.

There was a minor glitch when I powered the box up as the
keyboard reported a stuck condition and advised me to press F1 to
continue.  I thought this was a bit amusing since the keyboard
appeared to be malfunctioning but F1 did the trick and about a
tenth of a second later, I heard the beep that grub plays when
the kernel is about to fire off.

In short, the faulty grub that made it onto the system
was all that was really wrong.

Thanks to a lot of you, I appreciate grub more as this
has been quite a little mini course in what it does.

Martin



Cron Jobs and Time Zones Has Anything Changed?

2020-12-02 Thread Martin McCormick
In a recent discussion, someone indicated that there might be a
way to set individual parts such as accounts on a unix system so
that cron could use another time zone if needed to kickoff jobs
on that system based on the time in another country.

As far as I understand cron, one can set the system's
time zone to only one value which is usually one's local clock
time and that works very well since system logs and cron jobs all
agree with what is appropriate for one's location.

I record a news broadcast from one of the BBC services
every week day at 17:45 British time.  When Europe and North
America stop or start shifting daylight in Autumn or Spring,
there's a really good chance of missing some of the broadcasts if
one doesn't think about it since these shifts don't all happen on
the same time.

One can certainly get the time anywhere as recently
discussed by setting the TZ environment variable but, if you tell
cron to trigger a job at 17:45, it only knows when that is based
on the entire system's local time.

Has anything changed recently to make this logic
obsolete?

In my case, I just have an old Linux box for which I set
it's system time zone to Europe/London and call it good but this
could get out of hand if one had more than 2 or 3 such schedules.

One could also setup VM's if you have the memory to spare
but this adds a lot of resource usage and complexity to the job
at hand so my question is basically, has anything fundamentally
changed in the way cron is used?

This is not a complaint at all.  I was first introduced to
unix-like systems in 1989 and immediately knew that this was the
sort of OS I wanted to stick with in amateur radio and technical
tinkering in general.

Martin McCormick   WB5AGZ



Re: Cron Jobs and Time Zones Has Anything Changed?

2020-12-02 Thread Martin McCormick
Greg Wooledge  writes:
> I was vaguely thinking of a similar approach.  Set up a job that runs
> every hour, or across a set of hours that will cover all the possible
> cases that you care about, in your crontab.  Within the job itself,
> set a TZ variable and determine the time in that time zone by whatever
> means necessary, and then either abort or continue based on that time.
> 
> This is also similar to how one approaches a complex date-based task
> such as "run on the second-to-last day of each month".  For that one,
> you can set up the job to run on the 27th through the 30th every
> month.  Then within the job itself, determine whether it's the
> correct day, and abort if it's not.

What I was thinking of is a modification to cron which
should integrate nicely with what cron already does.

Crontab would have a new field at the beginning of each
line which could normally be left at "default" which would be the
normal behavior that we are used to.

If someone wanted to run a job at 15:00 each day in let's
say Japanese time, the first field of the line would read
Asia/Tokyo instead of default.  The line might look like

Asia/Tokyo 28 15 * * 1-5 sh -c ". $HOME/.master.env;beep -f700 -l500"

Since all unix-like systems start out with UTC and use
those /usr/share/zoneinfo data base files to calculate what local
time is, that information is handy  in the time() function.
localtime(time) gets you the adjusted number of seconds for your
locale arranged in a structure containing fields for the current
year, day of month, day of the week plus the hours, minutes and
seconds with the adjustment for Summer or Winter for that zone.

The sample line above would cause cron to grab the
current epoch in seconds (UTC), feed that to localtimebased on
rules for /usr/share/zoneinfo/Asia/Tokyo and then all those
values to match the fields on the rest of the line.

The time of 15:28 or 3:28 PM in Tokyo occurs around 01:28
in the Central US time zone and that's when your computer would
have beeped.

This would happen Monday through Friday Japanese time
which still would be Monday through Friday in the US but early in
the morning.  If the time referenced in Tokyo had been 7:00 in
the morning , it would happen the previous evening in the US.  As
long as one designated the time zone correctly and doesn't forget
that 07:00 on Monday morning in Japan equals 5 or 6 o/clock on
the evening of the previous day, it should just work.

I haven't looked at the C code for cron, but I have
written a few perl scripts that do things with time and dates and
the current epoch-based number of seconds since utc Midnight January
1, 1970 is based on the C modules such that one's current
wall-clock time is time(localtime).  Just a thought

Martin



Re: Cron Jobs and Time Zones Has Anything Changed?

2020-12-03 Thread Martin McCormick
> On Wed, Dec 02, 2020 at 01:58:45PM +, James B wrote:
> > This might be wrong, but as far as I understand doesn't systemd
> > now have the ability to manage cron jobs (as well as mount points,
> > home folders and other things)?. Is there anything in this newer
> > functionality that might make such a thing (re the request at the
> > beginning of this thread) possible?
> 
> Yes, I pointed this out to OP last time OP asked this exact question
 just a few days ago, so I don't know why they are asking again.

I am guilty as charged but haven't yet found the relevant information
as to how systemd helps solve this issue.

Systemd is praised to the rooftops by some and cursed
just as vehemently by others and it is what we are now using but
it feels mostly like unix has always felt.

I am obviously suffering from the worst sort of ignorance
syndrome which can really bite in that sometimes, we have an idea
what we don't know and other times, we don't even know that we
don't know and that's really frightening.

So, I need to read more general information about the
differences between systemd and what we've been using up to
recently.

Martin McCormick



Re: Cron Jobs and Time Zones Has Anything Changed?

2020-12-06 Thread Martin McCormick
Andrei POPESCU  writes:
> On Jo, 03 dec 20, 07:39:14, Martin McCormick wrote:
> >
> >   So, I need to read more general information about the
> > differences between systemd and what we've been using up to
> > recently.
> 
> The Wikipedia page and/or https://systemd.io might be a good place to
> start.
> 
> Kind regards,
> Andrei

I've had a chance to investigate this more and the first
thing I did was to go to wikipedia which told me about systemd,
the on-going argument about it VS older ways to build unix-like
systems and a time line when systemd began to take hold which was
around 2015 when I retired from work so it kind of sneaked up on me
and I didn't realize that I've been using it for 5 years, well,
at least I didn't think much about systemd having different
resources.

I've used udev rules in making sound cards come up in the
right order and that's totally a systemd thing.

While searching for ways to use cron with different time
zones, I found out about something called systemd timers just
mentioned in this thread and it appears they definitely will do
the job but one must magically have made the connection between this
concept and the concept that cron, the usual go to resource for
making lighting come on at a certain time, purging stale files or
backing up the system now has a new kid on the block called
systemd timers.

One can even list all the active systemd timers

https://www.maketecheasier.com/use-systemd-timers-as-cron-replacement/

$ systemctl list-timers

And, sure enough, I had a number of them ticking away.

An on-going problem about self-education is that it's
easy to limit the scope so much that we miss connections.
Systemd timers doesn't even sound like a replacement for cron but
think of it as cron on steroids.

One of the things in the wikipedia article about systemd
was a complaint by someone that it's just too complicated.  All I
can say is that maybe or not that is true but that's just life.
Start simple.  Make more and more complexity as problems with
simple show up.  One day, try to make things simple again.  Lot's
of luck with that.

I'm not so sure that being blind makes nearly as much
difference these days as it once did, but making connections that
relate one knowledge base to another in a meaningful way will
always be a problem for us.

Martin



Re: Web-bot tarpit aka spider trap (was: swamp rat bots Q)

2020-12-06 Thread Martin McCormick
It's nice to see that I am not the only sick puppy out there.

At 69 years old, I still don't have much trouble with
getting in touch with my inner 12-year-old when it comes to
intrusive marketing which is so prevalent these days.

I found our old dial-up modem in a box of odds and ends 2
years ago and wondered if it could read callerID tones sent after
the first ring.  It can so I started on a perl program that
initializes the modem for callerID and then compares the strings
received with a pair of files, one of which is called scum and
contains callerID name packets of folks we don't want to talk to.
The other is called good and looks for names of friends or anyone
else we like hearing from.  It is actually scanned first and
causes the program to abort.

If anyone's name matches a name in scum, or the caller's
ID appears to be blocked or, in one case, matches a whole
exchange, (first 3 digits after the area code), I call a
subroutine that makes the modem answer for half a second then
drops the call.

We were bombarded with garbage calls all day long until
the US presidential election and it was so satisfying to hear the
program kill the call by answering just as the second ring began.

I also installed subroutines that looked for the word
"SPAM?" just before the name or "ROBO?" also just before the
name.

We now get very few unwanted calls but occasionally,
we'll get a call from lala-land from someone we don't know who
lets the phone ring until the answering machine picks up and then
fails to leave a message and I tell my wife, "I'll go put them on
the juke box." especially if it looks like the name of a business
with which we have no relationship.

    Our phone is very quiet these days except for legitimate
calls.

Martin McCormick



Re: Gene you poor soul

2019-05-21 Thread Martin McCormick
Gene Heskett  writes:
> On Tuesday 21 May 2019 08:07:17 pm Jude DaShiell wrote:
> 
> > If brltty is killing all other usb numbers, that's a bug that needs
> > fixing!  Much of the other computer peripherals going into modern
> > computers these days go in through usb ports.
> > If that ran, my standard keyboard and speakers would be killed and if
> > those two get killed, I can't use a computer since I use speech
> > synthesis for output since I've never been able to see a screen.
> >
> This only affected the seriel to usb dongles.  And I've at least 3 in
> this system.  Since x10 will never make another CM-11a, and a
> firecracker is different enough it won't talk to any of the older stuff,
> it either works or I build a whole new system to automate one group of
> lights.
> 
> > One time I remember the Navy went and fixed band width hogging bugs
> > with their mandatory training and took out the requirement to position
> > a mouse and click to move to the next slide.  This was done to support
> > accessibility.  Its other effect was on all of the ships in the
> > fleets. Sailors suddenly discovered it was easier to complete their
> > mandatory training.
> > That was one instance where accessibility improvement had a good
> > effect on those in remote environments.
> >

I found this thread accidentally and got interested in it
so here are my two Cents worth.

When you run a program or application, that application
may need kernel modules that aren't part of the kernel right now
so it looks in a special directory which is
/lib/modules/long_number.  In my case, long_number is

4.9.0-6-686-pae

Yours could be the same or more likely, it will be
different and you find that out with the command

uname -r

The output you get from uname -r is what you put after
/lib/modules/

Your modules directory might have a module supporting
brltty and you can find that out by cd
/lib/modules/that_long_number and then doing ls |grep -i brltty.

What that does is list all the files in the directory and
only print those containing brltty in their name and it won't
matter if the brltty is all upper case, lower case or some crazy
mixture.

If nothing is there, you have no brltty modules so you
have found the bottom of that rabbit hole and don't need to dig
any further.

If you do, however, then lookup how to keep your computer
from using that module since you don't need brltty anyway.  That
procedure is different with different versions of Linux so read
how your version blacklists kernel modules to keep them from ever
loading.

    This is one of the many things about unix that are really
useful since you can tweak your system to fix seemingly
intractable problems at times.

Martin McCormick



Upgrade to Buster and perl Device::SerialPort

2019-07-09 Thread Martin McCormick
There is a system here that I upgraded to buster from stretch
which runs a perl program I wrote that accesses a RS-232 dialup
modem over /dev/ttyS0, a native RS-232 port on the mother board.

It works.  The dialup modem is pretty useless these days
for it's original intended purpose but I wrote a nasty little
program that reads callerID tags and lets telemarketers take a
trip down Memory Lane when they repeatedly call us.

There is another system whose hard drive crashed a couple
of weeks ago so I put stretch on it from a netinstall disk and
promptly upgraded it to buster before installing cpanplus and
Device::SerialPort as the less software you have, the smoother
the upgrade, generally.

Interestingly enough, the system that didn't crash and
was upgraded perl and all from stretch to buster is handling the
modem fine, whistling cheerfully at callers who are too big of a
wuss to properly identify themselves.

On the system that got perl after the new drive, the
complaint is that none of the parameters such as baud rate,
handshake and all other trates throw errors right and left about
uninitiallised variables, the variable being the port that was
previously defined.  It's like the port isn't there.  The first
program I tried that exhibited this behavior was one that
accesses /dev/ttyACM0, a device that shows up if you plug a
Uniden scanner radio in to a usb port.  In stretch days, it
nicely acted as a RS-232 port.  Right now, it shows up as soon as
the cable is connected but the program I wrote in perl to control
it throws the same errors.

Obviously, the two boxes are separate hardware and the
cable to the radio scanner is not long enough to stretch over to
that same box to see if it works there, but I suspect it might.
I think the difference is that perl was added after the buster
upgrade on the serially-deaf box and neither the virtual usb
serial port nor the actual hardware serial port seem to work any
more even though they show up in /dev and the /dev/ACM0 port goes
away when unplugged.

Any ideas as to what is going on here?

I am also a member of a perl discussion list but I
thought I would start here as this problem is directly related to
buster VS stretch.  With stretch, it all worked.

The only other possibility is that there may be a
recommended syntax for perl and serial ports that I got by with
violating in earlier Linux and now the chickens have come home to
roost and I need to do it differently but much of what I wrote is
stolen from other code examples so I bet it is something in
buster that isn't right yet.

Any suggestions are much appreciated.

Martin McCormick WB5AGZ



Re: Upgrade to Buster and perl Device::SerialPort

2019-07-10 Thread Martin McCormick
David Christensen  writes:
> Post a console session showing the commands issued and the error messages
> produced.

I'll go you one better.  I'll show the code of one of the
programs that dies instantly. It uses /dev/ttyACM0 which is the
device created when a Uniden scanner radio is plugged in to a usb
port.  I also have the program that controls a RS-232 modem and
uses /dev/ttyS0 and gives the same results but contains more
lines so let's go with the scanner program.

Here's the console session short but not sweet.

Script started on 2019-07-10 12:32:35-05:00 [TERM="linux" TTY="/dev/pts/7" 
COLUMNS="80" LINES="25"]
1wb5agz martin tmp $ p2 sts
Can't call method "baudrate" on an undefined value at /home/martin/etc/p2 line 
37.
2wb5agz martin tmp $ ls -l /dev/ttyACM0
crw-rw 1 root dialout 166, 0 Jul 10 08:32 /dev/ttyACM0
3wb5agz martin tmp $ exit

Script done on 2019-07-10 12:33:21-05:00 [COMMAND_EXIT_CODE="0"]

You used to only see that kind of response if /dev/ttyXXX
was missing.  On rare occasions, the scanner radio's tty would go
away and one would need to umplug it and reseat the plug to get
it back and it would then work.

The rest is 66 lines of code for the scanner control
program.

#!/usr/bin/perl -w
use strict;
use warnings::unused;
use File::Basename;
use File::Copy;
use File::Spec;
use Time::Local;
use Device::SerialPort;

sub waitfor {#Receive from serial port.

my $received = "";
our $port;

until ( "" ne $received ) {
$received = $port->lookfor;
}
return ($received);
}#Receive from serial port.

#no more sub routine code past this point

#main global variables
our @dbstrings;

#main local variables
my $response;
my $cmd= "";
my $ONEARG = "";

#my $counter = 1;

#Setup the comm port.
my $dev = "/dev/ttyACM0";
our $instring = "";
our $port = Device::SerialPort->new("$dev");
$port->baudrate(115200);
$port->databits(8);
$port->parity("none");
$port->stopbits(1);
$port->handshake("none");
$port->read_const_time(500);# 500 milliseconds = 0.5 seconds
$port->are_match( "\r", "\n", );# possible end strings

foreach $ONEARG (@ARGV) {   #each argument
$ONEARG =~ s/^\s+//;
$ONEARG =~ s/\s+$//;
$cmd = $cmd . " " . $ONEARG;
$cmd =~ s/^\s+//;
$cmd =~ s/\s+$//;
}#each argument

$cmd = uc $cmd;
$port->write("$cmd\r");
$instring = waitfor;
my @chars = split( "", $instring );
foreach my $char (@chars) {#

#print ord($char);
if ( $char =~ /[\,\s\.\-\+\_0-9A-Za-z]/ ) {#printable
$response = $response . $char;
}#printable
}#
print "$response\n";
$instring = "";
exit(0);



solved! Upgrade to Buster and perl Device::SerialPort

2019-07-11 Thread Martin McCormick
After making an utter ass of myself on this group and
another list, something somebody suggested helped me solve the
problem and the news is good for all.

I thought it was odd that a serial program I am running
on one buster system was running like the proverbial house on
fire, no trouble at all while that same code blew sky high on
another buster system that I had had to replace the boot drive on
after it crashed.

We need to be careful when diagnosing trouble not to
think about esoteric issues and be sure the power plug is in the
outlet and the ON/OFF switch is in the On position.

Well, it wasn't quite that stupid on my part but darn
close.

For as long as I can remember, debian Linux defaults to
disallowing non-root users in general from accessing the serial
ports.  To access /dev/ttyXx, non-root users need to be added to
the group "dialout" and an upgrade doesn't remove anybody who is
there now from dialout so one doesn't even have to give it a
second thought.

In this case, this was more like starting from bare metal
and I simply forgot to add me to dialout which is done by

sudo usermod -a -G dialout martin

One must then log out and back in for the change to take
effect.

A person on a perl discussion group reminded me that I
should always test for issues like this which is absolutely
correct.  Perl will tell you about the error and kill the program
as it should but you need to be smart enough to put the test in
or you get what I got which is utter confusion because the
program blows right through the bash: /dev/ttyS1: Permission denied
condition and tries to grind on which is impossible since the
port won't work.  There is no reason to continue after that
point.

The function in perl is called die and it has the ability
to print a string stating what error caused the death but it
doesn't just appear by magic.

I added the dialout group and that program now also runs
like the blazing house.  Nothing's wrong with buster and serial
ports after all.

I use the die("cause of death\n") function all the time
but forgot to put it in to a test to see if one could access
/dev/ttyXx and it bit me.

Thanks to all who responded with good suggestions.

Martin McCormick WB5AGZ



Looking for a Couple of Programs in Buster

2019-07-11 Thread Martin McCormick
I wanted ckermit and a program called dosemu and apt-get says
they aren't available.  Here is the sources.list file I am using.
Are these applications really gone or is there another archive to
search

sources.list follows and I started out in stretch:

# 

# deb cdrom:[Debian GNU/Linux 9.9.0 _Stretch_ - Official i386 NETINST 
20190427-11:18]/ buster main

#deb cdrom:[Debian GNU/Linux 9.9.0 _Stretch_ - Official i386 NETINST 
20190427-11:18]/ buster main

deb http://ftp.us.debian.org/debian/ buster main
deb-src http://ftp.us.debian.org/debian/ buster main

deb http://security.debian.org/debian-security buster/updates main
deb-src http://security.debian.org/debian-security buster/updates main

# buster-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ buster-updates main
deb-src http://ftp.us.debian.org/debian/ buster-updates main

Thanks.

Martin McCormick WB5AGZ



Re: Looking for a Couple of Programs in Buster

2019-07-11 Thread Martin McCormick
Greg Wooledge  writes:
> https://tracker.debian.org/pkg/ckermit
> https://tracker.debian.org/pkg/dosemu
> A very useful site, in my experience, and tragically not well known.

That is really good information.  Thanks.

  I am not even sure if dosemu
will do what I need and ckermit was always my goto terminal when
I need to blast bytes at a radio scanner or anything else using
serial comm.

Anyway, as a computer user who happens to be blind, I
have a DOS diskette that reportedly has the ability to make your
PC boot off of a usb port even if such capabilities are unknown
to the BIOS.  Maybe, and I stress maybe, dosemu might let one
hear the menu to know which key to press.  When one actually uses
the disk, one isn't going to hear that menu but you just wait for
the disk to stop turning and press the desired key.

Being able to hear the menu would depend on whether or
not the emulator has ASCII characters to work with or just
bit-mapped pixels.

The ultimate goal here is to be able to usb-boot a thumb
drive containing debian wheezy as I have some development tools
that compile in that wheezy version and do not compile in today's
world.
When I am not using the PIC development system, I could
boot normally in to buster or stretch on that same system.

I don't like to throw out older PC's as long as they can
still do useful work. This particular system is a 600-MHZ Pentium
with a GB of RAM, too slow to do gnome but good enough for email,
audio and general tinkering.

Again, thanks for the tracker info.

Martin McCormick



Can Grub Boot Through a USB Port on an Old PC?

2019-07-22 Thread Martin McCormick
The PC is old enough that it can not natively boot via a serial
port but it might if grub knew about the bootable drive sitting
in one of the ports.

Thank you.

Martin McCormick



Re: Can Grub Boot Through a USB Port on an Old PC?

2019-07-23 Thread Martin McCormick
Pascal Hambourg  writes:
> Le 23/07/2019 à 04:53, Martin McCormick a écrit :

> Do you mean that GRUB is installed on an internal drive ?

Yes.

> By default, GRUB relies on the BIOS disk services to access drives. But it
> also has native ATA and USB drivers which are not loaded by default. See
> the 'nativedisk' command.
> 
> 
> 
> Be aware that loading native drivers switches GRUB to a new different 
> world
> : BIOS drives (hdX) will not be available any more and environment
> variables pointing at drives such as $root and $prefix will need to be
> updated with native drive names (ataX, usbX...).

Thanks again for the heads up.

> 
> Also, note that chainloading a bootloader (boot sector or ntldr) which
> relies on BIOS disk services will not work. Loading a kernel and initramfs
> should work if they include native USB drivers.

My thanks to all who responded.  In addition to your responses, I
later found a discussion  on one of the stackexchange sites
dealing with this same issue and was about to kick myself for
wasting everybody's time but it turned out every response touched
on a different aspect of the issue so it sounds like it will keep
me busy for awhile.

It may turn out to be less of a headache to make it a
duel-boot system.  One boot would be the latest debian console
and the other would be Debian Wheezy as I have some PIC
microcontroller development tools that don't make in today's
world.

This is a Dell Dimension motherboard with 1 GB of RAM and
a 600-MHZ Pentium which works very well in the command-line world
so I'll run it until the motherboard fries.  Yup! It's about 20
years old but no reason to trash it yet.

Martin WB5AGZ



Re: Can Grub Boot Through a USB Port on an Old PC?

2019-07-23 Thread Martin McCormick
Pascal Hambourg  writes:
> If the system on the USB drive is GNU/Linux, you just need to put /boot on
> the internal drive so that GRUB can load them.
> 
> 
> 
> as I have some PIC
> microcontroller development tools that don't make in today's
> world.
> 
> 
> Did you consider chroot instead of multiboot ?

Not until I read this message!

I have used chroot a few times and know that the
directory is now the root of the jail you have made but I didn't
stop to think that this also means that while one is in that
jail, all the pathsare now relative to the bounds of the jail
including libraries and executables which also see only wheezy
libraries so any executables should be happy.  The binaries we
make with the assembler never execute on site but do so in the
tiny brains of the PIC processors.  The programming device
we use to flash the PIC eprom connects to a native serial port or
a usb-to-serial converter and if those work through the walls of
the jail, there should be no trouble.

If the programmer still works, that is a winner and many
thanks.

Martin McCormick



Re: Can Grub Boot Through a USB Port on an Old PC?

2019-07-25 Thread Martin McCormick
Pascal Hambourg  writes:
> Did you consider chroot instead of multiboot ?

I have had some time to play with chroot and there is only 1
problem I have just discovered with everything else working
perfectly.

What I did was use what would have been the wheezy boot
drive as follows:

The only partition that could be used here was partition
1 which, on this system was /dev/sde1.

I mounted /dev/sde1 to /mnt and used rsync to copy
everything it could including devices to /home/wheezy

rsync --devices -alHvbq /mnt/ /home/wheezy

It appears to have done that and /dev/ttyUSB0 was there
so I tried to test it as user martin, not root as in "Safety,
first."

When I tried to access the port, I got Permission denied
which means one isn't in the dialout group.  This always happens
if you forget to add yourself via usermod as root.

I went backup to root while still in jail and commanded:

usermod -a -Gdialout martin

There was no complaint so I su'd back to martin and did groups martin.

I was in all the groups one is put in by default when
creating a new account but no dialout.

After trying a full logout from the jail, I did what
many criminals do and went right back in and tried groups martin
once again.

No dialout and no complaint either.

I did successfully compile a small PIC binary from source
with the old environment and compared it with a compile from 2016
and noticed that the binaries were different.  After saying a few
choice words, I checked a little further and noticed that both
were exactly the same size to the byte so I ran strings on each
binary and found or maybe rediscovered that gpasm which is the
PIC assembler puts a time and date stamp on each build you make
from source so I don't know for sure that the new build is
exactly the same but I would bet money it is.

Anyway, usermod from jail fails quietly and I never get
added to dialout.

Again thanks for the suggestion and any constructive
ideas are appreciated.

    Many thanks.

Martin McCormick



Re: Can Grub Boot Through a USB Port on an Old PC?

2019-07-25 Thread Martin McCormick
Tixy  writes:
> I've used 'schroot' in the past for this sort of thing, let's you
> configure what to mount and I believe either defaults or has examples
> for the common things you're likely to need like /dev and /proc. I
> don't remember the details as it's been quite some years since I used
> it.
Thanks for this information.  I have installed schroot
as this seems to be the missing link I didn't know about.

I knew one had to have all the resources turned on so to
speak and it looks like schroot  makes getting it right in this
century much more likely.

martin



Easiest way to do VGA to Text

2019-07-30 Thread Martin McCormick
I've been trying to do the impossible, more like the
impractical, for some time now so I need a knowledge infusion.

I want to be able to read the VGA output of a computer,
do OCR on it and have ASCII text.

As a computer user who happens to be blind, one of the
most frustrating issues is the fact that except for expensive
servers, none of these boxes output any machine readable text
when booting up or in setup mode such as when the coin cell that
powers the CMOS BIOS gives up the ghost and one needs to do a
setup on it, etc.

It seems as though we may have reached one milestone in
that one can buy a usb frame grabber that spits out UVC
webcam-style video.  The representative of the company which
makes the device  told me that most common flavors of VGA cards
produce signals that would work with the device but some odd-ball
cards won't work with it which makes sense.

Assuming most will work, what one would have is frame
after frame of digitized video.  If this is a setup screen, the
only thing likely to be changing until you do something is the
cursor may be blinking otherwise, it's going to be pretty stable.

You'd have one frame of video to do the OCR on and then
one does something such as hit the Tab or one of the arrow keys
and then you grab another frame and read it and so forth.

Are there any free projects out there which take the raw
video as input and output text as output since the frame grabber
is just the beginning of the beast and then you have to convert
it to text and maybe some method of determining where the
highlight as in cursor position is so as to know what one is
about to select?

Needless to say, but saying it anyway to avoid confusion,
one would have the frame grabber and text engine on a different
working debian computer since the sick one isn't capable of doing much
until the BIOS gets set correctly.

I have 4 older PC's that generally work well running
debian but Right now, 3 of them need varying degrees of attention
to their BIOS setups as Dell motherboards and possibly other
brands will occasionally modify their boot sequences for some
reason and the only way one can boot from a CDROM is to get in to
the BIOS setup and yank the boot order back to one where the CD
drive is ahead of the hard drive or put an unbootable hard drive
in.  Six or eight months later, one will suddenly discover that
the boot sequence has fallen back to  the useless one where the
floppy drive is first, followed by the hard drive followed by the
CDROM.

Martin McCormick WB5AGZ



Re: Wireless home LAN - WiFi vs Bluetooth?

2019-08-01 Thread Martin McCormick
ng power supplies
that ran this data network and each supply was attempting to
still run.  The chopping oscillators in those supplies normally
chopped at  ultrasonic frequencies in the range of 100 KHZ or
more but that day, there were probably only receiving 20 or 30
volts at the power socket so they were oscillating at very
audible frequencies like so many derange smoke alarms, rising and
falling in pitch in an eerie wale.

Our serial RS-232-based network seemed sophisticated at
the time with battery backup of each node and so forth but that
sustained period of low and varying voltage convinced the
processors in the nodes that someone was changing baud rate and
loopback settings so, when the phase was restored and the normal
world returned, that network was fouled up beyond recognition for
quite a long time.

We got the nodes back by reloading each one with saved
backup files so that wasn't so bad but some of the weirdness was
propagated to nodes in other buildings so we didn't get it all
cleaned up for literally weeks.  It was mostly okay that
afternoon but we would get calls from departments across the
university that this or that printer or VT100 terminal wasn't
working when somebody tried to use it and the fault turned out to
be another randomly deconfigured port.

The down phase created an apocalyptic scene what with
overhead lighting mostly absent but occasionally trying to
flicker on and the wailing power supplies.

Martin McCormick WB5AGZ



Re: 3 phase power (was Re: Wireless home LAN - WiFi vs Bluetooth?

2019-08-01 Thread Martin McCormick
rhkra...@gmail.com writes:
> An update | correction | recollection ;-)
> 
> On Tuesday, July 30, 2019 11:34:43 AM rhkra...@gmail.com wrote:
> > I have seen diagrams in NEC code books for a different arrangement to 
> get
> > 120 volt 3 phase power, but I don't recall ever actually encountering 
> that
> > in real life.
> 
> Oh, wow, how quickly I forget -- I did encounter systems like that, often 
> for
> lighting in industrial applications,  And, further, iirc, we could (and 
> did)
> buy and install florescent light (and maybe HID?) fixtures designed to 
> work on
> 208 volts, which we connected phase to phase in that kind of system.
> 
> Of course, I could be misremembering.
> 
> > In that case, iirc, 120 volt loads are connected from a hot
> > tap to the neutral wire (the 4th wire of the 3 phase arrangement), and 
> you
> > get (nominally) 208 volts (RMS) connecting phase to phase.  I have seen
> > things like motors that were rated like 240 / 208 volts (or something 
> like
> > that).
> 

That's the way I understand it too.  One of the buildings
we worked in at Oklahoma State University had low-voltage wiring
to the light switches.  Pressing the On button turned on the
overhead light, accompanied by the click of a latching relay.
Pressing Off released the relay with another audible click from
above.

I asked one of the electricians as to why the fancy light
switches.

The building had 3-phase wiring for the air handlers and
the lights were powered phase-to-phase at 208 volts.  This would
have been dangerous if someone took the plate off of a switch for
any reason because every wire would be hot between it and
anything else.

Martin



Re: Easiest way to do VGA to Text

2019-08-01 Thread Martin McCormick
john doe  writes:
> On 7/30/2019 7:01 PM, Martin McCormick wrote:
> >
> >   I have 4 older PC's that generally work well running
> > debian but Right now, 3 of them need varying degrees of attention
> > to their BIOS setups as Dell motherboards and possibly other
> > brands will occasionally modify their boot sequences for some
> > reason and the only way one can boot from a CDROM is to get in to
> > the BIOS setup and yank the boot order back to one where the CD
> > drive is ahead of the hard drive or put an unbootable hard drive
> > in.  Six or eight months later, one will suddenly discover that
> > the boot sequence has fallen back to  the useless one where the
> > floppy drive is first, followed by the hard drive followed by the
> > CDROM.
> >
> 
> Why not "simply" deconnecting the hdd  once booted reconnecting it?
> Granted, it's clearly not ideal! :)

I chuckled when I read your message.  Not because there
was anything at all wrong with the suggestion but because that
was the first thing I tried years ago when I stumbled across the
problem.  Since the boot drive  was disconnected, the computer
just gave me that nasty little double high-pitched beep which
says the game is over before it even started.

It seems that there has to be a drive in place that would
boot if only it could.

Again many thanks.

Martin



Re: Easiest way to do VGA to Text

2019-08-01 Thread Martin McCormick
David Christensen  writes:
> What about using a computer whose CMOS Setup utility is accessible via the
> serial port? This article indicates the Dell 2450 is capable:
> 
> 
> http://tldp.org/HOWTO/Remote-Serial-Console-HOWTO/rhl-biosserial.html
> 
> 
> David
> 
> 

Thanks for the information but None of the Dells I have
are that model.  They are all traditional eyeballs-only style.  I
even have a card that was manufactured many years ago that
replaces the VGA card in a number of PC models but not, of
course, the ones I have.

I had bought it to use at work and it did work fine in a
system there but the card will not physically fit the connector
on the one system that has a removable video output card and the
others all have VGA integrated in to the mother board.

You fight the war withthe weapons you have, not what you
wish you had.

The other possibility touches on a comment that another
poster to this thread mentioned.

I do own an iPad which has a commercial OCR program on it
that while driving one crazy with it's limitations, can sometimes
work quite well.

If you use the iPad's rear-facing camera and shoot a
photo of the monitor screen, it sometimes produces useful results
but it is normally kicking and screaming every step of the way.

The OCR program is really meant to photograph pieces of
paper under light that doesn't flicker.

The monitor screen is a classic CRT which flickers at the
frame rate of 60 FPS with no setting to increase exposure time
which might solve the problem.

I waited until night, clamped the iPad in to a tripod
fixture aimed at the CRT and observed that it continuously cycled
in and out of error mode due to the flicker.  A LCD-type monitor
might work much better as they have almost no flicker.

This is definitely one of those projects in which one
must not let perfect be the enemy of good enough.

Thanks for the good ideas.

Martin



Re: Easiest way to do VGA to Text

2019-08-02 Thread Martin McCormick
Felix Miata  writes:
> Are these old Dells continuously connected to power whether booted or not?

Yes.

> I have a bunch of old Dells. When left unconnected to power, some wear 
> down the
> 2032 coin cell CMOS batteries with unusual haste. Once this happens and 
> the
> battery is replaced, reconfiguring the BIOS is required, unless 100% use 
> of
> defaults proves acceptable, which because of the date and time at least, 
> for me is
> never.

I know what you mean.

Some time before I retired in 2015, we had a Dell server
at work that  must have had bad steering diodes somewhere on the
mother board because it could drain one of those 2032's in just a
few hours.  Nobody even knew there was a problem until it was
shut down for some length of time and then it would come up wrong.
Trying to remember what all happened is a bit difficult now but I
seem to remember that one could power it up and it would start
immediately for 10 or 15 seconds and then shut off at which time
one could press the Start button and it would run with all the
defaults.  Good servers just remember what power states they were
in when last shut down or maybe there is a BIOS setting that you
can set to determine this behavior but there is none of this
business of running for a few seconds and then going in to
shutdown.

The department that actually owned the server decided to
replace it with a new one and that's the end of that story as far
as I can relate.

The university would have put the defective server in
Surplus and state law required that it be sold at auction at
which point, some poor bloak would buy it and make the same
discovery we had made.:-)

Martin



  1   2   3   4   5   >