Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   ssh and dd (http://www.linux-archive.org/centos/403411-ssh-dd.html)

"Joseph L. Casale" 07-23-2010 10:27 PM

ssh and dd
 
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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Ross Walker 07-23-2010 11:29 PM

ssh and dd
 
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 07-24-2010 01:32 AM

ssh and dd
 
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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Les Mikesell 07-24-2010 01:34 AM

ssh and dd
 
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.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

"Joseph L. Casale" 07-24-2010 02:38 AM

ssh and dd
 
>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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Gordon Messmer 07-25-2010 04:50 PM

ssh and dd
 
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.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Ross Walker 07-25-2010 10:26 PM

ssh and dd
 
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

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Gordon Messmer 07-26-2010 07:54 PM

ssh and dd
 
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.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

John Doe 07-27-2010 09:15 AM

ssh and dd
 
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



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


All times are GMT. The time now is 03:29 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.