Raw Devices

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Raw Devices
# 1  
Old 01-09-2014
RedHat Raw Devices

Can you please modify my script. This script is not working
Code:
for i in /dev/sdf[0-9]
       do
                /bin/raw /dev/raw/`/bin/basename ${i}` ${i}
                /bin/sleep 2
                /bin/chown orasm:ordba /dev/raw/`/bin/basename ${i}`
                /bin/chmod 660 /dev/raw/`/bin/basename ${i}`
      done


Last edited by Franklin52; 01-09-2014 at 03:14 AM.. Reason: Please use code tags
# 2  
Old 01-09-2014
When you say 'not working' what symptoms do you have?

What OS are you running? The needs of each flavour and version can be different.



Robin
# 3  
Old 01-09-2014
I'm running this on Virtual RHEL 6.4 server. We are trying to create raw devices from a VMDK file to install Oracle ASM . I have made partitions on /dev/sdb ad trying to run this script.
Code:
[root@testvm init.d]# bash -x raw1
+ for i in '/dev/sdb[0-9]'
++ /bin/basename /dev/sdb1
+ /bin/raw /dev/raw/sdb1 /dev/sdb1
Usage:
  /bin/raw /dev/raw/rawN <major> <minor>
  /bin/raw /dev/raw/rawN /dev/<blockdev>
  /bin/raw -q /dev/raw/rawN
  /bin/raw -qa
+ sleep 2
++ /bin/basename /dev/sdb1
+ /bin/chown oraasm:oradba /dev/raw/sdb1
/bin/chown: cannot access `/dev/raw/sdb1': No such file or directory
++ /bin/basename /dev/sdb1
+ /bin/chmod 660 /dev/raw/sdb1
/bin/chmod: cannot access `/dev/raw/sdb1': No such file or directory
+ for i in '/dev/sdb[0-9]'
++ /bin/basename /dev/sdb2
+ /bin/raw /dev/raw/sdb2 /dev/sdb2
Usage:
  /bin/raw /dev/raw/rawN <major> <minor>
  /bin/raw /dev/raw/rawN /dev/<blockdev>
  /bin/raw -q /dev/raw/rawN
  /bin/raw -qa
+ sleep 2
++ /bin/basename /dev/sdb2
+ /bin/chown oraasm:oradba /dev/raw/sdb2
/bin/chown: cannot access `/dev/raw/sdb2': No such file or directory
++ /bin/basename /dev/sdb2
+ /bin/chmod 660 /dev/raw/sdb2
/bin/chmod: cannot access `/dev/raw/sdb2': No such file or directory
[root@testvm init.d]#


Last edited by Scott; 01-09-2014 at 01:42 PM.. Reason: Please use code tags...
# 4  
Old 01-09-2014
It's telling you what you're doing wrong:

Code:
+ /bin/raw /dev/raw/sdb1 /dev/sdb1
Usage:
  /bin/raw /dev/raw/rawN <major> <minor>
  /bin/raw /dev/raw/rawN /dev/<blockdev>
  /bin/raw -q /dev/raw/rawN
  /bin/raw -qa

You don't get a /dev/raw/sdb, you get /dev/raw/raw0, /dev/raw/raw1, etc, etc. (This is assuming you have /dev/raw at all.)

You might be able to get away with stripping the 'sdb' out of the filename to use /dev/raw/raw1 for /dev/sdb1, /dev/raw/raw2 for /dev/sdb2, etc, etc, assuming you aren't already using those raw devices for anything.
# 5  
Old 01-09-2014
Thank you for your reply .I need to use the same script for all the servers which i build, My script should recognize the partitions and run the commands.
# 6  
Old 01-09-2014
Well, do any of your other servers use raw devices for anything?
# 7  
Old 01-09-2014
Nope, We are only using this for Oracle ASM.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

Raw devices in C

Hi guys. what is the benefits of using raw devices in programming? which applications mostly use raw devices? how can i use raw devices in C programs? is there any system calls or library functions? (1 Reply)
Discussion started by: majid.merkava
1 Replies

2. 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

3. UNIX for Dummies Questions & Answers

passthrough devices vs. named devices

I am having trouble understanding the difference between a passthrough device and a named device and when you would use one or the other to access equipment. As an example, we have a tape library and giving the command "camcontrol devlist" gives the following output: akx# camcontrol... (1 Reply)
Discussion started by: thumper
1 Replies

4. AIX

Raw I/o

Is there any system call available in AIX to read the size of raw disk? If I use the command "lspv -L",it only gives size of PVs on which file system is there. I need to extract the size raw disk i.e. file system is not there on the disk. Thanks, Megha (6 Replies)
Discussion started by: MeghaV
6 Replies

5. AIX

Error on HACMP5.3 volume group on raw devices after exporting vg

Hi all, We have a problem after exporting a exhanced concurrent capable VG accessed in concurrent mode, created on raw devices ( pSeries 590 AIX5.3 + HACMP5.3 +SAN4300) from node A to node B. On node B the VG is correct activated by HACMP, but on node A we have 0516-306 error "Unable to find... (3 Replies)
Discussion started by: cris1357
3 Replies

6. 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

7. UNIX for Advanced & Expert Users

copying data to raw devices using 'dd'

Hello all, I'm new here, so this information may exist elsewhere on this forum. If so, please point me in the right direction. Here's the problem. I'm trying to migrate Oracle data from an HP system to a Sun system using a raw device as a 'bridge' between the two systems. Both machines... (4 Replies)
Discussion started by: Neville
4 Replies

8. 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
Login or Register to Ask a Question