/* * I realize you don't need this Joey but lots of people do, so I feel * it's necessary to write. I would appreciate it if someone would * mangle my email address for spam reasons and forward this to -user * where it will do more good. (I hope.) Most of this is common sense * stuff, but I find that many of the great new linux user books don't * tell you these things ... */ On Tue, Mar 16, 1999 at 12:46:27PM +0100, Martin Schulze wrote: > I've just upgraded from potaty-two-days-to to the current potato > and my bash got screwed: [..] All right, due to the number of people who have commented that upgrading potato screws things up, I have a couple of suggestions and I hope people READ THEM first of all and of course IMPLEMENT THEM! These suggestions may seem like they border on paranoia in places and you might laugh now but you'll either start smiling when something you laughed at before saves your arse or start crying when you realize that something you laughed at before WOULD HAVE saved it had you listened. First, there are some universal truths to keep in mind: 1. Somehow, somewhere, sometime, you WILL LOSE DATA. It happens. If not because of software bugs it will be because hardware with moving parts will eventually wear out. Deal with it. 2. Full backups are harder and harder to do these days. Even with the average tape drive on the market today saving about 4GB (compressed I believe), the average hard drive on the market is at more than twice that size and approaching three times that rapidly. Plus tapes are slow to begin with. Okay, so how do you make it easier to deal with problems when they come up then? I'm so glad you asked that question! Start with a high-grade floppy disk. Two if you can {find,spare} them. Get yourself a resc1440.bin or similar image and dd it to your good floppies. Now grab a ziploc bag, a freezer bag is better than a sandwich bag. Put the rescue disk in that, get the air out of the bag, and put it someplace where it won't get stepped on, sat on, dropped, etc. If your work area is like mine, this will be a challenge but I'm sure you can manage. No we're not done yet, any idiot could tell you to keep a backup rescue disk. Now let's see if we can make you not need the rescue disk, eh? I've been running Linux for almost 16 months now. In all that time, I have had about 5 instances when upgrading something from frozen or unstable has screwed things up a bit. 3 of those times what has gotten screwed up has been bash. Maybe it could have been anything really, but bash is what I've experienced most so let's prepare for that first shall we? Desired=Unknown/Install/Remove/Purge | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-===============-==============-============================================ ii ash 0.3.4-6 NetBSD /bin/sh ii sash 2.1-5 Stand-alone shell. Here we have two good sh compatible shells. I highly suggest making one of them /bin/sh. I use ash for mine, but even if you don't want to change /bin/sh I'm gonna tell you right now to install sash. While ash is a good /bin/sh when bash breaks, sash is a good shell when ANYTHING breaks. Now, sash.... I don't recommend sash be installed as your root login shell because if you're like me you're lazy and the fact that sash has no history or completion is going to get on your nerves fast. That and it's prompt is "> ", rather ugly. => But it has at least a limited form of just about every essential command built in as a -cmd. That's why you should most definitely install it. Instead of making it your login shell, make use of vipw to edit /etc/passwd... Here's the first two lines out of mine: root:x:0:0:root:/root:/bin/bash toor:x:0:0:root:/root:/bin/sash Chances are good your first line looks identical to mine if you have shadow passwds. Make the second line (and make sure it's the second, root must come first in the passwd file or things get confused a bit) Now if you have shadow passwds, go in and do the same with vipw -s ... root:<passwd>:10214:0:99999:7::: toor:<passwd>:10214:0:99999:7::: Of course this begs the question, what happens when you can't login as toor for some reason? Well at that point you're kinda screwed. You can try to fix the system best you can or reboot. If you couldn't login even as toor, rebooting alone isn't going to do much for you. You probably are going to have to feed the kernel an init=/bin/sash... It's best to hope you don't get in this position and fixing a system in this condition is waaaaay beyond the scope I'm discussing here. If sash won't cut it there's always the boot disks you made above. Yes I was serious about the freezer bags to keep dust and the like from damaging them disks. Floppies are very tempermental things really. I said above that it's difficult to back stuff up on tape. I meant it. However, you really SHOULD back up /etc, /bin, /sbin, and /lib. These will help you get a working base system at least. The only thing more than this which is truly important IMO is a list of installed packages (dpkg --get-selections > some/file) and /home if you can back that up now and then. From there, you can pretty much recover a system nicely even if you have to erase everything and start over for some reason. And, in case it hasn't been said enough yet, unstable is called that for a reason. => Occasionally it lives up to its name. The current issues with glibc2.1 actually trashing your system should not happen if your mirror is up to date and you're using apt. No promises otherwise though because I haven't tried it without a synched mirror and without apt. Frankly I would be afraid to in both cases! -- Joseph Carter <knghtbrd@debian.org> Debian GNU/Linux developer PGP: E8D68481E3A8BB77 8EE22996C9445FBE The Source Comes First! ------------------------------------------------------------------------- <Flav> Win 98 Psychic edition: We'll tell you where you're going tomorrow
Attachment:
pgpdABicfNUor.pgp
Description: PGP signature