• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
raw access to system disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

raw access to system disk


  • Subject: raw access to system disk
  • From: "Navneet Kumar" <email@hidden>
  • Date: Sat, 15 Dec 2007 13:48:00 +0530

Hi,

The following is the problem and comments that I received.

Please let me know if they are correct.

 

Q: I’m trying to write software that should access raw disk and analyze

file system structures.

For that I need to read /dev/rdisk0 … rdisk1 etc files.

While I can open secondary hard disk (/dev/rdisk1) using POSIX function open() and also fopen(), it fails in case of system disk /dev/rdisk0 (permission denied).

ANS: You must execute the open() of the root disk volume in an authenticated root user process.  Much the same way that you would use dd from the command line.

 

Q: Does that mean I'll have to enter the admin user passwd thru some GUI.

ANS: Yes, you will need to authenticate.

 

Q: But there are software in the market that access the system disk with out getting the admin user to enter the passwd.

ANS: I suspect that those tools are not accessing the physical disk, but rather just a partition and even then, the cooked rather than raw device node.  You were asking about the entire raw disk (/dev/ rdisk0).  To access just a slice is different (/dev/disk0s3 for example).  That may be possible, but there are situations where you're going to run into auth requirements.

 

Q: If I try and implement Authorization, will the admin username and passwd be enough and will there be no need to enable root account and get the user to enter root passwd? I gather that root passwd can be different from admin passwd. I also tried implementing “AuthForAll” sample code just to test but it was tricky as I’m a newbie. Can anyone provide me with simple steps to run a process as authorized to have system disk access? Also even if I succeed in reading the system disk (/dev/rdisk0), how do I get its size, and other info like model number etc?

 

 

Any help would be greatly appreciated.

 

Thanks in advance.

Navneet

 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Identifying CD drives across reboots
  • Next by Date: Re: hw.cpufamily vs ASP vs machine.h
  • Previous by thread: Re: Identifying CD drives across reboots
  • Next by thread: Re: hw.cpufamily vs ASP vs machine.h
  • Index(es):
    • Date
    • Thread