# NTFSのマウント
sudo mount -r -t ntfs-3g /dev/sdx2 /mnt # 読み取り専用
sudo mount -w -t ntfs-3g /dev/sdx2 /mnt # 読み書き
# アンマウント
sudo umount /dev/sdx2
# rsync(パーミッションなどもコピー)
sudo rsync -av /mnt/ /data/1tb
sudo rsync -av -e 'ssh -c aes128-gcm@openssh.com' /mnt/ xxx@xxx:/data/1tb
# rsync(パーミッション以外をコピー)
sudo rsync -rOtv /mnt/ /data/1tb
sudo rsync -rOtv -e 'ssh -c aes128-gcm@openssh.com' /mnt/ xxx@xxx:/data/1tb
# 抹消(opensslをソースにしたdd)
sudo apt-get install -y pv
dev=ata-xxx &&
openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt </dev/zero \
| pv -bartpes $(sudo blockdev --getsize64 /dev/disk/by-id/$dev) | sudo dd bs=64K of=/dev/disk/by-id/$dev
# SMARTをデスクトップに保存
dev=ata-xxx &&
sudo smartctl --all /dev/disk/by-id/$dev > ~/デスクトップ/smart$(date "+%Y%m%d")_$dev.txt
# 全領域書き込み・読み取りテスト(抹消にもなる)
dev=ata-xxx &&
sudo badblocks -wvs /dev/disk/by-id/$dev
# バックグラウンドで実行
dev="ata-xxx" &&
nohup sudo badblocks -wv -o badblocks.txt "/dev/disk/by-id/$dev" > "$HOME/$dev.log" &
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme