Storage
约 2 分钟阅读
Tips
- restic/resticGitHubrestic/resticrestic/restic · BSD-2, Go · fast, secure, efficient backup · Linux, macOS, Windows笔记:restic
- restic
- Fast, secure, efficient backup program
- Rclone
- ncw/rcloneGitHubncw/rclone
- Rclone is a command line program to sync files and directories to and from
- Mountain Duck
- mount server and cloud storage as a local disk
- comparison
- Cyberduck
- iterate-ch/cyberduckGitHubiterate-ch/cyberduck
- Cyberduck is a libre FTP, SFTP, WebDAV, Amazon S3, OpenStack Swift, Backblaze B2, Microsoft Azure & OneDrive, Google Drive and Dropbox browser for Mac and Windows.
- Cryptomator
- cryptomator/cryptomatorGitHubcryptomator/cryptomator
- Free client-side encryption for your cloud files. Open source software: No backdoors, no registration.
- Transparent encryption
- Files get encrypted individually
- cryptomator/cryptofsGitHubcryptomator/cryptofs
- Java Filesystem Provider with integrated encryption
- Java
- lookfirst/sardineGitHublookfirst/sardine
- an easy to use webdav client for java
- dCache/nfs4jGitHubdCache/nfs4j
- Pure Java NFSv3 and NFSv4.1 implementation
- ssh, scp and sftp for javaGitHubhierynomus/sshj
- lookfirst/sardineGitHublookfirst/sardine
- Golang
- spf13/aferoGitHubspf13/afero
- S3
- s3fs-fuse/s3fs-fuseGitHubs3fs-fuse/s3fs-fuseusecache 会缓存整个文件而不是访问到的部分 · 和 自己维持缓存没区别 · s3fs 限制 - 有些限制来自 s3, 有些限制来自 fuse · 不能 append · stat 性能差 · 由于大多存储是最终一致,可能会导致 stale read - 部分 provider 支持 read-after-write consistency笔记:s3fs
- 限制
- 随机写或 append 会重写整个文件
- list 整个目录的性能较差, 取决于网络延迟
- 最终一致性可能会导致读取过期数据
- 重命名不是原子性的
- 多个端挂载不会进行协调
- 不支持硬连接
- 限制
- kahing/goofysGitHubkahing/goofys
- Goofys is a high-performance, POSIX-ish Amazon S3 file system written in Go
- s3fs-fuse/s3fs-fuseGitHubs3fs-fuse/s3fs-fuseusecache 会缓存整个文件而不是访问到的部分 · 和 自己维持缓存没区别 · s3fs 限制 - 有些限制来自 s3, 有些限制来自 fuse · 不能 append · stat 性能差 · 由于大多存储是最终一致,可能会导致 stale read - 部分 provider 支持 read-after-write consistency笔记:s3fs
- B2 Cloud Storage
- Pricing
- 非常便宜的云存储
- 存储 0.005$/GB/Month
- 下载 0.02$/GB
- FS
- kahing/catfsGitHubkahing/catfs
- Catfs is a caching filesystem written in Rust
- kahing/catfsGitHubkahing/catfs
- Optimize Storage Efficiency
- 不能使用的文件名
- Windows
\/:*?"<>| - Linux, macOS
null或/
- Windows
brew install s3fs
brew install goofys
export AWS_ACCESS_KEY_ID=${ID}
export AWS_SECRET_ACCESS_KEY=${KEY}
# goofys <bucket> <mountpoint>
# goofys <bucket:prefix> <mountpoint>find dir/ -name "offender1" -mtime -1 -print0 | du --files0-from=- -hc | tail -n1Transfer
# 两个服务器之间传输大量小文件时非常快
# 觉得 gzip 慢可以使用 pigz
tar c some/dir/ | gzip - | ssh host2 tar xz -C /other/dir/
# 全量同步后再进行增量同步
rsync -azv some/dir/ user@host:/other/dir/
Disk
- Disk cloningWikipediaDisk cloning
#
lsblk --output NAME,SIZE,VENDOR,FSTYPE,LABEL,UUID,MODE
# 克隆单个磁盘
dd if=/dev/sda1 of=/dev/sdb1 bs=64K conv=noerror,sync status=progress
# 克隆整个磁盘
dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync status=progress
# 备份
# 备份整个系统
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/folder
# 使用 --info=progress2 显示总体的进度, 而不是每个文件
rsync -aAX --info=progress2 --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/folder
# 备份启动分区
# https://wiki.archlinux.org/index.php/disk_cloning
dd if=/dev/sda1 of=/mnt/dst/bios-boot bs=64K conv=noerror,sync status=progress
# 备份分区
sfdisk -d /dev/sda > part_table
# 恢复分区
sfdisk /dev/sda < part_table
# wipefs 也可以关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub12 条
- cryptomator/cryptofsgithub.com/cryptomator/cryptofs
- cryptomator/cryptomatorgithub.com/cryptomator/cryptomator
- dCache/nfs4jgithub.com/dCache/nfs4j
- hierynomus/sshjgithub.com/hierynomus/sshj
- iterate-ch/cyberduckgithub.com/iterate-ch/cyberduck
- kahing/catfsgithub.com/kahing/catfs
- kahing/goofysgithub.com/kahing/goofys
- lookfirst/sardinegithub.com/lookfirst/sardine
- ncw/rclonegithub.com/ncw/rclone
- restic/resticgithub.com/restic/restic
- s3fs-fuse/s3fs-fusegithub.com/s3fs-fuse/s3fs-fuse
- spf13/aferogithub.com/spf13/afero
Wikipedia1 条
- Disk cloningWikipedia:Disk cloning
其他外链8 条
- cryptomator.orgcryptomator.org/
- cyberduck.iocyberduck.io/
- mountainduck.iomountainduck.io/
- mountainduck.io/comparisonmountainduck.io/comparison
- rclone.orgrclone.org/
- restic.github.iorestic.github.io/
- www.backblaze.com/b2/cloud-storage-pricing.htmlwww.backblaze.com/b2/cloud-storage-pricing.html
- www.snia.org/sites/default/files/SDC/2016/presentations/erasure_coding/DrorGoldenberg_Optimize_Storage_Efficiency-v2.pdfwww.snia.org/sites/default/files/SDC/2016/presentations/erasure_coding/DrorGoldenberg_Optimize_Storage_Efficiency-v2.pdf