LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-21-2012, 03:50 AM   #1
chinabenjamin66
Member
 
Registered: Mar 2012
Location: Shenzhen Chian
Posts: 73

Rep: Reputation: Disabled
Why device file cannot be calculsted md5 code?


Hello friends

Does anyone know why device files cannot be calculated md5 code?
Code:
brwx------  1 root root   8, 247 Nov 16 07:06 sdp7
brwx------  1 root root   8, 248 Nov 16 07:06 sdp8
brwx------  1 root root   8, 249 Nov 16 07:06 sdp9
crwx------  1 root root   3,   0 Nov 16 07:06 ttyp0
crwx------  1 root root   3,   1 Nov 16 07:06 ttyp1
root@gpl-vm:/GPL/test/ufsd/pearl/PX-4846/Sourcecode_PX-4846/7011N_GPL/7011N_ORG_2.5.3.00TA/image/fw/data/fw.bin-squashfs-1/dev# md5sum sda1
^C
root@gpl-vm:/GPL/test/ufsd/pearl/PX-4846/Sourcecode_PX-4846/7011N_GPL/7011N_ORG_2.5.3.00TA/image/fw/data/fw.bin-squashfs-1/dev#
 
Old 11-21-2012, 03:57 AM   #2
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,452

Rep: Reputation: 85
Code:
[~]$ cat /etc/mtab
/dev/xvda1 / ext3 rw,noatime,barrier=0,usrquota,grpquota,barrier=0,usrquota,grpquota 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
none /proc/xen xenfs rw 0 0
[~]$ sudo tail /dev/xvda1
[sudo] password for bullshark:
^C%                                                                             [~]$
Because md5sum needs input to create the hash. I didn't get any output when using the tail command or cat command on that a device.
 
1 members found this post helpful.
Old 11-21-2012, 04:37 AM   #3
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
Why you break a command by "^C"? If sda1 is large it needs time to complete.
 
1 members found this post helpful.
Old 11-21-2012, 04:41 AM   #4
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,452

Rep: Reputation: 85
Right, it needs time to complete. By just getting the first few lines, you can get a hash pretty quickly.

Code:
[~]$ sudo head /dev/xvda1 | md5sum
507594dde6e406744685e1daf97e93f3  -
[~]$
I had forgotten that I used to do this in the past to verify an ISO file burned properly with the /dev device for the cd/dvd burner.

Last edited by fakie_flip; 11-21-2012 at 04:43 AM.
 
Old 11-21-2012, 08:26 AM   #5
chinabenjamin66
Member
 
Registered: Mar 2012
Location: Shenzhen Chian
Posts: 73

Original Poster
Rep: Reputation: Disabled
Hello All,

Yes, you are right. I should wait it return the result.

this is a example:
Code:
root@benjamin-virtual-machine:/dev# md5sum /dev/sda5
1b4fcd13fec340be90f2e62e342614a9  /dev/sda5
root@benjamin-virtual-machine:/dev#
 
Old 12-01-2012, 03:22 PM   #6
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,452

Rep: Reputation: 85
Please go to "Thread Tools" -> Mark as "[Solved]"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Bash, when I read sort write md5 file, the writen file have a space missing peter1234 Linux - General 3 09-21-2010 10:04 AM
ned for code of md5 manish jain Programming 2 04-02-2008 09:48 AM
MD5 Collision Source Code Released primo Linux - Security 7 11-23-2005 09:46 AM
MD5 of device...how to? NiallC *BSD 4 06-08-2004 01:46 PM
what is MD5 code? Warchief Linux - Newbie 5 07-23-2003 09:00 AM


All times are GMT -5. The time now is 02:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration