Difference between /dev/hdisk and /dev/rhdisk


 
Thread Tools Search this Thread
Operating Systems AIX Difference between /dev/hdisk and /dev/rhdisk
# 1  
Old 06-22-2013
Difference between /dev/hdisk and /dev/rhdisk

Hi,

How can i check that i am using RAW devices for storage in my AIX machine...

Also after adding a LUN from storage to a aix host, when i check /dev in the host, i can see both rhdisk and hdisk with same number

eg:
Code:
dcback1(root):/dev>ls -lrt | grep disk12
crw-------    1 root     system       23,  4 Feb 28 13:11 rhdisk12
brw-------    1 root     system       23,  4 Feb 28 13:11 hdisk12
dcback1(root):/dev>

but in lsdev, i can see only hdisk...

What is the difference between /dev/rhdisk and /dev/hdisk...

Regards,
jibu

Moderator's Comments:
Mod Comment edit by bakunin: please use CODE-tags

Last edited by bakunin; 06-23-2013 at 05:09 AM..
# 2  
Old 06-23-2013
The question can easily be answered with a 5-second google search for "AIX rhdisk hdisk". I suggest you read the first hit coming up on this search:

IBMs documentation.

Even without searching for anything your directory listing shows one to be a character-device and the other to be a block device.

For the future i suggest using google first and us second.

I hope this helps.

bakunin
# 3  
Old 06-23-2013
Hi bakunin,

I had gone through google prior to posting and couldnot identify whether my filesytem is made of the rawdisks or non-raw disks....

I could understand that 'c' indicated character and 'b' indicated block access. But still i couldnot decide on whether my machine uses raw devices or not...

Regards,
Jibu
# 4  
Old 06-23-2013
It usually helps if you ask what you really want to know, instead of something vaguely related to that. We are not adverse to explaining things, but commonly get angry when we get the feeling that we are abused to cover a lack of energy.

Quote:
Originally Posted by jibujacob
I had gone through google prior to posting and couldnot identify whether my filesytem is made of the rawdisks or non-raw disks....
Your filesystem is made of volumes, neither raw nor other disks. That is the point of having a logical volume manager.

There is a driver for each certain (type of) disk: SCSI drives, LUNs, whatever. This driver creates a blockdevice and a character device. If you want to use the device directly, you can do that and, for instance, use a program like "dd" to write to it.

Otherwise you give this device to the LVM, which uses it to create Physical Volumes, PVs. "creating PVs" means it writes all sort of management-information onto it, like the VGDA (volume group descriptor area), etc.. Think of this like taking open (raw) land and build roads, create lots, and so on: the land is still unused, but now the means to use it are there.

Now you create Logical Volumes, LVs, on this now usable space. You can use such an LV like a raw device too (and this is sometimes done, for instance with databases), but it is not the same as the raw devices from before, because now this raw space is under control of the LVM and can be handled by its methods: it can be moved to another PV, increased in size, ...

Finally, you can create a filesystem on such an LV, instead of using the provided space directly. You could also create a swap space, a dump device or something entirely different instead. Depending on what you create a certain driver (for filesystems the filesystem driver) will use the LV to create the entity it is designed to provide.

I hope this clears it up a bit.

bakunin

Last edited by bakunin; 06-23-2013 at 12:43 PM..
# 5  
Old 06-23-2013
Basically, for all *NIX systems, filesystems are created and used via block devices, not character devices.

By definition, character devices have a window of 1 char - a driver might buffer that a little bit (so you can unchar(), or back up one byte.

Block devices are, by definition - finite in size (while char devices may be infinite) - and block devices are "seekable". Because they are seekable, an information system, such as a file system can be stored on them.

Note: some device drivers use ioctl() to perform actions similar to seek - hence the confusion. However, the original definition (at least as far back as UNIX v6) was that character devices did not seek.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. HP-UX

Dev/urandom and dev/random missing in HP-UX

Hi, In our HP-UX B.11.11. I could not find dev/urandom and dev/random Are all pseudo-devices implemented as device drivers, or in need to run /configure some package to install the package to have dev/urandom. Please help (4 Replies)
Discussion started by: rashi
4 Replies

2. Red Hat

Changing grub from /dev/sda to /dev/sdb

Hi, Please suggest steps to change grub from /dev/sda to /dev/sdb, (1 Reply)
Discussion started by: manoj.solaris
1 Replies

3. AIX

How can I map hdisk# to rhdisk#?

Some storage/disks have been added to an existing AIX 6.1 server. The admin sent me the list of hdisk#'s for the new disks, but I need the corresponding rhdisk# for the same hdisk. (I know from past experience that the rhdisk that maps to an hdisk is not always the same number. For instance,... (5 Replies)
Discussion started by: sbrower
5 Replies

4. Shell Programming and Scripting

Automating partitioning setup of /dev/sda on /dev/sdc

Objective: To recreate the partitioning setup of /dev/sda on /dev/sdc How would I parse the below information and initialize variables (an array?) that can be used to build sgdisk commands in a script, regardless of the number of partitions? Something along the lines of: sgdisk -n... (12 Replies)
Discussion started by: RogerBaran
12 Replies

5. AIX

Problem in /dev/hd1 and /dev/hd9var

Hello AIXians, I can't boot my AIX, it hangs and stops at the code error: 0518 After searching google, I knew the problem is due to problems in File Systems. So the solution is booting from any bootable media, then run these commands in maintenance mode: #fsck -y /dev/hd4 #fsck -y... (3 Replies)
Discussion started by: Mohannad
3 Replies

6. Solaris

Lun remove, stuck in /dev/dsk and /dev/rdsk

So, we removed a LUN from the SAN and the system is refusing to remove the references to it in the /dev folder. I've done the following: devfsadm -Cv powermt -q luxadm -e offline <drive path> luxadm probe All those commands failed to remove the path. The drive stills shows up as <drive... (13 Replies)
Discussion started by: DustinT
13 Replies

7. UNIX for Dummies Questions & Answers

Difference between /dev and devices

Please explain me the difference between /dev and devices.. Googled info is - /dev - where logical device names stores here devices - physical device info stores here... Could any one explain me.. the real difference and major one (3 Replies)
Discussion started by: VijaySolaris
3 Replies

8. UNIX for Dummies Questions & Answers

Sending alt-n to /dev/pts/1 from process bound to /dev/pts/2

Hello, i am using finch (unix commandline instant messaging client using libgnt) which is running connected to /dev/pts/1 Now I would like to "remote control" the program by sending the key combinations normally typed on the keyboard from a programm in another shell. So I tried:... (0 Replies)
Discussion started by: mentos
0 Replies

9. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies
Login or Register to Ask a Question