sshfs를 ssh로 교체

sshfs를 ssh로 교체

나는 이것을 좋아합니다:

$ sshfs mountPoint myServer
$ cp thisFile mountPoint

현재 LiveCD를 사용하고 있는데 sshfs 유틸리티를 사용할 수 없고 run 이 필요합니다. $ sudo dd /dev/sdb2 > mountPointsshfs처럼 쉽게 이 작업을 수행하는 방법은 무엇입니까?

아마도 관련이 있을 것입니다

  1. https://superuser.com/questions/397646/cloning-fresh-windows-7-fsed-hdd-to-linux-server-because-having-no-external-hdd

Psusi에 대한 의견

$ sudo fdisk -l|tail
255 heads, 63 sectors/track, 4864 cylinders, total 78142806 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x181d6d22

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048     3074047    12288000    7  HPFS/NTFS/exFAT
/dev/sdb2         3074048   600563711  2389958656    7  HPFS/NTFS/exFAT
/dev/sdb3       600563712   625139711    98304000    7  HPFS/NTFS/exFAT
$ sudo file -s /dev/sdb
/dev/sdb: x86 boot sector; partition 1: ID=0x7, active, starthead 32, startsector 2048, 3072000 sectors; partition 2: ID=0x7, starthead 89, startsector 3074048, 597489664 sectors; partition 3: ID=0x7, starthead 254, startsector 600563712, 24576000 sectors, code offset 0xe
$ sudo ntfsclone --save-image --output - /dev/sdb2
ntfsclone v2011.4.12AR.4 (libntfs-3g)
ERROR(22): Opening '/dev/sdb2' as NTFS failed: Invalid argument
Apparently device '/dev/sdb2' doesn't have a valid NTFS. Maybe you selected
the whole disk instead of a partition (e.g. /dev/hda, not /dev/hda1)?

답변1

귀하의 질문에 직접 답변하려면

dd if=/dev/sdb2 ibs=1M | ssh -C myServer 'dd of=/path/to/destination obs=1M'

보너스의 경우 다음을 수행하여 진행 상황을 확인할 수 있습니다(유틸리티가 있다고 가정 pv).

pv /dev/sdb2 | ssh -C myServer 'dd of=/path/to/destination obs=1M'

답변2

SSH 터널링 파이프를 사용할 수 있습니다.

dd if=/dev/sdb2 ibs=1M obs=64k | ssh -C user@remotehost "cat > /path/to/destination"

-C옵션은 SSH 프로토콜에서 압축을 활성화하여 일반적으로 이와 같은 경우 성능을 향상시킵니다.

설치한 경우 pv파이프에 포함하여 이미 전송된 양에 대한 자세한 정보를 얻을 수 있습니다.

dd if=/dev/sdb2 ibs=1M obs=64k | pv | ssh -C user@remotehost "cat > /path/to/destination"

답변3

scp모든 Linux 배포판과 함께 제공되는 것을 사용하는 것이 좋습니다 . 이를 보안 사본이라고 합니다.

$ scp -r folder-to-copy location-of-copy

관련 정보