Ron Stodden <[EMAIL PROTECTED]> wrote:
> Ron Stodden wrote:
> >
> > Tom Eastman wrote:
> > >
> > > I need to re-arrange my hard drives in my computer.
> > >
> > > Essentially my Linux hard drive hdd will become hda.
> > >
> > > How can I do this without losing my system? How many places in linux will I
>have to tell
> that the hard drive is now in a different place?
> >
> > Only /etc/fstab. This contains all the mapping of the real
> > partitions to /, swap, mount points.
> >
> > But the problem is that /etc/fstab must be altered to the new
> > configuration before you do the first boot as hda - one way this can
> > be achieved is by pre-altering /etc/fstab while still booted as hdd
> > (the system will not mind unless you are running kdf which will show
> > both a hybrid of the old and new arrangements and can be ignored),
> > but you had better save a backup of /etc/fstab and get the new
> > partition mappings exactly completely correct!
>
> The others are correct - lilo must also be reconfigured to boot from
> the hdd Linux partition.
>
> It's probably best to edit the hdd boot partition's lilo.conf change
> the global boot partition and add new stanzas with unique names to
> boot from hda, then run /sbin/lilo (if it will accept them). Then
> when running as hda, lilo should present all the booting options for
> hdd and hda to you. Having transited over, you can remove the hdd
> stanzas and create a new boot floppy disk.
Sorry, this won't work. Lilo does some sanity checking during bootup,
and if hdd is not there, it won't boot (is there a way around this???).
Also, when you run lilo, the partitions must be there (i.e. exist where
you said they were supposed to be).
Actually, I'd suggest the following:
1. Make a boot (rescue) disk that will allow you to pass parameters to it! -
see step 8 below!)
2. boot from it to be sure it works. (you can boot back to hard disk after
this test if you want, does not matter)
3. edit your /etc/fstab and change all /dev/hdd<whatever> to /dev/hda<whatever>
(for the sed-minded: "sed 's%/dev/hdd%/dev/hda%' /etc/fstab > /etc/fstab.new"
might actually do the trick ;-)
4. edit your /etc/lilo.conf and change 'hdd' to 'hda'
5. DO NOT RUN LILO YET!
6. halt.
7. move your hard drive to hda
8. boot, using the floppy, but say 'linux root=/dev/hda1' (or wherever your root
partition
on the 'new' hda is) instead of 'linux' (or whatever you called the image in
step 1)
9. log in as root (or get to being root by logging in as user and THEN su-ing to root)
10. run lilo.
11. remove the floppy and reboot.
12. you should be done.
WARNING - if anything goes wrong, you'll need to change your /etc/fstab BACK to
point to /dev/hdd BEFORE you can get much use from your system! Many of us do this
by acting like we are going to install (or upgrade) the system - i.e. boot from an
install disk, get to the '2nd stage install', then we go to the command prompt
(alt/F2, usually) (sometimes you have to fiddle a bit to get your partition mounted)
and edit what would be /etc/fstab (i.e. it may be /mnt/foo/etc/fstab NOW, but when
you boot from the hard drive it will be /etc/fstab - clear as mud? ;-)))
For the truly paranoid, buy a second drive, set it up as hda, copy everything over
to the new drive from hdd (see previous threads on how to do this), change /etc/fstab
on the NEW drive as in step 3 above, edit /etc/lilo (on the CURRENT drive) to point
everything to hda, run lilo, reboot, make sure everything is using hda, halt,
then remove hdd and use it on another machine... (shoot, you could then just copy
the /etc/fstab and /etc/lilo.conf from your NEW hda to this old disk, and all you'd
need is a boot floppy (use the one you just made for your new hda disk) to be
able to boot it (as hda) the first time, at which point you run lilo and you're done.
There, confusing enough? See, unix (and of course thus linux) gives you MORE than
enough rope! ;-)
rusty
Rusty Carruth Email: [EMAIL PROTECTED] or [EMAIL PROTECTED]
Voice: (480) 345-3621 SnailMail: Schlumberger ATE
FAX: (480) 345-8793 7855 S. River Parkway, Suite 116
Ham: N7IKQ @ 146.82+,pl 162.2 Tempe, AZ 85284-1825