I have recently come across the need to swap out a hard drive in my Mythbox running MythBuntu.
I have a 320GB IDE drive that I'd like to replace with a 1TB SATA hard drive and yet retain all information and mount points on the IDE drive. I'd like to make the swap without the systems knowing anymore then it now has more space then it used to.
I believe this can be done with a decent disc image creation tool, but my version of Norton Ghost is too old.
I've run some quick searches and it looks like PING or R-DRIVE image would do about the same thing for me.
I'm curious if anyone has experience with these tools, or others, and if anyone has advice for making this swap as seamless as possible?
Thanks
Dan S. Hales
I always use tar, it also preserves most devices.
cd current/dir
tar -p --selinux -cf - | tar -C /new/dir -xpvf -
I'll leave it as an exercise to see what all the flags do--but this,
imho, is the safest way to copy files :)
-Brandon
As already mentioned in this thread, if you use a disk imaging utility
of different drives, bad stuff can potentially happen. At least
theoretically. However, I personally have run disk imaging utilities to
copy one drive to many simultaneously to different computers using
multicast, and I have not had any problems.
On the flip, if you deploy a disk imaging solution to clone your drive,
then it will copy every last bit-for-bit, including the MBR containing
the partition table. That means that your 1TB drive will only be
partitioned for 320GB. And, if that 320GB drive has 4 primary
partitions, you have some work ahead of you getting the fourth
partition, presumably an extended partition, to get to the end of the
disk. Not hard, just work.
I would avoid any disk cloning utilities, like CloneZilla, Norton Ghost
and the like, and do what has already been suggested thus far.
* Boot off a live media, like Knoppix.
* Identify and mount up the old drive.
* identify, partition, format and mount up the new disk.
* Copy over the data partition for partition
* Install an MBR (GRUB, LILO, etc) to the new drive.
* Test
--
. O . O . O . . O O . . . O .
. . O . O O O . O . O O . . O
O O O . O . . O O O O . O O O
Sounds like I'd have wasted many hours in unnecessary imaging efforts...
Tell me if my actual setup will change any of the steps... I'm not changing the primary hard drive but a secondary storage unit mounted at /usr
Here is my setup:
frodo@frodo-desktop:~$ cat /proc/partitions
major minor #blocks name
8 0 156290904 sda
8 1 979933 sda1
8 2 58597087 sda2
8 3 2931862 sda3
8 4 93779437 sda4
8 16 312571224 sdb
8 17 312568641 sdb1
frodo@frodo-desktop:~$ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 57677528 6884728 47862948 13% /
tmpfs 1547996 0 1547996 0% /lib/init/rw
varrun 1547996 336 1547660 1% /var/run
varlock 1547996 0 1547996 0% /var/lock
udev 1547996 160 1547836 1% /dev
tmpfs 1547996 0 1547996 0% /dev/shm
lrm 1547996 2192 1545804 1% /lib/modules/2.6.28-15-generic/volatile
/dev/sda1 964500 81512 833992 9% /boot
/dev/sda4 92306948 2383968 85234012 3% /home
/dev/sdb1 312437568 229054952 83382616 74% /usr
I intend to swap the sdb1 drive for another. sdb1 is currently an IDE drive (so the "s" in sdb1 is a surprise to me... but hey) and I will be installing a SATA drive in its place to be mounted at /usr point.
Thanks again!
Dan S. Hales
However, if you're planning on removing the existing IDE from the
system when you're done, you need to watch out: theres a possibility
that Linux will remap the drives so that they have different letters.
For example, say you plug in your new drive, and it gets added as sdc.
You copy everything over, and then adjust your partition table so that
sdc is being mounted as /usr rather than sdb. You then power down the
system, and unplug the drive that was sdb - but, now that sdb is
missing, Linux might remap what WAS sdc to sdb, messing up your new
partiton table.
Other than that, it should work pretty well.
Mike Heath
--=20
=2E O . O . O . . O O . . . O .
=2E . O . O O O . O . O O . . O
--
the blendmaster
This is pre-2.6.20, when the pata driver was still used. Since then, all
IDE devices and SCSI devices are using the sata driver, which identify
the devices as /dev/sd*, and are assigned in the order on which they are
discovered on the board, not the slot number.
--
. O . O . O . . O O . . . O .
. . O . O O O . O . O O . . O
--
the blendmaster