LinuxQuestions.org
Visit Jeremy's Blog.
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 01-31-2007, 09:58 AM   #1
dambert
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Rep: Reputation: 0
confirming if dd comand is working



Hello:

I have never used dd before and would like to confirm if dd is working if I am using the right command. My distro (recent) does not recognize my sas hard drive.

I contacted the support for my hardware, who led me to a web page containing a gz file which in turn contains a dd file.

In windows/dos I have used rawrite, rawritewin and dd on another machine using in Linux.

I have doubts the file was written to the diskette as when I look at the diskette that dd/rawrite was used on, it has the same capacity as before.

Here is the command in Linux
dd if=mptlinux-3.02.77-3.rhel4.x86_64.dd of=/dev/fd0 bs=1440k
here is the output for the above
1+0 records in
1+0 records out
Here is the command i use for looking at the diskette.
ls /dev/fd0
Here is the output for the above
/dev/fd0
Thanks in advance
 
Old 01-31-2007, 10:49 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,946
Blog Entries: 14

Rep: Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163
/dev/fd0 is the DEVICE. You have to mount the DEVICE to a MOUNTPOINT (directory) then use the MOUNTPOINT to access the files on the floppy.

Check your /etc/fstab to see if it contains an entry for /dev/fd0. Something similar to:
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,utf8,managed 0 0

If so simply typing "mount /dev/fd0" will cause it to use /media/floppy as the MOUNTPOINT. Then typing ls /media/floppy should show you what is on the floppy.

If not typing "mount /dev/fd0 /mnt" should work and typing ls /mnt should show what is on the floppy.

When done don't forget to unmount the floppy before ejecting it:
e.g. umount /media/floppy OR umount /mnt OR umount <YOURMOUNTPOINT>
 
Old 01-31-2007, 10:50 AM   #3
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
here is the output for the above

1+0 records in
1+0 records out
Seems good to me. It took something in, put something out.

Quote:
Here is the command i use for looking at the diskette.

ls /dev/fd0

Here is the output for the above

/dev/fd0
This is where you seem to have trouble. Doing 'ls /dev/fd0' lists information (without extra options, probably just the name) about the given file; in this case you just get the name of the device file /dev/fd0, just like you should. Doing
Code:
ls -l /dev/fd0
gives you some more information like permissions. But to see what is actually in the device, you'll either have to mount it using mount or using fdisk (I'm not sure about this latter method, but..)
Code:
fdisk -l /dev/fd0
The file /dev/fd0 is a special file, device file, but listing it might not give you any good information. Rather ask some program to use that device file to get information out of the actual device.
 
Old 01-31-2007, 11:05 AM   #4
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
dd is working.

You specified block size 1440k and so only one record of 1440k can be written on a floppy is always 1.44Mb large.

/dev/fd0 is a device name. You need to mount it on the /mnt or /media or / before it can be read. Many distro has a empty file of /mnt/floppy for mounting the floppy. Thus issuing this command
Code:
mount /dev/fd0 /mnt/floppy
will cause the floppy being read. Thereafter "ls /mnt/floppy" will show the files inside.

My explanation is no different to Post #2 and #3 except explained in another way. All together you should understand it better.
 
Old 01-31-2007, 11:08 AM   #5
dambert
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlightner
Check your /etc/fstab to see if it contains an entry for /dev/fd0. Something similar to:
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,utf8,managed 0 0

If so simply typing "mount /dev/fd0" will cause it to use /media/floppy as the MOUNTPOINT. Then typing ls /media/floppy should show you what is on the floppy.
Thanks. My /etc/fstab has /mnt/floppy.

For this command
ls /mnt/floppy/
I get this
lost+found modinfo modules.cgz modules.dep pcitable rhdd
So I know something is on the disk now.
 
Old 01-31-2007, 11:18 AM   #6
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,559

Rep: Reputation: 213Reputation: 213Reputation: 213
The dd command syntax is correct. I believe the ouput indicates that data was only written to the boot sector of the floppy, i.e. the first sector of the floppy. If that is the case, you won't see any change in the capacity of the floppy as the boot sector is not normally accessible for data writing; it is only read by the bios during bootup. Whether that is correct behaviour, I can't tell you. I suspect if you boot with the floppy loaded, your bios will detect it as a bootable floppy and load whatever is on the first sector into memory. If I'm right, mounting the floppy won't reveal anything as the boot sector cannot normally be read.
 
Old 01-31-2007, 11:45 AM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by kilgoretrout
The dd command syntax is correct. I believe the ouput indicates that data was only written to the boot sector of the floppy, i.e. the first sector of the floppy.
I don't see what in this thread leads you to this conclusion. OP reported doing dd with block size of 1440 and it reported doing so without error. (When dd says "1 record out (in)" it means 1 record of the size you specified.)
 
Old 01-31-2007, 12:12 PM   #8
dambert
LQ Newbie
 
Registered: Jan 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Yes, I should have known about mounting the floppy.

Another way of confirming that dd or rawrite worked is using df after mounting on a diskette which blank before running dd or rawrite
df -k
==>
/dev/hda2 3225252 2796264 265128 92% /
/dev/hda1 101086 6116 89751 7% /boot
none 95076 0 95076 0% /dev/shm
/dev/hda5 3510332 1933940 1398076 59% /home
/dev/fd0 1412 1016 324 76% /mnt/floppy
dd and rawrite get similar results when using ls or df.
 
Old 01-31-2007, 12:43 PM   #9
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,946
Blog Entries: 14

Rep: Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163
Quote:
Originally Posted by dambert
Thanks. My /etc/fstab has /mnt/floppy.

For this command
ls /mnt/floppy/
I get this
lost+found modinfo modules.cgz modules.dep pcitable rhdd
So I know something is on the disk now.

Glad I could help. A technical note though. You'd use df -h /mnt/floppy after mount to verify it is mounted /dev/fd0. The ls command will show you the contents of /mnt/floppy. If it is in fact mounted then you're seeing what's on the floppy. If it isn't mounted you're actually just seeing local files rather than those from the floppy. (Typically /mnt/floppy should be empty if no floppy is mounted but if someone wrote into thinking it was mounted when it wasn't you'd see this kind of thing. Best to use df -h on it to be sure it is the mount you think it is.)
 
Old 01-31-2007, 02:07 PM   #10
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,559

Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
I don't see what in this thread leads you to this conclusion. OP reported doing dd with block size of 1440 and it reported doing so without error. (When dd says "1 record out (in)" it means 1 record of the size you specified.)
You are right I missed the bs=1440k and concentrated on the 1+0 records in/out. Sorry about the confusion. My prior post should be disregarded.
 
Old 01-31-2007, 02:39 PM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Pixellany has eyes as sharp as a pixel.
 
Old 02-01-2007, 09:27 AM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by saikee
Pixellany has eyes as sharp as a pixel.
Maybe, but only after cataract surgery on both eyes last year.

Actually, I am just a nitpicker........
 
  


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
Confirming a secure custom Chroot jail mikeyt_333 Linux - Security 7 04-13-2006 11:42 AM
Need comferting / confirming :( Slith(++1) Linux - Security 8 09-08-2005 08:29 AM
Help w/comand line dolvmin Linux - Software 2 09-23-2003 04:28 PM
Confirming and testing Nvidia drivers are installed LinuxBAH Linux - General 5 06-30-2003 12:53 AM
Confirming Debian Version dunkyb Linux - General 2 02-22-2003 09:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:51 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