I do this quite frequently - except that in most cases I am replacing an old drive with a new larger driver, but want the existing partitions copied accross identically as if nothing has changed. To complicate matters, I often have more that one operating system installed on the disk.
The basic appreach is really the same thing you would do if your old drive failed completely and you were recovering from backups - only this way you can make sure your backups are completely up to date so that nothing is lost. The best method (IMHO) is as follows: Firstly, always make sure your backups are completely up to date before you start plugging and unplugging hard drives. Use 'fdisk -l' or similar to get the exact partitioning of the old drive, and print a copy. Next connect and partition the new drive with identically sized partitions to the original drive. Any extra space will be available for new partitions - these can be created now or later. Now load all of the partitions with the content of the corresponding original. If I am using dump to backup ext2/ext3 filesystems, I usually just use restore at this point. Alternatively, boot your old system single user (so all filesystems are read-only) and dd each old filsystem to the corresponding new filesystem. Finally, move the new drive to its final address and remove the original, boot using a floppy or CD, and use grub/lilo to update your boot blocks. Then, of course, you chould run a filesystem check on each of the filesystems just to make sure. This ensures that the information in the boot sector is correct for the new drive. Two 120G drives will typically not have *exactly* the same number of sectors, and usually will have a different geometry. So long as the new drive has the same or more, then you are ok and just need to make sure you copy the original partition sizes exactly. If you have slightly less, then at least one partition will be smaller and should be formatted and copied file by file (although you could avoid this by choosing to shrink the swap partition). The dd means I don't have to worry about what operating system is in the partition, and there is no possibility that oversights with rsync will have resulted in subtle changes that might go un-noticed for a long time - such as forgetting to preserve hard links (archive mode does not preserve everything..). When I need to change the size of one or more filesystems, then I use dump/restore (for ext2/3 filesystem) or rsync for Unix based systems. Regards, DigbyT On Fri, Nov 11, 2005 at 02:50:22PM -0800, maxim wexler wrote: > Hello everyone, > > Just received a new, unformatted SATA 120G HD with the > intention of moving my entire gentoo OS over to it > from a flaky 120G ATA drive(reiserfs). Hopefully, I > can just boot up from the new drive as if nothing had > changed. > > Can anybody recommend any tool(s) for the job? > Gotchas? Does SATA prefer a certain fs? > > -mw > > > > __________________________________ > Yahoo! FareChase: Search multiple travel sites in one click. > http://farechase.yahoo.com > -- > gentoo-user@gentoo.org mailing list -- Digby R. S. Tarvin [EMAIL PROTECTED] http://www.digbyt.com -- gentoo-user@gentoo.org mailing list