Re: What is the best way to upgrade a drive?



John wrote:
The drive I want to replace is hda2 which contains /home and /boot. In
retrospect I think it was not such a good idea to keep /boot and /home on
the same drive....

It is indeed easier to have them on seperate drives or just have gone
with the default, which is to have thre partitions. /, /home and swap.

My question is, how to replace hda as painlessly as possible without loosing
data or trashing the entire sytem? The machine running Suse 10.1 and I
don't plan on upgrading until after 10.3 is released.

1) Put back /boot where it belongs. This can be easily done.
- name a directory /boot_new
- copy the data from /boot to /boot_new
- umount /boot
- put a # in front of the line that says /boot in /etc/fstab

Now reboot and see if it works out. If not, you need to simply remount
/dev/hda1 as /boot and remove the #

The currently installed drives are all IDE but the machine is SATA capable.
I have not yet decided if the new drive will be EIDE or SATA. I'm not sure
if it's a good idea to mix the two so I am leaning towards EIDE at the
moment.

Here is my current setup:

john@uisce:~/doc> df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hdb1 38G 23G 15G 61% /
udev 1.3G 300K 1.3G 1% /dev
/dev/hda1 118M 40M 78M 34% /boot
/dev/hda2 75G 63G 13G 84% /home
/dev/hdd2 18G 16G 1.4G 93% /local
/dev/hdc2 15G 1.1G 14G 7% /srv
/dev/hdc3 7.3G 174M 7.1G 3% /tmp
/dev/hdc1 15G 1.5G 14G 10% /var

hdd1 is swap 20GB

That is some freaking setup that just is begging for problems and you do
not use the capacity to its fullest. From what I see, you could easily
place /srv /tmp and /var back on HDB1 with the same method as you use
with /boot

Now you have an empty hdc. Take out that drive and put in the new HDD.
No idea why you need so much swap, but if you do, you might want to
consider putting it on different HD's. I will be asuming that you are
buying a newer and bigger HD. I will say 320GB or 400GB are the best
priced per GB and I asume you are a smart person who buys with his brain
AND his wallet. ;-)
So put in the new HD.
Mount it as /home_new
Copy everything from /home to /home_new
Log in as root
/umount /home_new and /home
Mount /dev/hdc1 as /home (change /etc/fstab directly or use YaST)

Now you should be able to log back in a user. Reboot and see if all
works. If it does, halt the machine and take out hdb. Put into that
place the old hdc.

Some extra remarks: Do you realy need that much swap? If yes, add some
to the new hdb as well.
Look at the usage of your directories. It is not becauise you can put
every directory on a seperate partition that you should. Unless you have
very specific reasons to do so, the best way to go is KISS.

Especial /srv /tmp and /var are just space wasters with the amount of
discspace you use.

Here is what I would do:
1) / on /dev/hdb1
2) swap + /data-hda1 on /hda1
3) swap + /home on /hdd1
4) swap + /data-hdc1 on /hdc1

Now if you see that some directory (e.g. /local) needs more space then
it does have on /dev/hdb1, just copy the data to a subdirectory in e.g.
/data-hda1/local, first rename /local to /local_old and then symlink
/local to /data-hda1/local.

Another thing you can do is put swap on those three drives (on all four
would be even better) and then use LVM to make one big happy partition
of trhe rest of hda, hdc and hdd.

This all asumes that you stick with IDE.

If you start using SATA, it is even easier.
Drop in the new HD, copy the data to the HD, umount the old, mount the
new.

houghi
--
Remind me to write an article on the compulsive reading of news. The
theme will be that most neuroses can be traced to the unhealthy habit
of wallowing in the troubles of five billion strangers. -- Heinlein
.



Relevant Pages

  • RE: Having a hard time copying root file system to new drive... [SOLVED]
    ... From rescue mode you might mount the /boot partition ... booting and edit this on the fly instead of a rescue boot again. ... I KNOW that having a mislabeled swap mislabeled as seen by initrd does not ... for example) and these drives will be mounted RO in ...
    (Fedora)
  • Re: couple newbie questions (install & doc)
    ... a Linux power user, or at least quite familiar with it. ... Plan on swap size to be twice the ... real performance problems with swap spread over three hard drives. ... > suggestions as to how I should partition my disk2? ...
    (alt.os.linux.suse)
  • Re: Advice needed to speed up very slow machine (conclusion)
    ... There is unused partition on hdc which I can use for swap (currently ... Dillo starts up in about 15 seconds, ...
    (Debian-User)
  • Re: Please help new hard drive install
    ... > would also like to make a small partition for doing things like ... > faster by having the right partitions on the right drives! ... Personally, I like to keep my swap partitions at the start of the drive, ... If you have swap space on both hard drives, edit your fstab file so each ...
    (Ubuntu)
  • Re: I HATE WINDOWS!
    ... stable and easily backed up system, how would you partition a headless ... considering a system with two or three hard drives. ... Higher data rates are achieved at the beginning of the disk. ... Swap would probably be next if you have one drive. ...
    (alt.os.linux)