LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 10-23-2003, 10:13 AM   #1
jaa1180
Member
 
Registered: Oct 2003
Location: USA, Tennessee
Distribution: Ubuntu
Posts: 307

Rep: Reputation: 30
Question dtype in linux?


In unix there is a command 'dtype' to find the disk type. Is there something similar in linux?
 
Old 10-23-2003, 11:01 AM   #2
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
http://www.linuxquestions.org/questi...hreadid=107574
http://www.linuxquestions.org/questi...hreadid=107571

If you post this same question in another 4 threads, I am sure you will get your answer.
(Sorry for the light sarcasm, but expect worse...)

man hdparm

RO

Example:
hdparm -i /dev/hdc
/dev/hdc:

Model=GCR-8481B, FwRev=1.06, SerialNo=
Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
BuffType=unknown, BuffSize=0kB, MaxMultSect=0
(maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 *udma2
AdvancedPM=no

or
hdparm -I /dev/hdc

ATAPI CD-ROM, with removable media
Model Number: GCR-8481B
Serial Number:
Firmware Revision: 1.06
Standards:
Used: ATAPI for CD-ROMs, SFF-8020i, r2.5
Supported: CD-ROM ATAPI-1
Configuration:
DRQ response: 50us.
Packet size: 12 bytes
Capabilities:
LBA, IORDY(can be disabled)
DMA: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 *udma2
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
 
Old 10-23-2003, 11:46 AM   #3
jaa1180
Member
 
Registered: Oct 2003
Location: USA, Tennessee
Distribution: Ubuntu
Posts: 307

Original Poster
Rep: Reputation: 30
I know... I expected some one to notice but I needed an answer.
Thanks.
MMM... is there another command with less info...maybe like 'file' it just tells you the file type?
 
Old 10-23-2003, 12:04 PM   #4
tcaptain
LQ Addict
 
Registered: Jul 2002
Location: Montreal
Distribution: Gentoo 2004 from stage 1 baby!
Posts: 1,403

Rep: Reputation: 45
Everyone who asks questions needs an answer...its not really an excuse to spam to board. Usually the people here are pretty good.
 
Old 10-23-2003, 12:12 PM   #5
jaa1180
Member
 
Registered: Oct 2003
Location: USA, Tennessee
Distribution: Ubuntu
Posts: 307

Original Poster
Rep: Reputation: 30
Yes sir, you are correct tcaptain. I really was unsure where to put the thread and also the obvious. Do you happen to know the answer to the question?
 
Old 10-23-2003, 12:21 PM   #6
tcaptain
LQ Addict
 
Registered: Jul 2002
Location: Montreal
Distribution: Gentoo 2004 from stage 1 baby!
Posts: 1,403

Rep: Reputation: 45
no unfortunately I don't but I'm paying attention to the thread because I'd also like to know the answer
 
Old 10-23-2003, 12:33 PM   #7
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
Didn't I answer it?

RO
 
Old 10-23-2003, 12:57 PM   #8
misophist
Member
 
Registered: Aug 2003
Location: here
Distribution: suse 8.2
Posts: 169

Rep: Reputation: 30
RolledOat did answer the question. It looks like dtype is deprecated. Unix in a Nutshell doesn't list it as a Korn shell command. Bash, and Zsh don't support it. hdparm is a wonderful tool. Read the man page. Learn the options you want and forget the rest. Every user needs reference books. Try O'Reilly's Nutshell series.
 
Old 10-23-2003, 01:14 PM   #9
jaa1180
Member
 
Registered: Oct 2003
Location: USA, Tennessee
Distribution: Ubuntu
Posts: 307

Original Poster
Rep: Reputation: 30
Well, rolledoat did but did not. dtype apparently is specific to SCO UNIX. I found the HTML version man page of it on SCO's site doing a google search. hdparm is for the HDD.... can it be used for floppys, CDroms and whatever else?
I think hdparm is just HDD.... here is description.....
hdparm is a Linux shell utility for viewing and manipulating various IDE drive and driver parameters. Most drives can benefit from improved performance using a command similar to "hdparm -qm8 -qu1 -qc1 -qd1 /dev/hda".
 
Old 10-23-2003, 01:16 PM   #10
jaa1180
Member
 
Registered: Oct 2003
Location: USA, Tennessee
Distribution: Ubuntu
Posts: 307

Original Poster
Rep: Reputation: 30
well, here is a better description....
dtype -- determine disk type

Syntax
dtype [-s] device ...
Description
The dtype command determines the type of a disk and prints pertinent information on the standard output (unless the silent (-s) option is selected), then exits with a corresponding value (see below). When more than one argument is given for device, the exit value corresponds to the last argument.

You can use this for CD-Rom, floppy, or whatever.....
Ideas????
 
Old 10-23-2003, 03:46 PM   #11
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
You could write a simple bash script and use tests to see if the supplied parameter (a device name) is a block device, character device...etc. Then just let the exit code tell you what kind it is. If that's what you're looking for....
Code:
#!/bin/bash
if [ -b "$1" ]
then
	echo "$1 is a block device."
	exit 10
elif [ -c "$1" ]
then
	echo "$1 is a character device."
	exit 11
fi
...or use case. In any case (pun intended! ) you could very easily create a little script using whatever utilities you wish - if it's a block device you could run hdparm on it...etc.

Håkan
 
Old 10-23-2003, 04:22 PM   #12
jaa1180
Member
 
Registered: Oct 2003
Location: USA, Tennessee
Distribution: Ubuntu
Posts: 307

Original Poster
Rep: Reputation: 30
??? I can do a long listing and see if it is a block or character device.
I wanted to see the disk type... IE fat32, ext3, .........
 
Old 10-23-2003, 04:49 PM   #13
misophist
Member
 
Registered: Aug 2003
Location: here
Distribution: suse 8.2
Posts: 169

Rep: Reputation: 30
Try 'cat /etc/fstab' or 'fdisk /dev/?' then.
 
Old 10-23-2003, 07:33 PM   #14
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Oh! Partition types, that's a whole different story. Well I don't have much of an idea for that...other than cat'ing fstab like misophist suggested, but that will only show the partition types for commonly mounted partitions.

Håkan
 
  


Reply



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
link dies intermittently-seemingly at random- between win<->linux not linux<->linux?? takahaya Linux - Networking 10 03-09-2007 10:37 PM
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 10:40 PM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 02:49 PM
dtype command in linux? jaa1180 Linux - Software 3 10-23-2003 04:08 PM
dtype command in linux? jaa1180 Linux - General 4 10-23-2003 04:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 09:29 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
Open Source Consulting | Domain Registration