|
|
Friday, June 15, 2007
Sometimes, I just want to scream at “somebody”
There are people in this world I despise. I don’t know who they are, but they are out there. They are the people that make your life frustrated for no other reason than they “just didn’t think about it” or “oh, I meant to do that, but didn’t get around to it” or “hmm… that’s a good idea, and then ignore the idea” or some other such reason…
Today’s frustration… ethernet cards and upgrades.
I have a linux box. This box was on Fedora Core 4. This is old. However, the box works, so why mess with a good thing. Well, I decided I would remotely upgrade the box using yum. This is a scary thing in and of itself. So, I looked up directions and pieced together a plan from several different web sites… basically, all I need to do to go from FC4 to FC7 is to upgrade to 5, then upgrade to 6, then upgrade to 7.
check your version with uname
uname -a
clean up any left over cruff in yum
yum clean all
make sure you have the latest kernel for your current runlevel
yum install kernel
reboot
clean up any old kernels you have
yum remove kernel-2.
change your location for your packages to the 5 release
rpm -Uhv http://download.fedora.redhat.com/pub/fedora/linux/core/5/i386/os/Fedora/RPMS/fedora-release-5-5.noarch.rpm
update yum
yum update yum
update everything else
yum update
fix any selinux crap (you don’t understand it anyway)
/sbin/fixfiles relabel
remove selinux (not necessary, but makes my life easier!)
check modprobe.conf to make sure you have the right ethernet drivers for your new kernel
reboot
check, you should be on fc5 now
uname -a
change package location for the 6 release
rpm -Uhv http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os/Fedora/RPMS/fedora-release-6-4.noarch.rpm
clean your left over cruff in yum
yum clean all
update yum
yum update yum
update everything else (hmm.. wonder why I didn’t do the -y before… shrug)
yum -y update
When I did that, i got 3 warnings
warning: /etc/passwd created as /etc/passwd.rpmnew
warning: /etc/pam.d/system-auth created as /etc/pam.d/system-auth.rpmnew
warning: /etc/ldap.conf created as /etc/ldap.conf.rpmnew
Well, passwd is important, but the other two are not in our environment…
So, for the other two I just copied the new version over the old version.
I figured they added or changed some of the system users which is why there was a new passwd file.
So, I appended my passwd file to the new one, and then removed any of the duplicates (ensuring that username, uid, and gid had not changed)
Now, here was my first mistake. What I did was
cat passwd >> passwd.rpmnew
vi passwd.rpmnew
mv passwd.rpmnew passwd
When I was vi’ing the passwd.rpmnew file, I kept the stuff at the top, and removed duplicates down below. This meant that I kept the new versions of accounts like root, bin, daemon, adm, etc.
Now, I don’t know why they did it, but I didn’t notice it. Well, I noticed it after I couldn’t log in as root. What I didn’t notice was that the new password file had a * in the second field instead of an x. Golly, this shouldn’t be a big deal, right?
WRONG.
A * means not-log-in-able, an x means look in the shadow file for the password. (simple version of what it means.)
So, you cannot log in as root anymore.
Oh, and there was another problem. eth0 now no longer worked. eth1 did, but not eth0, but I’ll get to that screammer in a minute.
Okay, so now I can’t fix eth0 and I can’t log in as root…
sigh…
down to the colo I go…
Now, here is the trick to getting back root…
1) Don’t take any CD’s with you - they just get in the way.
2) reboot the box.
3) hit the space bar when grub is loaded and append a line to the kernel start
4) okay, I’ll tell you… that line is “init=/bin/bash”
5) this boots you to a bash prompt. The next thing you need to do is remount / rw instead of ro.
mount -o remount,rw /
Yes, there is a way of telling init to do both, but I didn’t have that syntax on the tip of my fingers… so I did it as two steps… ( I *think* I could have done init=/bin/bash rw and it would have done the remounts for me, but I did not test that particular theory and went with what I knew worked.
6) edit /etc/passwd and save
7) if you are being a good admin, you would then set / to be readonly (mount -o remount,ro /), but i’m not a good admin apparently, because I pushed the big button on the front of the box and cycled it.
Root is back.
Of course, I could have also cleared out root’s password in /etc/shadow if I couldn’t remember the password, but that wasn’t necessary in this case.
Okay, so I got root back, but what about this pesky eth0?
Well, lets make a long story short…
it was e100
that didn’t work (although it had in fc4 and fc5).
I tried a couple other kernel objects… they didn’t work..
I searched the internet…
Finally I found the following:
I have found that in some cases under FC5 and FC6 the e100 in my laptop
winds up with an odd device name, under FC5 it was dev(nnnnn) and under
FC6 it gets a name with tmp in the name.The fix is to cycle the module with
rmmod e100 ; modprobe e100
at http://www.linux.ie/lists/pipermail/ilug/2006-October/090599.html
That’s just stupid… i’ve booted this box several times. I’ve changed the modules several times… this can’t possibly work…
rmmod e100
modprobe e100
service network start
Network works…
oh, vey!