USA Linux Users Group Forum Index
Log in Register FAQ Memberlist Search USA Linux Users Group Forum Index Album

Looking for CLI command

 
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Command Line Commands
View previous topic :: View next topic  
Author Message
JP
Linux Guru


Joined: 07 Jul 2024
Posts: 6671
Location: Central Montana

PostPosted: Thu Nov 15, 2024 2:35 am    Post subject: Looking for CLI command Reply with quote

I thought I had seen, in the past, that someone mentioned a command that would check the integrity of a CD. Here's my problem .... I d/l'ed an ISO and the MD5sums were correct ..... I burned it (at 8x) to CD, and then tried to install it (I'm still looking for a distro to replace Beatrix 2024) but it wouldn't install, I got error messages. This has happened to me with several distros, I'd like to figure out whether it is my burner or just that my 'puter won't install yet another Linux distro. This HP is really bumming me out Exclamation I'd like to think it was a good burn, so I'd like to be able to check the CD to see if it is OK. Does anyone know of a CLI command that might do this? THX, JP



_________________
Dell Box - Arch Linux
Dell Lappy - DreamLinux 3.5 - Default OS
Mepis 8.0 - Backup
Back to top
View user's profile Send private message Visit poster's website
lberg
Sr. Member


Joined: 28 Jul 2024
Posts: 1289

PostPosted: Thu Nov 15, 2024 3:05 am    Post subject: Reply with quote

howabout just using md5sum on the CD itself Question I've heard that one place or another....The problem is I don't know whether you would say
Code:
md5sum /dev/cdrom

or
Code:
md5sum /mnt/cdrom


you know? I don't remember whether you do it to the device or the directory it's mounted in.......

HTH....



_________________
2 Computers: Arch Linux, 64-bit
3 Computers: Arch Linux, 32-bit
Back to top
View user's profile Send private message
jeo
Jr. Member


Joined: 11 Nov 2024
Posts: 69

PostPosted: Thu Nov 15, 2024 3:27 am    Post subject: Reply with quote

Yup, running an md5sum on /dev/cdrom should do it. Here's a good write up:

http://www.cpqlinux.com/cdrw.html

And here's the excerpt that talks about verifying cds and images:

Code:

[root@server /root]# md5sum
- or -
[root@server /root]# diff /dev/cdrom image.iso
- or -
[root@server /root]# mount /mnt/cdrom;
[root@server /root]# mount -t iso9660 iso.image /mnt/isotest -o loop;
[root@server /root]# diff -r /mnt/cdrom /mnt/isotest
- or -
[root@server /root]# md5sum /dev/cdrom >md5sum-cdrom.txt
[root@server /root]# md5sum image.iso >md5sum-file.txt

#Script to verify the md5sum results:
echo "Verifying MD5SUMS:"
MD5SUM1=md5sum-file.txt
MD5SUM2=md5sum-cdrom.txt
cat $MD5SUM1 | while read CODE NAME; do
     if [ -n "`cat $MD5SUM2 | grep $CODE`" ]; then
          echo "Success: $NAME"
     else
          echo "Failure: $NAME"
     fi
done


Back to top
View user's profile Send private message
crouse
Site Admin


Joined: 17 Apr 2024
Posts: 11833
Location: Iowa

PostPosted: Thu Nov 15, 2024 4:48 am    Post subject: Reply with quote

If I'm not mistaken, if you burn it with K3B, there is an option to VERIFY the data burned to the cd, basically just doing what's mentioned above automatically.



_________________
Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
Back to top
View user's profile Send private message Visit poster's website AIM Address
lynch
Moderator


Joined: 15 Nov 2024
Posts: 2659
Location: The Diamond State

PostPosted: Thu Nov 15, 2024 9:22 am    Post subject: Reply with quote

crouse wrote:
If I'm not mistaken, if you burn it with K3B, there is an option to VERIFY the data burned to the cd, basically just doing what's mentioned above automatically.

Yes there is. Look on the page that runs the md5 check and there is an option to "Verify Written Data".



_________________
Mandriva 2024 Spring -2.6.31.12-server-2mnb
PCLinuxOS 2024 -2.6.26.8.tex3
Back to top
View user's profile Send private message
BrionS
Sr. Member


Joined: 04 Jul 2024
Posts: 1074
Location: Rochester, NY

PostPosted: Thu Nov 15, 2024 12:25 pm    Post subject: Reply with quote

I always run the verify after a burn in K3b - it ejects and retracts the disc after the burn. It's a nice sanity check and doesn't take too long.



_________________
Ubuntu 8.10 (64-bit), Ubuntu 7.10 (64-bit)
OpenFiler 2.2 (rPath Linux base), Mythbuntu 8.10
Back to top
View user's profile Send private message
JP
Linux Guru


Joined: 07 Jul 2024
Posts: 6671
Location: Central Montana

PostPosted: Thu Nov 15, 2024 1:33 pm    Post subject: Reply with quote

crouse wrote:
If I'm not mistaken, if you burn it with K3B, there is an option to VERIFY the data burned to the cd, basically just doing what's mentioned above automatically.

I didn't use K3B, I'm using Puppy Linux right now ( Beatrix doesn't have a "burning app" that will work, becuz it's so out of date ! ) and it has something called BurnIso2CD designed specifically for ISO burning .... I'm still trying to find a Linux distro to replace Beatrix .... one that will work for more than a week or so without going TU Laughing Laughing .



jeo wrote:
Yup, running an md5sum on /dev/cdrom should do it. Here's a good write up:

http://www.cpqlinux.com/cdrw.html

And here's the excerpt that talks about verifying cds and images:

Code:

[root@server /root]# md5sum
- or -
[root@server /root]# diff /dev/cdrom image.iso
- or -
[root@server /root]# mount /mnt/cdrom;
[root@server /root]# mount -t iso9660 iso.image /mnt/isotest -o loop;
[root@server /root]# diff -r /mnt/cdrom /mnt/isotest
- or -
[root@server /root]# md5sum /dev/cdrom >md5sum-cdrom.txt
[root@server /root]# md5sum image.iso >md5sum-file.txt

#Script to verify the md5sum results:
echo "Verifying MD5SUMS:"
MD5SUM1=md5sum-file.txt
MD5SUM2=md5sum-cdrom.txt
cat $MD5SUM1 | while read CODE NAME; do
if [ -n "`cat $MD5SUM2 | grep $CODE`" ]; then
echo "Success: $NAME"
else
echo "Failure: $NAME"
fi
done


I haven't yet figured out how to use a script ... looks like NOW might be a good time to learn Smile Smile . I'll have to hop over to bashscripts.org and start asking stupid questions ..... THX, JP



_________________
Dell Box - Arch Linux
Dell Lappy - DreamLinux 3.5 - Default OS
Mepis 8.0 - Backup
Back to top
View user's profile Send private message Visit poster's website
BrionS
Sr. Member


Joined: 04 Jul 2024
Posts: 1074
Location: Rochester, NY

PostPosted: Thu Nov 15, 2024 3:19 pm    Post subject: Reply with quote

Quick primer:

Save the following into a file called 'cdverify.sh' (for example)
Code:
#Script to verify the md5sum results:
echo "Verifying MD5SUMS:"
MD5SUM1=md5sum-file.txt
MD5SUM2=md5sum-cdrom.txt
cat $MD5SUM1 | while read CODE NAME; do
if [ -n "`cat $MD5SUM2 | grep $CODE`" ]; then
echo "Success: $NAME"
else
echo "Failure: $NAME"
fi
done

Run the following commands before executing the script in the same directory:
Code:
md5sum /dev/cdrom > md5sum-cdrom.txt
md5sum /path/to/image.iso > md5sum-file.txt

This will produce two files with one-line contents that look like (for example running 'md5sum apache-tomcat-5.5.23.tar.gz')
Code:
7a4cc2e00c7d2c9d9c4437ede337f832  apache-tomcat-5.5.23.tar.gz


So, what you should have is the contents of the script above saved in a file such as cdverify.sh and run 'chmod 775 cdverify.sh' to make it executable; you should have two files: md5sum-cdrom.txt and md5sum-file.txt that have the md5sums of the two things you're checking (cdrom and iso file) and then you run it with:
Code:
./cdverify.sh



_________________
Ubuntu 8.10 (64-bit), Ubuntu 7.10 (64-bit)
OpenFiler 2.2 (rPath Linux base), Mythbuntu 8.10
Back to top
View user's profile Send private message
masinick
Linux Guru


Joined: 03 Apr 2024
Posts: 8615
Location: Concord, NH

PostPosted: Thu Nov 15, 2024 5:51 pm    Post subject: Be sure to make your script executable Reply with quote

JP, whenever you create a script, make sure to set the file permissions on the file so that the script is executable. An easy way to do this is to add the +x flag to the chmod command rather than providing a specific protection value or mask.

An example is:

Code:
chmod +x ./cdverify.sh


Also, notice that both BrionS and I used the ./ notation in our file spec. This means to look for the file in the current working directory. You can always specify the full path of the file, but unless you are cutting and pasting a lot, that becomes too much typing.



_________________
Brian Masinick
Distros: SimplyMEPIS
sidux - no CAPS!, antiX, Debian
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
BrionS
Sr. Member


Joined: 04 Jul 2024
Posts: 1074
Location: Rochester, NY

PostPosted: Thu Nov 15, 2024 5:58 pm    Post subject: Reply with quote

Yeah, sorry. I've just grown up using the octal notation because it's always worked better for me and I think in octal permissions. I realize this is not how most people thing however. Smile

'man chmod' has a fairly good explanation of the various options. You can combine x, r, and w in any combination you want and even with the o, g, and w options (owner, group, world) to be explicit to which set of users you're modifying permissions for.



_________________
Ubuntu 8.10 (64-bit), Ubuntu 7.10 (64-bit)
OpenFiler 2.2 (rPath Linux base), Mythbuntu 8.10
Back to top
View user's profile Send private message
Pet3M0ss
Advanced Member


Joined: 18 Sep 2024
Posts: 738
Location: NW corner of Montana (Libby)

PostPosted: Fri Nov 16, 2024 12:57 am    Post subject: Reply with quote

Now, JP, you have got to stop living in the old days of BeatrIX Sad

Since Beatrix was the first distro I got from download to install (my SuSE was purchased), I still have a soft spot for it.

Check out http://bea.cabarel.com/ for the BeaFanatix. There are still fellows working on it, and, though not on the top 100 of D-watch, I did a burn a few months ago. First impression is quite good, but I have not done an install.

Masinick, you like to do quick installs. How about a review of the cat with nine lives??



_________________
Slackware 12.2
Slax
Back to top
View user's profile Send private message
JP
Linux Guru


Joined: 07 Jul 2024
Posts: 6671
Location: Central Montana

PostPosted: Fri Nov 16, 2024 5:01 am    Post subject: Reply with quote

Pet3M0ss wrote:


Check out http://bea.cabarel.com/ for the BeaFanatix. There are still fellows working on it, and, though not on the top 100 of D-watch, I did a burn a few months ago.


Been there, done that ..... I d/l'ed and installed .... it TU'd in less than an hour ..... BTW, just went to their site, that's 2024 BeaFanatix - so now that's ancient history Laughing but the good news is .... : trumpet fanfare: ......... :applause: .......... :ooooohs and ahhhhhs: ....... they have now switched to Debris Linux, completely rewritten, still in testing. As soon as I get a regular distro up, I have promised "moonmind" that I will download it and try it out on this HP box, (which doesn't like Linux Sad ).




Thanks BrionS, I tried that out, the text editor in Puppy didn't work for me .... I'll work on it again tomorrow Wink .
Found out it has other text editors, I'll see what I can accomplish over the weekend Wink



_________________
Dell Box - Arch Linux
Dell Lappy - DreamLinux 3.5 - Default OS
Mepis 8.0 - Backup
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Command Line Commands All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All content © 2024-2009 - Usa Linux Users Group
This forum is powered by phpBB. © 2024-2009 phpBB Group
Theme created by phpBBStyles.com and modified by Crouse