Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
By the_gripmaster at 2011-11-14 19:39
This tutorial is about how to verify the integrity of a DV/DVD burned from a ISO. Some CD/DVD burning applications add extra data when burning to the CD/DVD. So, a direct MD5 of the media may give you a misleading result. The trick is to calculate the MD5 of the CD/DVD disregarding the extra data the burning application has written.
#!/usr/bin/env sh
# Purpose: check integrity of a burned DVD with the ISO
if [ $# -ne 1 ]; then
echo "Usage: $0 /path/to/isofile.iso"
exit 1
fi
# the hash application to use, can be other like sha1sum, sha256sum, sha512sum, cksum
HASHAPP='md5sum'
# change if your device is different
DVDDRIVE='/dev/dvd'
# the ISO file
ISOFILE=$1
# check to see if file exists
if ! [ -e ${ISOFILE} ]; then
echo "${ISOFILE} does not exist"
exit 1
fi
hash_of_iso=$(${HASHAPP} ${ISOFILE} | cut -d' ' -f1)
echo "info: ${HASHAPP} of ${ISOFILE} - ${hash_of_iso}"
bytes_of_iso=$(wc --bytes ${ISOFILE})
hash_of_dvd=$(dd if=${DVDDRIVE} | head --bytes ${bytes_of_iso} | ${HASHAPP} | cut -d' ' -f1)
echo "info: ${HASHAPP} of ${DVDDRIVE} - ${hash_of_dvd}"
if [ ${hash_of_iso} == ${hash_of_dvd} ]; then
echo "OK: ${HASHAPP} of ISO(${bytes_of_iso}) matches ${HASHAPP} of DVD(${hash_of_dvd})"
exit 0
else
echo "FAIL: ${HASHAPP} of ISO(${bytes_of_iso}) does not match ${HASHAPP} of DVD(${hash_of_dvd})"
exit 1
fi
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.