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

Re: Upgrade Hard Drive



On Thu, 2008-01-10 at 13:22 +0000, Timothy Murphy wrote:
> Tom Spec wrote:
> 
> > I am planning to move from one HD to another I need a bit of feedback.  I
> > am partitioned as follows:
> > 
> > sda1 /boot (Linux Partition) 256M
> > sda2 LVM PV (Linux LVM Partition) 20G
> > 
> > I was planning to.....
> > 
> > 1) attach the new HD
> > 2) boot to a rescue CD
> > 3) partition the new HD exactly how the old one is
> > 4) dd if=/dev/sda1 of=/dev/sdb1
> > 5) dd if=/dev/sda2 of=/dev/sdb2
> > 6) make the new HD bootable
> > 7) disconnect the old HD
> > 8) boot
> > 
> > My questions...
> > 
> > - Is this basically the right procedure?
> 
> In my opinion dd is not the right tool for this.
> (I am amazed no-one else has said this.)
> 
> I would partition the new disk as you like,
> and copy the contents of the old partitions to the new
> with "cp -a".
> 
> > - Do I need to boot to the rescue CD or would single user (or emergency)
> > mode be good enough (in step 2)? - Exactly what steps are required to
> > "make the new HD bootable"? - Is there a way for me to make the old hd
> > "unbootable" so I can leave it in, but make sure it's the new one that
> > boots?
> 
> I don't really see any problem.
> Assuming you have both disks in the same machine,
> you should be able to add a new entry in grub.conf
> allowing you to boot from the new disk.
> Then you could install grub on the second disk.
> 
> [I would actually have two grub entries for each disk,
> one with root (hd0,...) and one with root (hd1,...).
> Then you could physically change the disks,
> and remove the old one if all works OK.]
> 
> 
> -- 
> Timothy Murphy  
> e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
> tel: +353-86-2336090, +353-1-2842366
> s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
> 

Hi Tom

I tend to agree with this comment - a bit more detail though.

I have found an old script (printout only)
that I used to use to clone RH9.0 onto a USB disk !!

#mount the new disk, something like

mount /dev/sdb1 /mnt/zip

umask 0

#Copy "nearly" all the top level directories
#Avoid /proc, /dev, /tmp

cp -rdpx /bin /mnt/zip
cp -rdpx /etc /mnt/zip
...
...
#Not sure whether with hal, udev and friends this is #still necessary

(cd /dev;find . -print | cpio -pmd /mnt/zip/dev)

mkdir	/mnt/zip/proc
mkdir /mnt/zip/tmp
chmod 777 /mnt/zip/tmp

#Edit /mnt/zip/etc/fstab as required
#Edit /mnt/zip/boot/grub/grub.conf as required(This #assumes /boot and /
are in the same partition !!)


John









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