
我喜歡這樣做:
$ sshfs mountPoint myServer
$ cp thisFile mountPoint
我現在使用 LiveCD,但沒有可用的 sshfs 實用程序,我需要 run $ sudo dd /dev/sdb2 > mountPoint
,如何像使用 sshfs 一樣簡單地做到這一點?
或許相關
對普蘇西的評論
$ 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