new: sata-to-nvme

This commit is contained in:
2025-11-13 20:36:46 +09:00
commit 7449a15389
3 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
SOURCE_DISK=/dev/nvme0n1p2
OUTPUT_IMAGE_PATH=/x/sata1/snapshots/nvme-old-1tb.zst
TRANSFER_SIZE=436G
sudo partclone.ntfs -c -s $SOURCE_DISK -o - \
| pv -s $TRANSFER_SIZE -pterb \
| zstd -T0 -19 -o $OUTPUT_IMAGE_PATH

View File

@@ -0,0 +1,6 @@
# SATA to NVME session
## Goal
- Move all data in NTFS partition `/dev/nvme0n1p2` to `/x/sata1/snapshots`.
- Use partclone and zstd for the best efficiency.

View File

@@ -0,0 +1,21 @@
## Script Review: 0001-transfer.sh
**Purpose:** Creates a compressed backup image of an NTFS partition using partclone and zstd compression.
**Key Components:**
- **Source:** `/dev/nvme0n1p2` (NTFS partition)
- **Output:** `/x/sata1/snapshots/nvme-old-1tb.zst` (compressed image)
- **Transfer Size:** 436G (used for progress monitoring)
**Pipeline:**
1. `partclone.ntfs -c -s $SOURCE_DISK -o -` - Clones NTFS partition to stdout
2. `pv -s $TRANSFER_SIZE -pterb` - Monitors progress with visual feedback (progress, time, rate, bytes)
3. `zstd -T0 -19 -o $OUTPUT_IMAGE_PATH` - Compresses with max compression (level 19) using all CPU threads
**Notes:**
- Requires `sudo` privileges
- Uses maximum compression (`-19`) for best space efficiency
- Multi-threaded compression (`-T0`) for faster processing
- Progress bar provides real-time feedback during the long-running operation
Let's go.