blob: 6886ee9e84080c2e096c62537ca9af7f025fc039 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#! /usr/bin/env bash
# https://old.reddit.com/r/linux/comments/b3kj72/recently_decided_to_archive_some_of_my_dvds/
#NAME=$1
#ARRAY=($(isoinfo -d -f -i /dev/sr0 | grep -i -E 'block size|volume size' | sed '/is/ s/[^:]*: *//; s/,.*//'))
#printf "Creating $NAME\n"
#printf "bs=${ARRAY[0]}, count=${ARRAY[1]}\n"
#dcfldd if=/dev/sr0 of=$NAME bs=${ARRAY[0]} count=${ARRAY[1]} status=on errlog=errors.log hash=md5 hashlog=hash.log
# https://gist.github.com/Querulous/3124f53ce6ddf5a55c262234e74028ba
BLOCK_SIZE=$(isosize -x /dev/sr0 | awk '{print $6}')
# ddrescue "direct" mode doesn't work with my drive, it just spams errors.
ddrescue -b $BLOCK_SIZE -r 1 -v /dev/sr0 --log-events=events.log --log-rates=rates.log --log-reads=reads.log "$1.iso" "$1.log"
|