[CLUE-Tech] Re: Moving an existing installation to a second hard drive -- solution

Dave Anselmi anselmi at americanisp.net
Sat Mar 23 20:55:32 MST 2002


BOF wrote:

> This follows up on how I finally handled the question I asked about
> moving an existing Slackware installation to a new drive. I don't claim
> my solution to be the most elegant, but it worked, so I thought that I
> would post this for other users.

Hey, cool!  Always nice to hear how things turn out.  What you did looks good to
me.  I've some suggestions below to make it a little more elegant, not to
critique what you did but as a learning opportunity for everyone.


> Note that this was done in single-user run level.

Good thinking.  I usually forget that :-)

[...]

>     mount -t ext2 /dev/hdb8 /newsys
>     cd /newsys

>     mkdir /tmp /var /usr /usr/local /boot /home

Hmm.  Seems you don't want the leading / on those dirs.  Also, if you say -p you
can leave out usr - usr/local will take care of it.


> 3. I then changed to the / directory on the first drive and issued
> commands to copy all the files and directories on it except /cdrom and
> /proc to the new drive, by using the command "cp -a."

[...]

Note that you need a /proc as a mount point.  You took care of that below, but
this seems easier (IIRC, this will make a /proc but not copy the contents):

> So I issued
>
>     cp -a /bin /boot /dev /etc /home /install /lib /lost+found /mnt /opt
> /root /sbin /usr /tmp /var

cp -ax / /tmp /var /usr/local /boot /home /newsys

By copying / you get all the files there, too.  By using -x you prevent the copy
from crossing filesystems.  This assumes your hda mount points are the same as
hdb, but if they aren't you just need to list all the mount points.  And don't
forget the target dir.  Note that cp -a copies dot files too.

[...]


> 5. Now I rebooted the system and choose the new installation. Lo, and
> behold! it booted. So I changed the /etc/lilo.conf file to make it the
> default boot selection, reran /sbin/lilo, and made a boot diskette.

Good job getting lilo set and editing the fstab on hdb before booting to it.  I
always forget that, too :-)  The only thing you haven't done is boot off hdb or
move hdb to hda.

To boot off hdb, all you have to do is change boot= in lilo.conf and it will
write the boot sector to hdb's mbr.  That assumes your bios can boot off hdb,
which it may not.

Moving hdb to hda (i.e., making it the master drive and booting off it) is a
little harder, and I'd have to look it up so I'll leave that as an exercise for
the reader.  The howto covers that pretty well though.

Dave





More information about the clue-tech mailing list