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

Re: How to Move from 1 drive to another?



Jonathan Wheelhouse wrote:

John Summerfield <debian@ComputerDatasafe.com.au> writes:

Jonathan Wheelhouse wrote:

Hi

I am running Debian unstable on a 30GB drive (IBM Deskstar 75gxp)
using ext3.  I recently bought a 120GB drive (Western Digital WD1200).


Oh dear.

Sven has much the same idea I have.

Before I forget, install, configure and configure smartmontools.

Read the docs and check out the need for firmware for that drive. It's
not for nothing those drives are called Deathstar: I have bought two
of them, and two of them died.

I've had no problems with the IBM drive.

I didn't either, till I found they were dead.

The WD drive also has its problems.There are three settings:
Slave
Master, no slave
Master, slave present.

I've checked the jumper settings - I will probably use Cable Select.

You need a special cable for that. I've never seen one.


You don't say howyour old drive is partitioned. I am going to assume
it's  two paritions, hda1 and hda2, and that hda1 your is boot
partition near the edge. There are other configurations where this
will work, but all must be primary paritions.

$ mount
/dev/hda1 on / type ext3,ext2 (rw,errors=remount-ro)
/dev/hda2 on /boot type ext3 (rw)
/dev/hda6 on /var type ext3 (rw)
/dev/hda7 on /usr type ext3 (rw)
/dev/hda8 on /usr/local type ext3 (rw)
/dev/hda9 on /home type ext3 (rw)
/dev/hda10 on /tmp type ext3 (rw)

If you want a learning experience, do this.
First, boot single-user mode, check hda partitions are mounted ro.
Next, check the drives are tuned:
hdparm /dev/hda /dev/hdb
If you don't see DMA turned on, etc
hdparm -d1 -u1 -a64 -m16 /dev/hd{a,b}
Then, carefully getting this the right way round
dd if=/dev/hda of=/dev/hdb bs=$((1*1024*1024))

What you have now is a 30 Gb drive configuration on your 120 Gbyte drive.
Use fdisk to delete hda2, and then create a new, larger parition up to
the size of the disk.

So copy 30Gb to 120Gb drive; then delete hda2?  I don't see why to
leave hda1? - unless I'm going to boot from hda1.  Then partition rest
of the WD drive?


I'd not use dd on that layout. Unless I was interested to know whether it wil work, but I suspect you will trip on partitions six and up.


Instead of using mke2fs, use e2fsck and resize2fs (or whatever). It
will resize the partition.

btw Why reiserfs? From my reading it excels when you have lots of
small files, but not otherwise.

Well, I'm using ext3 currently; thought I would try ReiserFS for the
very reason you give.  What would you recommend?

By all means try it out; benchmark it  if you can.

Lots of people think it's wonderful, but I'm a bit more sceptical.

Read the info on all the journalling filsystems - there are also XFS (SGI) and JFS (IBM), see if you can find reviews and, even better, benchmarks.

I've _not_ studied it. I chose ext3 because of its compatibility with ext2. And bcause I'm not handling a lot of mail or any news. Think files 2-4 k or so. That is where I think reiserfs shines.

OTOH I don't think any of them is a bad choice.

This will be quicker than doing it with cp or (better) tar.

If you prefer to use tar, then partion the second drive and mount it
at, say, /mnt/new, then
tar clC / . boot | tar -xC /mnt/new

So, this copies "/", ".", " boot" to the new drive.  "." is the
current directory?  Which one specifically?

man tar

c == create
l == don't cross mount points
C  change directories before starting
/  the directory to change to
. boot  directories to archive. You'll nead to put your own list here.
x extract
p preserve ownership, permitions. I forgot that one.


This allows you to restructure your paritions any way you like and to change filesystems.


If you have buffer installed:
tar clC / . boot | buffer | tar -xC /mnt/new

Doesn't matter too much which drive you boot from: you can
a) Configure the BIOS to boot from the second drive (requires you
install and configure a bootloader)
b) Condinue booting /dev/hda and configure the bootloader to boot /dev/hdb
c) .... and configure the bootloader to boot the kernel etc from hdb.

OK.

So many options - I've just got to decide which one.
Read the docs first. Write it down.

If you're not sure, write down the entire sequence of commands and give another chance to conf^H^Hrrect you.




--

Cheers
John

-- spambait
1aaaaaaa@computerdatasafe.com.au  Z1aaaaaaa@computerdatasafe.com.au
Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/



Reply to: