Tonight I have to boot a diskless server with iLO and dd a remote image available by ssh onto a usb key. As there is no local place to store the image, whats the most efficient cmd to push the image from the remote server using ssh into the local pipe pushing out to `dd of=/dev/sdx`?
Would a remote execution of `dd if=/dev/sdx` be the best over ssh? I suppose I could use nc and do away with ssh, is that in the CentOS rescue mode?
Thanks, jlc
On Jul 23, 2010, at 6:27 PM, "Joseph L. Casale" jcasale@activenetwerx.com wrote:
Tonight I have to boot a diskless server with iLO and dd a remote image available by ssh onto a usb key. As there is no local place to store the image, whats the most efficient cmd to push the image from the remote server using ssh into the local pipe pushing out to `dd of=/dev/sdx`?
Would a remote execution of `dd if=/dev/sdx` be the best over ssh? I suppose I could use nc and do away with ssh, is that in the CentOS rescue mode?
How about remote cpio?
-Ross
YOu can ssh to it and mount an iso from a web server as well.
On Fri, 23 Jul 2010, Ross Walker wrote:
On Jul 23, 2010, at 6:27 PM, "Joseph L. Casale" jcasale@activenetwerx.com wrote:
Tonight I have to boot a diskless server with iLO and dd a remote image available by ssh onto a usb key. As there is no local place to store the image, whats the most efficient cmd to push the image from the remote server using ssh into the local pipe pushing out to `dd of=/dev/sdx`?
Would a remote execution of `dd if=/dev/sdx` be the best over ssh? I suppose I could use nc and do away with ssh, is that in the CentOS rescue mode?
How about remote cpio?
-Ross
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
---------------------------------------------------------------------- Jim Wildman, CISSP, RHCE jim@rossberry.com http://www.rossberry.com "Society in every state is a blessing, but Government, even in its best state, is a necessary evil; in its worst state, an intolerable one." Thomas Paine
On Jul 25, 2010, at 12:50 PM, Gordon Messmer yinyang@eburg.com wrote:
On 07/23/2010 04:29 PM, Ross Walker wrote:
How about remote cpio?
cpio requires rsh/ssh to reach a remote system, and would be a poor choice for copying an image to a block device.
Better then dd over ssh, but clonezilla would be a better choice overall I think if it can read/write from a pipe, even better if it can resume from a broken pipe.
-Ross
On 07/25/2010 03:26 PM, Ross Walker wrote:
Better then dd over ssh,
Well, no... If you're trying to do an *image*, you'll find that cpio can't write an image out to a block device.
It's fairly easy to make dd as bandwidth efficient as clonezilla.
1: Clear all of the unused blocks on the local filesystem which you want to image: # dd if=/dev/zero of=/mnt/zero # rm /mnt/zero
2: Copy your filesystem to a file: # umount /mnt # dd if=/dev/sdb1 of=/var/tmp/fs.img
3: Compress your filesystem image: # bzip2 /var/tmp/fs.img
4: Copy the image to the remote system: # ssh root@remote 'bzip2 -dc | dd of=/dev/sda1' < /var/tmp/fs.img.bz2
Can't get much better than that for low-volume copies. If you need to repeat the process on a lot of machines, clonezilla gives you some nice options. If you're copying files instead of images, cpio might be useful.
From: Gordon Messmer yinyang@eburg.com
Well, no... If you're trying to do an *image*, you'll find that cpio can't write an image out to a block device. It's fairly easy to make dd as bandwidth efficient as clonezilla.
Maybe have a look at ddrescue, which handles errors a little bit better than plain dd...
JD
Joseph L. Casale wrote:
Tonight I have to boot a diskless server with iLO and dd a remote image available by ssh onto a usb key. As there is no local place to store the image, whats the most efficient cmd to push the image from the remote server using ssh into the local pipe pushing out to `dd of=/dev/sdx`?
Would a remote execution of `dd if=/dev/sdx` be the best over ssh? I suppose I could use nc and do away with ssh, is that in the CentOS rescue mode?
dd over ssh should be a sure thing. If you do a lot of image copies remote or otherwise you might want to try clonezilla-live. It knows enough about most file systems to only copy the used blocks and can access the image store with smb, nfs, or ssh.
dd over ssh should be a sure thing. If you do a lot of image copies remote or otherwise you might want to try clonezilla-live. It knows enough about most file systems to only copy the used blocks and can access the image store with smb, nfs, or ssh.
Yeah not lots, just an esxi update... I'll look into cpio now, its backing up as we speak.
Thanks guys! jlc