Hello I have an OS installation and data on a 40 gb drive that I would like to image to a 80 gb drive. I don't care if the resulting partition layout on the new drive is only 40 gb making me lose space. I just want to move everything from the older drive because I think it's failing. I have looked at partimage and mondo rescue as imaging solutions but both deal with partitions. CAn someone plz point me to a howto that shows how to image the entire drive incuding mbr, partiton table and data all with one program? I am hoping to boot with a CD to do this while having both drives plugged in. So I think something like knoppix? TIA!
On Oct 6, 2006, at 2:27 PM, Joseph Cheng wrote:
Hello I have an OS installation and data on a 40 gb drive that I would like to image to a 80 gb drive. I don't care if the resulting partition layout on the new drive is only 40 gb making me lose space. I just want to move everything from the older drive because I think it's failing. I have looked at partimage and mondo rescue as imaging solutions but both deal with partitions. CAn someone plz point me to a howto that shows how to image the entire drive incuding mbr, partiton table and data all with one program? I am hoping to boot with a CD to do this while having both drives plugged in. So I think something like knoppix? TIA!
1) install second drive 2) boot into knoppix 3) dd if=/dev/hda of=/dev/hdb obs=4096
this assumes /dev/hda is the 40gb drive and /dev/hdb is the 80gb; change device names as appropriate. the dd command will give you no output (unless a problem occurs) and will probably take a while.
-steve
-- If this were played upon a stage now, I could condemn it as an improbable fiction. - Fabian, Twelfth Night, III,v
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Joseph Cheng wrote:
Hello I have an OS installation and data on a 40 gb drive that I would like to image to a 80 gb drive. I don't care if the resulting partition layout on the new drive is only 40 gb making me lose space. I just want to move everything from the older drive because I think it's failing. I have looked at partimage and mondo rescue as imaging solutions but both deal with partitions. CAn someone plz point me to a howto that shows how to image the entire drive incuding mbr, partiton table and data all with one program? I am hoping to boot with a CD to do this while having both drives plugged in. So I think something like knoppix? TIA!
Either boot into knoppix and use dd if=/dev/hda1 of=/dev/hda2 plus whatever other arguments you want passed, or checking out Ghost 4 Linux (G4L). I'm not sure if G4L requires you to have to identical sized drives though.
http://sourceforge.net/projects/g4l
Max
The suggested knoppix dd solution should work well. You might want to pass something like "bs=4096k" as additional argument to speed it up considerably (bs is blocksize. Default is 512k)
However you might want to take a look at mondo rescue again. It does not make a physical 1:1 copy of the harddisk, but it will recreate all partitions, resized to occupy the entire space on the new drive and install an mbr with your bootloader (lilo or grub that is). It's easy to use too.
regards, Andreas Micklei
Thx for all the suggestions ppl. I think for simplicity I will either go with the knoppix & dd solution or I also found ghost 4 unix http://www.feyrer.de/g4u/
On Friday 06 October 2006 22:42, Joseph Cheng wrote:
Thx for all the suggestions ppl. I think for simplicity I will either go with the knoppix & dd solution or I also found ghost 4 unix http://www.feyrer.de/g4u/
I have used the dd solution a number of times, and it works quite well.
There are, however, a couple of suggestions I would make: 1.) Use the CentOS rescue mode (boot CD number 1, type 'linux rescue' at the boot prompt) and tell it not to mount your drives. No need to download Yet Another Linux Distribution to do the work. Or use the CentOS LiveCD. 2.) While the dd is running, you can check on its progress. Switch to another virtual console (you are by default on VC 1; hit ALT-F2 to go to VC 2) and send the dd process a SIGUSR1 (run a ps ax and make a note of the dd process's PID; then kill -USR1 $PID); then switch back to VC 1 and you'll see where dd is in your copy.
You can then run fdisk or parted and grow the partition; then you can resize the filesystem (I'm fairly certain the rescue mode includes the resizing program; not sure about the LiveCD, but I would think it does). The native CentOS tools to do this are, in my experience, far superior in quality to the various third party solutions (including Symantec Ghost) availabe to do this sort of thing. They are a little harder to use, though they seem to work better.
Lamar Owen wrote:
On Friday 06 October 2006 22:42, Joseph Cheng wrote:
Thx for all the suggestions ppl. I think for simplicity I will either go with the knoppix & dd solution or I also found ghost 4 unix http://www.feyrer.de/g4u/
I have used the dd solution a number of times, and it works quite well.
There are, however, a couple of suggestions I would make: 1.) Use the CentOS rescue mode (boot CD number 1, type 'linux rescue' at the boot prompt) and tell it not to mount your drives. No need to download Yet Another Linux Distribution to do the work. Or use the CentOS LiveCD. 2.) While the dd is running, you can check on its progress. Switch to another virtual console (you are by default on VC 1; hit ALT-F2 to go to VC 2) and send the dd process a SIGUSR1 (run a ps ax and make a note of the dd process's PID; then kill -USR1 $PID); then switch back to VC 1 and you'll see where dd is in your copy.
You can then run fdisk or parted and grow the partition; then you can resize the filesystem (I'm fairly certain the rescue mode includes the resizing program; not sure about the LiveCD, but I would think it does). The native CentOS tools to do this are, in my experience, far superior in quality to the various third party solutions (including Symantec Ghost) availabe to do this sort of thing. They are a little harder to use, though they seem to work better.
Interesting. I wonder if you used this method to copy the image from one disk to an identical disk hda-->hdb if you could then unplug hda and have the system boot from the "copy" without any other intervention. Kind of like a poor man's RAID1 except you only get back to where you were at the instant the snapshot was taken. I've never tried this since RAID cards are so cheap, but I guess I'm wondering out loud if that would work. Anyone tried it?
Cheers,
chrism@imntv.com spake the following on 10/7/2006 5:10 AM:
Lamar Owen wrote:
On Friday 06 October 2006 22:42, Joseph Cheng wrote:
Thx for all the suggestions ppl. I think for simplicity I will either go with the knoppix & dd solution or I also found ghost 4 unix http://www.feyrer.de/g4u/
I have used the dd solution a number of times, and it works quite well. There are, however, a couple of suggestions I would make: 1.) Use the CentOS rescue mode (boot CD number 1, type 'linux rescue' at the boot prompt) and tell it not to mount your drives. No need to download Yet Another Linux Distribution to do the work. Or use the CentOS LiveCD. 2.) While the dd is running, you can check on its progress. Switch to another virtual console (you are by default on VC 1; hit ALT-F2 to go to VC 2) and send the dd process a SIGUSR1 (run a ps ax and make a note of the dd process's PID; then kill -USR1 $PID); then switch back to VC 1 and you'll see where dd is in your copy.
You can then run fdisk or parted and grow the partition; then you can resize the filesystem (I'm fairly certain the rescue mode includes the resizing program; not sure about the LiveCD, but I would think it does). The native CentOS tools to do this are, in my experience, far superior in quality to the various third party solutions (including Symantec Ghost) availabe to do this sort of thing. They are a little harder to use, though they seem to work better.
Interesting. I wonder if you used this method to copy the image from one disk to an identical disk hda-->hdb if you could then unplug hda and have the system boot from the "copy" without any other intervention. Kind of like a poor man's RAID1 except you only get back to where you were at the instant the snapshot was taken. I've never tried this since RAID cards are so cheap, but I guess I'm wondering out loud if that would work. Anyone tried it?
Cheers,
If the system was able to boot from the second drive in any other circumstance, maybe. More likely to work with SCSI than IDE, because scsi is numbered by their detection, and IDE is numbered by its cable and port position. But with IDE, you could unplug the first drive and plug the second drive into the same position as the first (primary master ...). It should boot. As for raid cards being cheap, software raid works as fast or faster than most "cheap" raid cards. I mean the less than $200 US priced cards.
To migrate complete filesystems (even the softlinks and conserving the permissions asigned to users) I use this procedure:
1.- Connect the new disk to the machine I have the filesystem to clone 2.- Run with a LiveCD to avoid open files and to preserve the integrity of everything OK. 3.- Create /tmp/original and /tmp/destination directories as mountpoints 4.- Mount both filesystems in the created mountpoints (before that the new filesystem must be created in new disk, you know, format disk partition, create filesystem and mount) 5.- Change directory to /tmp/original 6.- tar cf - . | (cd /tmp/destination && tar xvfp -)
I have always used this procedure to clone it. The only problem making this process is that if the original filesystem was bootable filesystem you have to recreate the 0 sector with grub (The problem when you boot with a Live CD is that if you make "grub-install /dev/hda", /dev is mounted outside the filesystem, it does not correspond with your hda, so you have to make a trick I will describe below these lines). To do this, I boot the machine with an Ubuntu LiveCD (I have only got it working with this Live distro) to make the partition bootable. The steps I follow to do this are next:
1.-) Boot Ubuntu LiveCD 2.-) mount the filesystem to be bootable in /tmp/pp (previously created) 3.-) mount --bind /dev /tmp/pp/dev (this will remount /dev filesystem inside the filesystem we have just cloned) 4.-) chroot /tmp/pp (yeah now the filesystem is yours) 5.-) grub-install /dev/hda 6.-) umount everything and reboot...
everything will work like a charm. I have been trobules with the disks of my home server and this is what I've done.
Hope it helps everybody
Scott Silva wrote:
chrism@imntv.com spake the following on 10/7/2006 5:10 AM:
Lamar Owen wrote:
On Friday 06 October 2006 22:42, Joseph Cheng wrote:
Thx for all the suggestions ppl. I think for simplicity I will either go with the knoppix & dd solution or I also found ghost 4 unix http://www.feyrer.de/g4u/
I have used the dd solution a number of times, and it works quite well. There are, however, a couple of suggestions I would make: 1.) Use the CentOS rescue mode (boot CD number 1, type 'linux rescue' at the boot prompt) and tell it not to mount your drives. No need to download Yet Another Linux Distribution to do the work. Or use the CentOS LiveCD. 2.) While the dd is running, you can check on its progress. Switch to another virtual console (you are by default on VC 1; hit ALT-F2 to go to VC 2) and send the dd process a SIGUSR1 (run a ps ax and make a note of the dd process's PID; then kill -USR1 $PID); then switch back to VC 1 and you'll see where dd is in your copy.
You can then run fdisk or parted and grow the partition; then you can resize the filesystem (I'm fairly certain the rescue mode includes the resizing program; not sure about the LiveCD, but I would think it does). The native CentOS tools to do this are, in my experience, far superior in quality to the various third party solutions (including Symantec Ghost) availabe to do this sort of thing. They are a little harder to use, though they seem to work better.
Interesting. I wonder if you used this method to copy the image from one disk to an identical disk hda-->hdb if you could then unplug hda and have the system boot from the "copy" without any other intervention. Kind of like a poor man's RAID1 except you only get back to where you were at the instant the snapshot was taken. I've never tried this since RAID cards are so cheap, but I guess I'm wondering out loud if that would work. Anyone tried it?
Cheers,
If the system was able to boot from the second drive in any other circumstance, maybe. More likely to work with SCSI than IDE, because scsi is numbered by their detection, and IDE is numbered by its cable and port position. But with IDE, you could unplug the first drive and plug the second drive into the same position as the first (primary master ...). It should boot. As for raid cards being cheap, software raid works as fast or faster than most "cheap" raid cards. I mean the less than $200 US priced cards.
On 07/10/06, chrism@imntv.com chrism@imntv.com wrote:
Interesting. I wonder if you used this method to copy the image from one disk to an identical disk hda-->hdb if you could then unplug hda and have the system boot from the "copy" without any other intervention. Kind of like a poor man's RAID1 except you only get back to where you were at the instant the snapshot was taken. I've never tried this since RAID cards are so cheap, but I guess I'm wondering out loud if that would work. Anyone tried it?
Yep. I used do this all the time. If the disks have the same geometry it's dead simple. I used to use it to build and configure a server then duplicate it over another half-dozen or so identical systems.
You can also use the onboard RAID on most commercial vendor's rackmount boxes to do this but, for example with HP, you need to pay particular attention to the slots you're adding/removing disks from. And, if you're looking at building *lots* of systems you're probably better off with Kickstart and PXE in the long-run.
Will.
On Tuesday 10 October 2006 18:41, Will McDonald wrote:
Yep. I used do this all the time. If the disks have the same geometry it's dead simple. I used to use it to build and configure a server then duplicate it over another half-dozen or so identical systems.
Just one caveat: make sure to remove the MAC address portion of any ifcfg-ethX in /etc/sysconfig/network-scripts (the HWADDR parameter, I think, is the right one). Been there, done that, cloning systems like that. Did a cluster of 30 Sun Ultra 30 workstations with Aurora Linux 1.0 a few years back; had to make sure to remove the MAC address from the master prior to cloning.
On Saturday 07 October 2006 07:25, Lamar Owen wrote:
the boot prompt) and tell it not to mount your drives. No need to download Yet Another Linux Distribution to do the work. Or use the CentOS LiveCD.
After reading this closely, I realize it may give the impression that I'm recommending to NOT use the CentOS LiveCD; this is totally the wrong meaning; I'm RECOMMENDING using the CentOS LiveCD. Sorry for the miswording.