Sponsored Content
Full Discussion: How raw disks are read?
Top Forums UNIX for Advanced & Expert Users How raw disks are read? Post 302802743 by jlliagre on Saturday 4th of May 2013 04:59:01 PM
Old 05-04-2013
A raw disk is accessed through a file descriptor so is technically still a (single and big) file, as far as POSIX is concerned. There are operations that won't work like truncating or enlarging the file but otherwise, it can be read by seeking to the expected location and reading the data there. Same for writing.
 

8 More Discussions You Might Find Interesting

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

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

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

4. Fedora

Read only disks on Linux system

Hi guys I have a SSL server that is running Fedora 9. I wanted to create a directory but get: mkdir: cannot create directory `test': Read-only file system Any ideas? (4 Replies)
Discussion started by: wbdevilliers
4 Replies

5. Solaris

Solaris raw disks info

Hi, I need the following information. 1. We have raw disks but how to identify raw disks. Is there any command to identify its type and size. 2. How to differentiate between disks which are used as file system and that are still available to be used as raw. I know we can use df -n to... (7 Replies)
Discussion started by: malikshahid85
7 Replies

6. HP-UX

Converting RAW Disks to Filesystem

Hi, We have a new server which has 2.7 TB RAW Disk.Outof this we want to convery 1.2 TB to filesystem and nfs mount it on one of the servers. After our activity we need to convert this back to RAW Disks. Please let me know if this is possible and the complexity involved. Regards, VN (1 Reply)
Discussion started by: narayanv
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
elf_cntl(3ELF)						       ELF Library Functions						    elf_cntl(3ELF)

NAME
elf_cntl - control an elf file descriptor SYNOPSIS
cc [ flag ... ] file ... -lelf [ library ... ] #include <libelf.h> int elf_cntl(Elf *elf, Elf_Cmd cmd); DESCRIPTION
elf_cntl() instructs the library to modify its behavior with respect to an ELF descriptor, elf. As elf_begin(3ELF) describes, an ELF descriptor can have multiple activations, and multiple ELF descriptors may share a single file descriptor. Generally, elf_cntl() commands apply to all activations of elf. Moreover, if the ELF descriptor is associated with an archive file, descriptors for members within the ar- chive will also be affected as described below. Unless stated otherwise, operations on archive members do not affect the descriptor for the containing archive. The cmd argument tells what actions to take and may have the following values: ELF_C_FDDONE This value tells the library not to use the file descriptor associated with elf. A program should use this command when it has requested all the information it cares to use and wishes to avoid the overhead of reading the rest of the file. The memory for all completed operations remains valid, but later file operations, such as the initial elf_getdata() for a sec- tion, will fail if the data are not in memory already. ELF_C_FDREAD This command is similar to ELF_C_FDDONE, except it forces the library to read the rest of the file. A program should use this command when it must close the file descriptor but has not yet read everything it needs from the file. After elf_cntl() completes the ELF_C_FDREAD command, future operations, such as elf_getdata(), will use the memory version of the file without needing to use the file descriptor. If elf_cntl() succeeds, it returns 0. Otherwise elf was NULL or an error occurred, and the function returns -1. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
elf(3ELF), elf_begin(3ELF), elf_getdata(3ELF), elf_rawfile(3ELF), libelf(3LIB), attributes(5) NOTES
If the program wishes to use the ``raw'' operations (see elf_rawdata(), which elf_getdata(3ELF) describes, and elf_rawfile(3ELF)) after disabling the file descriptor with ELF_C_FDDONE or ELF_C_FDREAD, it must execute the raw operations explicitly beforehand. Otherwise, the raw file operations will fail. Calling elf_rawfile() makes the entire image available, thus supporting subsequent elf_rawdata() calls. SunOS 5.10 11 Jul 2001 elf_cntl(3ELF)
All times are GMT -4. The time now is 02:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy