[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Plans for upgrading to woody & ditching HD



On Mon, May 13, 2002 at 09:48:49AM -0400, Andrew Perrin wrote:
> Greetings-
> 
> I have a machine currently running potato. It has four IDE drives in
> it. /dev/hda does nothing important; it's an old (probably 1993 or
> 1994) 1.2G whose sole role in life at this point is to have an MBR with
> LILO to boot DOS, NT, or (99% of the time) Debian.
> 
> That drive is quickly dying, and when it dies it brings down the IDE bus
> and therefore the system. So I need to get rid of it. I'd like to upgrade
> to woody at the same time.  

If I was doing that, I would prefer to keep the woody upgrade separate
from moving disks around. Take a break in between, so you can ensure
that everything is working OK (= food & drink) and do a backup. One
thing at a time.

By the way: If in any doubt whatsoever: keep off-line backups :-)

> Here's my plan; any comments or advice are welcome.
> 
> 1.) Back up /etc to somewhere safe
> 2.) Edit /etc/fstab:
>   change all references to /dev/hdb* to /dev/hda*
>   remove references to (unused) filesystems on what is now /dev/hda
>   change references to /dev/hdc* to /dev/hdb*
>   change references to /dev/hdd* to /dev/hdc*

As others have mentioned, you need not worry about hdc & hdd.

> (cdrom and zip drive are SCSI so not relevant to this process)
> 3.) Edit /etc/lilo.conf to point linux to /dev/hda instead of /dev/hdb
> 4.) Write /etc/lilo.conf to the MBR of the current /dev/hdb (about to
> become /dev/hda). THIS IS THE STEP I DON'T KNOW HOW TO DO.
> 5.) Power down
> 6.) Remove current /dev/hda
> 7.) Rejumper current /dev/hdb as master
> 8.) Power back up

What about this plan instead? It's longer and probably slower, but *I*
would feel more comfortable with it, as each step can be (relatively)
easily double-checked. But most importantly: It will be relatively easy
to go back as well:

[ Disclaimer: This stuff is Not Tested. Read, validate and make sense of
it (!) before applying it. Keep backups. ]

1)  Make sure that all data on /dev/hda is copied away from /dev/hda:
    - /boot should copied to /dev/hdb (if it is a separate partition)
    - / should be copied to /dev/hdb (rsync?)
    As you have guessed, the idea is to create duplicate file systems.

2)  /etc/fstab: Change all references of /dev/hda* to /dev/hdb*
    depending on where the partition has been copied to. Apart from / and
    /boot they *could* be copied to one of the SCSI disks.
    (Here we're talking about your existing root filesystem, not the
    copy...)

3)  Add a few lines to /etc/lilo.conf so you can boot from /dev/hdb *as
    well* as your current config.

    (Again, this is done to your *existing* root filesystem; so your
    copied of the root file system still says /dev/hda* in lilo.conf...)

4)  Make a boot floppy with your current kernel with lilo (e.g. via the
    mkrboot package). Anything that allows you to choose the root
    filesystem, before accessing the IDE drives will do.

    [ I don't know how to get lilo to write the boot sector to /dev/hdb;
    but I *do* know how to use a floppy. Besides, when messing with the
    boot block, it's nice to know that you can *always* get back in
    again curtesy of the floppy... ]

5)  Test out that you can boot from the floppy and select either root fs.
    You need to have the option of supplying "init=/bin/bash" to the
    kernel too.

6)  shut down. Remove /dev/hda, rejumber /dev/hdb as master. Assemble
    things back, and look for loose screws. (where *do* they come from
    anyway?)

    You *could* also re-jumber the dying IDE drive as slave and plug it
    back in.  Perhaps it won't hang the IDE bus when it is not being
    used? It might be handy to have access to it, just in case something
    isn't right. But it will also add to the confusion, since /dev/hda is
    now /dev/hdb and vice versa...

7)  Power on, and boot from the floppy, and select /dev/hda* as the root
    file system, and init=/bin/bash.
 
8)  Modify /etc/fstab: (here we will be on the *new* root file system)
    # mount -oremount,rw /
    # vi /etc/fstab
            change references to /dev/hdb* to /dev/hda*
    # # If /boot is a separate fs, make sure it is mounted
    # lilo
    # mount -oremount,ro /
    # # umount any other filesystems you mounted
    # sync ; sync; sync ; # Repeat ad infinitum :-)

9)  Hit the reset button (or cycle power) and watch your updated system
    come up. If everything is OK, it should look and feel idential to
    before (albeit with one less disk, depending on whether you plugged
    the dying IDE drive back in).

Once you're satisfied that everything is working OK, then you can embark
on the woody upgrade (after the obligatory backups! You can never have
enough!).


> 
> ---At this point I *hope* to have the old system (potato) up and running
> without the dead disk.---
> 
> 9.) edit /etc/apt/sources.list to point to testing instead of stable
> (should I use woody instead of testing?)
> 10.) apt-get update
> 11.) apt-get install apt apt-utils

I believe that dpkg is updated too (and apt-utils is optional after
all). And apt-listchanges is handy too:

11.) apt-get install apt apt-utils dpkg apt-listchanges

(This may pull in a new version of libc, so look for any system
instability after that; things core dumping etc).

> 12.) apt-get dist-upgrade

Again, being (very?) conservative, I'd prefer something like this:

12) apt-get --download-only --yes dist-upgrade
(I hope you have a relatively fast internet connection...)

13) apt-get --simulate --show-upgraded dist-upgrade

Review what will be done. Keep an eye out for packages that you consider
important (or important to your users). The truly paranoid may want to
take it one package at a time and use the command line above as a
"what's left-to-do-list". It will be long though...

> What, if anything, am I missing, or should I be worried about?
> 
> Thanks.

Backups. Backups. Backups. Think each step through before you take it,
and make sure that you can go back again. You'll walk slower that way,
but you're more likely to get there in one piece...

-- 
Karl E. Jørgensen
karl@jorgensen.com
www.karl.jorgensen.com
==== Today's fortune:
The only person who always got his work done by Friday was Robinson Crusoe.

Attachment: pgpqlbminWbxt.pgp
Description: PGP signature


Reply to: