Sponsored Content
Full Discussion: Raw I/o
Operating Systems AIX Raw I/o Post 302142095 by bakunin on Wednesday 24th of October 2007 10:15:14 AM
Old 10-24-2007
The problem is there is not a single solution to this, so i give you a list of options you have in order of preferability (is this a word? english is not my native language):

SCSI-disk and native SSA-disks (not SSA-RAID-volumes, etc.) have an attribute called "size_in_mb", which you could read. Example: to get the size of hdisk0 you can type (and get this sample information for a 18GB disk)

Code:
# lsattr -El hdisk0 -a size_in_mb
size_in_mb 18200 Size in Megabytes False

If the disk in question is in a volume group you can find out with lspv like this (output is exemplary):
Code:
# lspv hdisk4
PHYSICAL VOLUME:    hdisk4                   VOLUME GROUP:     joker_int_vg
PV IDENTIFIER:      000bf05d981228ff VG IDENTIFIER     000bf05d95422f4d
PV STATE:           active                                     
STALE PARTITIONS:   0                        ALLOCATABLE:      yes
PP SIZE:            64 megabyte(s)           LOGICAL VOLUMES:  4
TOTAL PPs:          1093 (69952 megabytes)   VG DESCRIPTORS:   2
FREE PPs:           130 (8320 megabytes)     HOT SPARE:        no
USED PPs:           963 (61632 megabytes)    MAX REQUEST:      256 kilobytes
FREE DISTRIBUTION:  00..00..00..00..130                        
USED DISTRIBUTION:  219..219..218..218..89

you could also use bootinfo, BUT: bootinfo is usually only executable by root, whereas lsattr is executable by everybody AND the bootinfo command won't work on some disks.

I hope this helps.

bakunin
 

8 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

raw partitions

i want to know, how do i to create a rwa partttions in unixware 7 wit raid 5 best regards felix arteaga (1 Reply)
Discussion started by: farteaga
1 Replies

2. UNIX for Advanced & Expert Users

Raw vs. Filesystem?

Maybe this is the wrong forum to start this debate and I apologize if it is, but I have been wondering for some time which is better to use for a database, raw or filesystem? By better I mean don't just mean better performance but also ease of maintenance, etc. I know that several years ago it... (5 Replies)
Discussion started by: keelba
5 Replies

3. Solaris

About raw partition

Hi I have solaris 8 installed on Intel machine. the disk I have is IDE. I would like to know how can I create a raw partition on an IDE disk. Regards, Raja (2 Replies)
Discussion started by: RajaRC
2 Replies

4. UNIX for Dummies Questions & Answers

raw disk

What do u mean by raw and cooked disk? What are the advantages of having raw disk? Thanks n regards, (1 Reply)
Discussion started by: kingsto88
1 Replies

5. UNIX for Dummies Questions & Answers

Using the Raw command

Hi, What is a Raw command and how does it work? We have to print out a large report from our database numerically and wanted to know how it can be done. :confused: (1 Reply)
Discussion started by: nov_user
1 Replies

6. Filesystems, Disks and Memory

Raw volumes

The query is as follows : A typical server configs when using Oracle or any other type of DB is to install the OS + DB binaries on the internal disks of the relevant server e.g. Disk 1 : OS + SW + DB binaries Disk 2 : Mirror of disk 1 (used for resiliency) Then one uses an external array... (1 Reply)
Discussion started by: kekanap
1 Replies

7. Red Hat

Raw Devices

Can you please modify my script. This script is not working for i in /dev/sdf do /bin/raw /dev/raw/`/bin/basename ${i}` ${i} /bin/sleep 2 /bin/chown orasm:ordba /dev/raw/`/bin/basename ${i}` /bin/chmod 660... (9 Replies)
Discussion started by: karthik9358
9 Replies

8. UNIX for Beginners Questions & Answers

Specify the raw format

Hey friends, i am trying to set up a raspbian wheezy vm on ma Unbuntu using qemu. when i try to run the setup command the error is: i tried to find something here in the forum but did not find anything. i was searching like 15 min pls dont roast me if there is a post explaining it. :)... (3 Replies)
Discussion started by: LinuxPlayer1809
3 Replies
RAW(8)							      System Manager's Manual							    RAW(8)

NAME
raw - bind a Linux raw character device SYNOPSIS
raw /dev/raw/raw<N> <major> <minor> raw /dev/raw/raw<N> /dev/<blockdev> raw -q /dev/raw/raw<N> raw -qa DESCRIPTION
raw is used to bind a Linux raw character device to a block device. Any block device may be used: at the time of binding, the device driver does not even have to be accessible (it may be loaded on demand as a kernel module later). raw is used in two modes: it either sets raw device bindings, or it queries existing bindings. When setting a raw device, /dev/raw/raw<N> is the device name of an existing raw device node in the filesystem. The block device to which it is to be bound can be specified either in terms of its major and minor device numbers, or as a path name /dev/<blockdev> to an existing block device file. The bindings already in existence can be queried with the -q option, with is used either with a raw device filename to query that one device, or with the -a option to query all bound raw devices. Once bound to a block device, a raw device can be opened, read and written, just like the block device it is bound to. However, the raw device does not behave exactly like the block device. In particular, access to the raw device bypasses the kernel's block buffer cache entirely: all I/O is done directly to and from the address space of the process performing the I/O. If the underlying block device driver can support DMA, then no data copying at all is required to complete the I/O. Because raw I/O involves direct hardware access to a process's memory, a few extra restrictions must be observed. All I/Os must be cor- rectly aligned in memory and on disk: they must start at a sector offset on disk, they must be an exact number of sectors long, and the data buffer in virtual memory must also be aligned to a multiple of the sector size. The sector size is 512 bytes for most devices. Use the /etc/sysconfig/rawdevices file to define the set of raw device mappings automatically created during the system startup sequence. The format of the file is the same used in the command line with the exception that the "raw" command itself is omitted. OPTIONS
-q Set query mode. raw will query an existing binding instead of setting a new one. -a With -q , specifies that all bound raw devices should be queried. -h provides a usage summary. BUGS
The Linux dd (1) command does not currently align its buffers correctly, and so cannot be used on raw devices. Raw I/O devices do not maintain cache coherency with the Linux block device buffer cache. If you use raw I/O to overwrite data already in the buffer cache, the buffer cache will no longer correspond to the contents of the actual storage device underneath. This is deliberate, but is regarded either a bug or a feature depending on who you ask! AUTHOR
Stephen Tweedie (sct@redhat.com) Version 0.1 Aug 1999 RAW(8)
All times are GMT -4. The time now is 03:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy