|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Verify integrity of disk image file written to disk ?
I have copied the file https://<local-mirror-domain-name>/pub/OpenBSD/6.2/amd64/install62.fs
to a flash drive using dd(1), according to the instrucions in /pub/OpenBSD/6.2/amd64/INSTALL.amd64. These instructions also suggest that Quote:
$ doas dd if=/dev/rsd1c of=/path/to/install62.fs.copy bs=1m .The problem is that /dev/rsd1c (the drive that contains the copied image) is larger than install62.fs (the original file). Any attempt to copy and compare will inevitably fail. One possible solution is to extract the 'install62.fs' data from the drive before copying it to a file, but I can't find a command to do this. Once I have a duplicate file, it's a simple matter of running cmp(1), sha256(1), or sha512(1) to see if the two files match. Does anyone have any suggestions for how to copy the image on the drive back to a file so I can verify that the drive was written correctly? I can mount the file systems and see the files, so I think it's OK, but I'd like to have some extra assurance since this is part of my emergency recovery plan. Thanks. |
|
|||
Hi jggimi,
Thanks for the example. I missed the count=n option when I read dd(1). It turns out that this drive wasn't actually written correctly, in spite of the fact that it appeared OK on visual inspection. The initial sha256(1) checksum comparison failed. Running cmp(1) revealed 40 errors. I re-wrote the drive and now the checksums match. Lesson: Appearances are deceiving. If byte-for-byte accuracy is important, run a checksum. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to get % written in file copy operation? | Prevet | OpenBSD General | 6 | 26th November 2017 10:33 AM |
disk mgt and zfs | ananix | FreeBSD General | 1 | 26th December 2011 10:37 PM |
Disk > 100% | Weaseal | FreeBSD General | 3 | 11th February 2009 05:50 PM |
Disk geometry for Seagate disk | phreud | FreeBSD Installation and Upgrading | 5 | 8th November 2008 10:51 PM |
backup drive to image file | milo974 | OpenBSD General | 8 | 14th August 2008 02:01 PM |