A file may become corrupted during transfer. We can use checksum to check data integrity of a file. Checksum is a number generated from the file using a checksum algorithm like md5, SHS224, SHA256. An SHA256 Checksum file is included with the OS10 package which can be used to check data integrity of the file downloaded to the switch.
The Checksum of every firmware version is different. Check in the Installation package for the Checksum File.
Switch# dir image Directory contents for folder: image Date (modified) Size (bytes) Name --------------------- ------------ ------------------------------------------ 2020-12-18T12:54:51Z 477981208 PKGS_OS10-Enterprise-10.5.0.7.745stretch-installer-x86_64.bin |
Command |
Explanation |
---|---|
Switch# image verify image://<image name> sha256 |
Command to calculate the sha256 checksum of the file. |
Switch# image verify image://PKGS_OS10-Enterprise-10.5.0.7.745stretch-installer-x86_64.bin sha256 Hash of image: d69dd152db027cb81b80be5a1f4b6e5c63e2d187d5c0e9f73e2d6d1a3b9c6d57 |
Command Syntax
Use of tab will not autofill the "system" commands.
Command |
Explanation |
---|---|
Switch# system “ls /var/os10-image/” |
Verify that the downloaded file is present in the folder /var/os10-image/ |
Switch# system "sha256sum /var/os10-image/<image file name>" |
Command to calculate the sha256 checksum of the file. |
Sample output
Switch# system “ls /var/os10-image/” PKGS_OS10-Enterprise-10.5.0.7.745stretch-installer-x86_64.bin ========>Verify file name Switch# system "sha256sum /var/os10-image/</PKGS_OS10-Enterprise-10.5.0.7.745stretch-installer-x86_64.bin" d69dd152db027cb81b80be5a1f4b6e5c63e2d187d5c0e9f73e2d6d1a3b9c6d57 /var/os10-image/PKGS_OS10-Enterprise-10.5.0.7.745stretch-installer-x86_64.bin ========>Verify the checksum with the checksum in file |
Command Syntax
Command |
Explanation |
---|---|
Switch# system bash |
Log in to Shell, We have to provide an admin password. |
admin@Switch:~$ ls /var/os10-image/ |
Verify that the downloaded file is present in the folder /var/os10-image/ |
admin@Switch/var/os10-image$ sha256sum /var/os10-image/<image file name> |
Command to calculate the sha256 checksum of the file. |
admin@Switch/var/os10-image$ exit |
Exit |
Sample output
Switch# system bash ============>Provide admin password when prompted admin@Switch:~$ ls /var/os10-image/ PKGS_OS10-Enterprise-10.5.0.7.745stretch-installer-x86_64.bin ========>Verify file name admin@Switch:~$ sha256sum /var/os10-image/PKGS_OS10-Enterprise-10.5.0.7.745stretch-installer-x86_64.bin d69dd152db027cb81b80be5a1f4b6e5c63e2d187d5c0e9f73e2d6d1a3b9c6d57 /var/os10-image/PKGS_OS10-Enterprise-10.5.0.7.745stretch-installer-x86_64.bin ========>Verify the checksum with the checksum in file |