1
April
2021
DVD and CDs Verification Verification
16:39

DVD and CDs Verification Verification

1 April 2021 16:39

Often, after writing data on a new DVD-R disc, I want to make sure that the files are read. Also, the old scratched CD-R discs can cause suspicions of terms of their reading in the DVD-RW drive. Before using such discs, it is advisable to perform a reading check that will not take much time.

Method 1. Checking the disk reading using the DD command

This method is not very good, because It does not give an idea of ​​which of the files is not read. But the fastest
And the result tells - whether the disk is read as a whole or not.

dd if=/dev/dvdrw of=/dev/Null

or for the external drive DVD:

dd if=/dev/sr1 of=/dev/Null

where DVDrw, sr1 - имена устройств для чтения/записи CD/DVD, которые можно узнать с помощью команды cd-drIve из пакета libcdio-utils).

An example of the result of the execution:
dd if=/dev/dvdrw of=/dev/null
626688+0 records in
626688+0 records out
320864256 bytes (321 MB, 306 MiB) copied, 68,8281 s, 4,7 MB/s

Method 2. Checking reading files on the disk using the Find and CP /DEV /NULL commands

A good way, although quite slow, if there are many files. Team

find /media/vladimir -type f -exec cp "{}" /dev/null \;

where VLadimir - имя пользователя

The analysis (explanation) of the team:
The Find team is looking for in the catalog /media/vladimir/Name_Disk all files (-type f)
And on each of them, the CP command is (-exec).

At the same time, two curly brackets {} belong to the FIND command,
for the CP command, the name of the current processed file is set up instead of brackets (see man find ):

The string `{}' is replaced by the current file name being processed everywhere it occurs in the arguments to the commaND

Y what the quotes around figured brackets?
These are symbols of severe shielding.

Y what you need a comma point at the end of the team?
This is also explained in man find :

All Followingarguments to find are taken to be arguments to the command until an argument consisting of `;' is encounterEd.

That is, a semicolon limits the list of arguments of the FIND command.

She, the reverse slash is used (oblique line - "\") in front of the point with the comma ";"; ?
Without an oblique feature, an error about the missed argument is displayed
-exec cp "{}" /dev/null ;
find: missing argument to-exec'`
That is, the oblique feature in my opinion is used for a single shielding of the argument ";"; (end of the arguments).

Details about the shielding of the syntax of the command interpreter Bash are better to know from the courses or textbooks of Linux. Since this goes beyond this article.

This command should be performed when the optical disk in the DVD-ROM drive was identified by the system and its mount in the catalog occurred /media (диск появился в Проводнике PCmanfm).

The result of the command on the old, scratched CD disk:

find /media/vladimir -type f -exec cp "{}" /dev/null \;
cp: error reading '/media/vladimir/HBCD 15.2 RUS/HBCD/Boot/pmagic/pmodules/PMAGIC_2012_10_10.SQFS': Ошибка ввода/вывода

Method 3. Calculation of the control amount (hash) from the recorded disk (MD5Sum and SHA256SUM)

If the disk was burned with the ISO image, you can compare the source control amount of the image file and the control amount
After reading the disk.

It is necessary to download the recorded CD or DVD disk in DVD-RW and execute the command

md5sum /dev/dvdrW.

The speed of execution depends on the speed of the drive and the data volume

For example, the result to remove the control amount of the disk
4b6f499873f282c8dd95adaf071eec68 /dev/dvdrw

At the original image of the disk also withdrew the amount
md5sum xubuntu-20.04.2.0-desktop-amd64.iso
4b6f499873f282c8dd95adaf071eec68 xubuntu-20.04.2.0-desktop-amd64.iso

The comparison shows that the control amounts coincide, the disk is recorded efficiently and is well read.

Recently, the control amount has been calculated according to the SHA256 algorithm
For example, indicated on the page https: //mirror.yandex.ru/ubuntu-cdimage/xubuntu/releases/20.04/release/
The control amount by the SHA256 algorithm for the specified distribution is (see the Sha256Sums file)
C59C3BB825294DBF76FD3a5dfa3fd5de9e854934b7c9aa6258105b6648979cd5 *xubuntu-20.04.2.0-desktop-amD64.iso

You can compare the image file with the specified amount (which means that the image is completely loaded, correct):

sha256sum xubuntu-20.04.2.0-desktop-amD64.iso

The result of the audit:
c59c3bb825294dbf76fd3a5dfa3fd5de9e854934b7c9aa6258105b6648979cd5 xubuntu-20.04.2.0-desktop-amd64.iso

The specified control amounts (hash-smoke) coincide. So the ISO image corresponds to the original, from the web site.


Source (author Borisych):