LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Ghosting Linux to new HD? (https://www.linuxquestions.org/questions/linux-software-2/ghosting-linux-to-new-hd-8395/)

zhenwu 11-07-2001 10:26 AM

Ghosting Linux to new HD?
 
Hello all,

I'm about to buy a new HD, cuz my poor 3 gigger is plum out of room. What I'd like to know is, is there a way 'ghost' the contents of the old drive to the new drive so that I don't have to re-install from scratch? Also, if this is possible, what is the best way to 'prepare' the new drive for ghosting? (hmmm...maybe this should be in the 'newbie' section hehehe)

Or maybe if I do re-install can I move the directories over that contain (at least!) my X settings? I've worked very hard to set this system up to my liking and don't relish having to start from the beginning again.

Thanks in advance.

finegan 11-07-2001 12:43 PM

dd
 
I haven't done this. I've only read about it, but I'm certain it will work, although I might have a detail wrong:

Say your old 3 Gig is /dev/hda

and say your new drive is /dev/hdb

Partition /dev/hdb for linux native using diskdruid, cfdisk, fdisk... whichever. Also, give it some swap space on say, /dev/hdb4. Also, if /dev/hda has multiple partitions, you might want to re-create those partitions (don't worry about matching the sizes, there's no need as long as the one on /dev/hdb is big enough).

Then: dd if=/dev/hda1 of=/dev/hdb1

This is going to copy all of the data straight from the devices, byte for byte front to back. This may take a while. Heck, /dev/hdb1 doesn't even have to be mounted. You'll have to do this more than once if you have more than one linux native partition on /dev/hda.

Then swap the devices, make sure the jumpers are right, and reboot the machine.

Now, here's what I'm not sure about... I don't know if this is going to copy the MBR too, and therefore: LILO. My guess is that it won't since the MBR lies on the very front of the drive, which is technically just before /dev/hda1. So, keep a boot disk handy. Then once you're in you just have to re-run lilo.

If anyone notices anything I've gotten wrong, please comment.

Also, to be re-assuring, if this doesn't work it's just a matter of re-partition, reformat, re-try.

Good luck,


Finegan

unSpawn 11-07-2001 02:03 PM

I tend to do this a lot :-]
Get partimage. Load the partimage 2 floppy system (boot/root) if you haven't got a way to make partimage load from another distro or disk. Make backup images of partitions (can be bzipped, split so it fit's on cdr's, etc etc) to a storage partition. Fdisk new disk so the partitions are the same in size, or larger. Smaller won't work. Boot, load partimage and "restore" the partitions. Boot the restored OS by means of rescue floppy/cdr/whatever, install lilo again, and off you go.

*I know, you could do the same with either cp or dd, but partimage makes an image of the used bytes on a disk, while cp only copies contents, and dd simply is lethal in the wrong hands. Next to that Saving 1GB takes me about 30mins, and ends up as an image less than 650MB (bzipped), restoring takes about 10mins...

zhenwu 11-08-2001 10:36 AM

So, just so I understand the process correctly:

1. buy new HD
2. format new HD, and create a partition to store the backup images
3. create images of old HD using partimage and put them in aforementioned partition.
4. unpack image into the main partition of new HD
5. give old HD to wife as a doorstop.

is that correct?

Thanks again.


All times are GMT -5. The time now is 03:38 PM.