Ahojte,
v minulosti som mal nejake probelmy s externym diskom na ktorom som mal NTFS a bol pouzivany na Windowse a Linuxe. Ak si dobre spominam tak v Linuxe som si vsimol Input/output error a vo Windowse (bolo to davnejsie tak detaily z nepamatam) sa jednalo o nieco take ze checksum suboru nesedel po tom co bol nakopirovany na tento disk. Na tomto disku su prevazne multimedia. Tento disk som teda odlozil bokom a vcera som zacal jeho zachranu a to nasledovne:
Na novom disku som vytvoril miesto pre ddrescue image
root@ryzen:~# zpool create datastore /dev/sdc
Naklonoval som si teda tento disk cez ddrescue a vyzera ze to zbehlo bez najmensich problemov (PC bol sice vypnuty aleto je iny pribeh
https://forum.root.cz/index.php?topic=24195.msg343752):
root@ryzen:/datastore# ddrescue -v -d -n /dev/sdd1 img.img img.log
root@ryzen:/datastore# ddrescue -v -d -r 3 /dev/sdd1 img.img img.log
GNU ddrescue 1.23
About to copy 2000 GBytes from '/dev/sdd1' to 'img.img'
Starting positions: infile = 0 B, outfile = 0 B
Copy block size: 128 sectors Initial skip size: 39168 sectors
Sector size: 512 Bytes
Press Ctrl-C to interrupt
Initial status (read from mapfile)
rescued: 2000 GB, tried: 0 B, bad-sector: 0 B, bad areas: 0
Current status
ipos: 0 B, non-trimmed: 0 B, current rate: 0 B/s
opos: 0 B, non-scraped: 0 B, average rate: 0 B/s
non-tried: 0 B, bad-sector: 0 B, error rate: 0 B/s
rescued: 2000 GB, bad areas: 0, run time: 0s
pct rescued: 100.00%, read errors: 0, remaining time: n/a
time since last successful read: n/a
Finished
root@ryzen:/datastore# cat img.log
# Mapfile. Created by GNU ddrescue version 1.23
# Command line: ddrescue -v -d -r 3 /dev/sdd1 img.img img.log
# Start time: 2021-01-24 11:03:07
# Current time: 2021-01-24 11:03:07
# Finished
# current_pos current_status current_pass
0x1D1C0E90000 + 1
# pos size status
0x00000000 0x1D1C0E98200 +
Nasledne som ddrescue image mountol ako read only a tiez vsetko vyzera byt OK
root@ryzen:/datastore# mount -o ro /datastore/img.img /mnt/SAMSUNG_2TB
root@ryzen:/datastore# df -hT
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 3.2G 9.2M 3.2G 1% /run
/dev/mapper/pve-root ext4 57G 2.1G 52G 4% /
tmpfs tmpfs 16G 25M 16G 1% /dev/shm
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sdb2 vfat 511M 312K 511M 1% /boot/efi
datastore zfs 3.6T 1.9T 1.7T 52% /datastore
/dev/fuse fuse 30M 16K 30M 1% /etc/pve
tmpfs tmpfs 3.2G 0 3.2G 0% /run/user/0
/dev/loop0 ntfs 1.9T 1.1T 771G 59% /mnt/SAMSUNG_2TB
Vsimol som si vsak ze v jednom pripade je problem s pristupom ku suboru
root@ryzen:/mnt/SAMSUNG_2TB# du -sh * | sort -h
du: cannot access 'EDU_VIDEOS/coursera/Coursera - Stanford University - Jeff Ulman - Automata/02 - Week 2 Regular Expression and Properties of Regular Languages/03 - 7. Decision algorithms for regular languages (41 min.)/7_rs1.pdf': Input/output error
Vylistoval som si teda vsetky subory na mountnutom disku a aplikoval na ne
ls aby som videl ci je este niekde problem s citanim a toto je vysledok:
root@ryzen:/datastore# find /mnt/SAMSUNG_2TB -exec ls -la {} \; > list_of_files.txt 2>&1
root@ryzen:/datastore# grep 'Input\/output error' list_of_files.txt
ls: cannot access '/mnt/SAMSUNG_2TB/EDU_VIDEOS/coursera/Coursera - Stanford University - Jeff Ulman - Automata/02 - Week 2 Regular Expression and Properties of Regular Languages/03 - 7. Decision algorithms for regular languages (41 min.)/7_rs1.pdf': Input/output error
ls: cannot access '/mnt/SAMSUNG_2TB/EDU_VIDEOS/coursera/Coursera - Stanford University - Jeff Ulman - Automata/02 - Week 2 Regular Expression and Properties of Regular Languages/03 - 7. Decision algorithms for regular languages (41 min.)/7_rs1.pdf': Input/output error
root@ryzen:/datastore# grep '\?' list_of_files.txt
-????????? ? ? ? ? ? 7_rs1.pdf
Vyzera to teda ze az na tento jeden subor je cely FS vporiadku.
Pripajam aj vypisy z logov
root@ryzen:/datastore# dmesg | egrep 'sd[a-d]|ntfs'
[ 1.694636] sd 3:0:0:0: [sda] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
[ 1.694637] sd 3:0:0:0: [sda] 4096-byte physical blocks
[ 1.694642] sd 3:0:0:0: [sda] Write Protect is off
[ 1.694643] sd 3:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 1.694650] sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1.709774] sd 4:0:0:0: [sdb] 488397168 512-byte logical blocks: (250 GB/233 GiB)
[ 1.709781] sd 4:0:0:0: [sdb] Write Protect is off
[ 1.709782] sd 4:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[ 1.709792] sd 4:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1.715693] sd 8:0:0:0: [sdc] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
[ 1.715694] sd 8:0:0:0: [sdc] 4096-byte physical blocks
[ 1.715697] sd 8:0:0:0: [sdc] Write Protect is off
[ 1.715699] sd 8:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[ 1.715704] sd 8:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1.726181] sdb: sdb1 sdb2 sdb3
[ 1.727350] sd 4:0:0:0: [sdb] supports TCG Opal
[ 1.727351] sd 4:0:0:0: [sdb] Attached SCSI removable disk
[ 1.735545] sd 3:0:0:0: [sda] Attached SCSI removable disk
[ 1.811147] sdc: sdc1 sdc9
[ 1.811374] sd 8:0:0:0: [sdc] Attached SCSI removable disk
[ 2.598413] sd 10:0:0:0: [sdd] 3907029167 512-byte logical blocks: (2.00 TB/1.82 TiB)
[ 2.598904] sd 10:0:0:0: [sdd] Write Protect is off
[ 2.598905] sd 10:0:0:0: [sdd] Mode Sense: 2b 00 10 08
[ 2.599394] sd 10:0:0:0: [sdd] Write cache: enabled, read cache: enabled, supports DPO and FUA
[ 3.030878] sdd: sdd1
[ 3.032673] sd 10:0:0:0: [sdd] Attached SCSI disk
[ 1041.102751] ntfs: driver 2.1.32 [Flags: R/O MODULE].
[ 1041.105653] ntfs: volume version 3.1.
[ 1268.754273] __ntfs_error: 6 callbacks suppressed
[ 1268.754274] ntfs: (device loop0): map_mft_record_page(): Mft record 0x1c52 is corrupt. Run chkdsk.
[ 1268.754287] ntfs: (device loop0): map_mft_record(): Failed with error code 5.
[ 1268.754292] ntfs: (device loop0): ntfs_read_locked_inode(): Failed with error code -5. Marking corrupt inode 0x1c52 as bad. Run chkdsk.
root@ryzen:/datastore# grep 'sd[a-d]' /var/log/messages
Jan 24 02:09:38 ryzen kernel: [ 3173.161789] sdc: sdc1 sdc9
Jan 24 02:44:10 ryzen kernel: [ 5245.471556] sd 10:0:0:0: [sdd] Spinning up disk...
Jan 24 02:44:18 ryzen kernel: [ 5253.021523] sd 10:0:0:0: [sdd] 3907029167 512-byte logical blocks: (2.00 TB/1.82 TiB)
Jan 24 02:44:18 ryzen kernel: [ 5253.022028] sd 10:0:0:0: [sdd] Write Protect is off
Jan 24 02:44:18 ryzen kernel: [ 5253.022520] sd 10:0:0:0: [sdd] Write cache: enabled, read cache: enabled, supports DPO and FUA
Jan 24 02:44:18 ryzen kernel: [ 5253.050368] sdd: sdd1
Jan 24 02:44:18 ryzen kernel: [ 5253.051833] sd 10:0:0:0: [sdd] Attached SCSI disk
Jan 24 10:48:37 ryzen kernel: [ 1.694636] sd 3:0:0:0: [sda] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
Jan 24 10:48:37 ryzen kernel: [ 1.694637] sd 3:0:0:0: [sda] 4096-byte physical blocks
Jan 24 10:48:37 ryzen kernel: [ 1.694642] sd 3:0:0:0: [sda] Write Protect is off
Jan 24 10:48:37 ryzen kernel: [ 1.694650] sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jan 24 10:48:37 ryzen kernel: [ 1.709774] sd 4:0:0:0: [sdb] 488397168 512-byte logical blocks: (250 GB/233 GiB)
Jan 24 10:48:37 ryzen kernel: [ 1.709781] sd 4:0:0:0: [sdb] Write Protect is off
Jan 24 10:48:37 ryzen kernel: [ 1.709792] sd 4:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jan 24 10:48:37 ryzen kernel: [ 1.715693] sd 8:0:0:0: [sdc] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
Jan 24 10:48:37 ryzen kernel: [ 1.715694] sd 8:0:0:0: [sdc] 4096-byte physical blocks
Jan 24 10:48:37 ryzen kernel: [ 1.715697] sd 8:0:0:0: [sdc] Write Protect is off
Jan 24 10:48:37 ryzen kernel: [ 1.715704] sd 8:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jan 24 10:48:37 ryzen kernel: [ 1.726181] sdb: sdb1 sdb2 sdb3
Jan 24 10:48:37 ryzen kernel: [ 1.727350] sd 4:0:0:0: [sdb] supports TCG Opal
Jan 24 10:48:37 ryzen kernel: [ 1.727351] sd 4:0:0:0: [sdb] Attached SCSI removable disk
Jan 24 10:48:37 ryzen kernel: [ 1.735545] sd 3:0:0:0: [sda] Attached SCSI removable disk
Jan 24 10:48:37 ryzen kernel: [ 1.811147] sdc: sdc1 sdc9
Jan 24 10:48:37 ryzen kernel: [ 1.811374] sd 8:0:0:0: [sdc] Attached SCSI removable disk
Jan 24 10:48:37 ryzen kernel: [ 2.598413] sd 10:0:0:0: [sdd] 3907029167 512-byte logical blocks: (2.00 TB/1.82 TiB)
Jan 24 10:48:37 ryzen kernel: [ 2.598904] sd 10:0:0:0: [sdd] Write Protect is off
Jan 24 10:48:37 ryzen kernel: [ 2.599394] sd 10:0:0:0: [sdd] Write cache: enabled, read cache: enabled, supports DPO and FUA
Jan 24 10:48:37 ryzen kernel: [ 3.030878] sdd: sdd1
Jan 24 10:48:37 ryzen kernel: [ 3.032673] sd 10:0:0:0: [sdd] Attached SCSI disk
Co z tohoto mozem usidit?
1. Je Disk je OK (nakolko ho ddrescue naklonoval) a poskodeny je len subor 7_rs1.pdf resp samotny FS?
2. Co este mozem skusit aby som sa uistil ze disk/FS je OK?
3. Tym ze je image ulozeny na ZFS mozem si spravit nejaku zalohu cez snapshot pred tym nez skusim nejake tooly na opravovanie imageu? ddrescue image ma cca 1.9T, disk ma 4T (realne cca 3.6T) a zostava mi cca 1.7T volneho miesta, takze klasicku kopiu cez cp nespravim lebo nemam miesto.
4. V akom stave su nastroje na pracu s NTFS pod linuxom, je lepsie subor opravit vo Windowse alebo Linuxe? Tu
https://unix.stackexchange.com/questions/39905/input-output-error-when-accessing-a-directory sa spomina ntfs vs ntfs-3g ale je to niekolko rokov stary clanok.
5. Bolo by mozne tento image dostat do Windowsu a opravit ho tam? Ak ano ako? Rozmyslam nieco na styl ze: spravit virtualku s Windowsom a do nej nejako "mountnut" tento image ako disk nad ktorym uz mozem pustat windows utility. Je nieco take mozne?
6. Ma vobec zmysel opravovat tento image ked vyzera ze vsetko az na jeden subor je OK?
7. Co mohlo sposobit chyby ktore opisujem v uvode?
Dakujem