• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

Device file permissions on mac os x

I m wanted to read hard disk but unable to read. I m able to read any .txt and .doc file on mac os x.

I have two hard disks attached with my system
#: type name size identifier
0: FDisk_partition_scheme *18.6 GB disk0
1: DOS_FAT_32 NO NAME 9.8 GB disk0s1
#: type name size identifier
0: Apple_partition_scheme *55.9 GB disk1
1: Apple_partition_map 31.5 KB disk1s1
2: Apple_Driver43 28.0 KB disk1s2
3: Apple_Driver43 28.0 KB disk1s3
4: Apple_Driver_ATA 28.0 KB disk1s4
5: Apple_Driver_ATA 28.0 KB disk1s5
6: Apple_FWDriver 256.0 KB disk1s6
7: Apple_Driver_IOKit 256.0 KB disk1s7
8: Apple_Patches 256.0 KB disk1s8
9: Apple_HFS Macintosh HD 55.9 GB disk1s9

and the file permissions of these device files are
brw-r----- 1 root operator 14, 0 28 Oct 11:41 /dev/disk0
brw-r----- 1 root operator 14, 1 28 Oct 11:41 /dev/disk1

I have tried to change the permissions through root but message is
chmod o+r /dev/disk0
chmod: /dev/disk0: Operation not permitted

How i can change the file permissions.
plz tell how i have to proceed and give solution to the problem described.
1 Solution
You already asked this question using a slightly different membername (forbidden on EE, BTW).
manojchauhanAuthor Commented:
hi sir
   Plz give reply to my question.
   I am using my friends id to solve my problem, he has two ids of expert exchange

First of All, you can never change the permission of device file (even with root permission).
This said, if you want to open a device file from your application you can use the following commands:
Open , read, write and close.

according to apple:
"If you know the name of a device file (for example, disk0s2 or mt0) your application can use POSIX functions such as open, read, write, and close to access and control the associated device."

See this link for more details:

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

manojchauhanAuthor Commented:
dear sir
        thanks a lot for giving such a valuable comment. But i  have  changed the device file permissions login through super user. and after giving all rights to the /dev/rdisk0 i m now able to read the hard disk.
      Again thanx a lots for sparing such a valuable time for my question.
with regards
Hi again,

I'm new to unix but for this question I asked one of my colleagues who is supposed to be an expert in UNIX and he ensured me that it is impossible to change device file permission.
Anyway, I learned something new.
Thank you for this information.

PAQd, 125 points refunded.

Community Support Moderator

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now